Skip to content

Commit

Permalink
Update JS dependencies and eslint (go-gitea#22190)
Browse files Browse the repository at this point in the history
- Update all JS dependencies to latest version
- Enable unicorn/prefer-node-protocol and autofix issues
- Regenerate SVGs
- Add some comments to eslint rules
- Tested build, Mermaid and Katex rendering
  • Loading branch information
silverwind authored Dec 20, 2022
1 parent 495b8b3 commit e767b33
Show file tree
Hide file tree
Showing 14 changed files with 1,574 additions and 1,342 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ steps:

# TODO: We should probably build all dependencies into a test image
- name: test-e2e
image: mcr.microsoft.com/playwright:v1.28.0-focal
image: mcr.microsoft.com/playwright:v1.29.0-focal
commands:
- curl -sLO https://go.dev/dl/go1.19.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea
Expand Down
6 changes: 3 additions & 3 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ rules:
no-irregular-whitespace: [2]
no-iterator: [2]
no-label-var: [2]
no-labels: [0]
no-labels: [0] # handled by no-restricted-syntax
no-lone-blocks: [2]
no-lonely-if: [0]
no-loop-func: [0]
Expand Down Expand Up @@ -335,7 +335,7 @@ rules:
no-void: [2]
no-warning-comments: [0]
no-whitespace-before-property: [2]
no-with: [0]
no-with: [0] # handled by no-restricted-syntax
nonblock-statement-body-position: [2]
object-curly-newline: [0]
object-curly-spacing: [2, never]
Expand Down Expand Up @@ -495,7 +495,7 @@ rules:
unicorn/prefer-native-coercion-functions: [2]
unicorn/prefer-negative-index: [2]
unicorn/prefer-node-append: [0]
unicorn/prefer-node-protocol: [0]
unicorn/prefer-node-protocol: [2]
unicorn/prefer-node-remove: [0]
unicorn/prefer-number-properties: [0]
unicorn/prefer-object-from-entries: [2]
Expand Down
2 changes: 1 addition & 1 deletion build/generate-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import imageminZopfli from 'imagemin-zopfli';
import {optimize} from 'svgo';
import {fabric} from 'fabric';
import {readFile, writeFile} from 'fs/promises';
import {readFile, writeFile} from 'node:fs/promises';

function exit(err) {
if (err) console.error(err);
Expand Down
6 changes: 3 additions & 3 deletions build/generate-svg.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node
import fastGlob from 'fast-glob';
import {optimize} from 'svgo';
import {parse} from 'path';
import {readFile, writeFile, mkdir} from 'fs/promises';
import {fileURLToPath} from 'url';
import {parse} from 'node:path';
import {readFile, writeFile, mkdir} from 'node:fs/promises';
import {fileURLToPath} from 'node:url';

const glob = (pattern) => fastGlob.sync(pattern, {
cwd: fileURLToPath(new URL('..', import.meta.url)),
Expand Down
Loading

0 comments on commit e767b33

Please sign in to comment.