WebUI: migrate ESLint rules

https://eslint.style/guide/migration

PR #20727.
This commit is contained in:
Chocobo1 2024-05-03 21:03:08 +08:00 committed by GitHub
commit 79eb7b8e38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 7 deletions

View file

@ -3,13 +3,19 @@
"browser": true, "browser": true,
"es2022": true "es2022": true
}, },
"extends": "eslint:recommended", "extends": [
"eslint:recommended",
"plugin:@stylistic/disable-legacy"
],
"plugins": [ "plugins": [
"html" "html",
"@stylistic"
], ],
"rules": { "rules": {
"eqeqeq": "error", "eqeqeq": "error",
"no-mixed-operators": [ "no-undef": "off",
"no-unused-vars": "off",
"@stylistic/no-mixed-operators": [
"error", "error",
{ {
"groups": [ "groups": [
@ -17,9 +23,7 @@
] ]
} }
], ],
"no-undef": "off", "@stylistic/nonblock-statement-body-position": ["error", "below"],
"no-unused-vars": "off", "@stylistic/semi": "error"
"nonblock-statement-body-position": ["error", "below"],
"semi": "error"
} }
} }

View file

@ -11,6 +11,7 @@
"lint": "eslint private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js && stylelint **/*.css && html-validate private public" "lint": "eslint private/*.html private/scripts/*.js private/views/*.html public/*.html public/scripts/*.js && stylelint **/*.css && html-validate private public"
}, },
"devDependencies": { "devDependencies": {
"@stylistic/eslint-plugin": "*",
"eslint": "^8", "eslint": "^8",
"eslint-plugin-html": "^8", "eslint-plugin-html": "^8",
"html-validate": "*", "html-validate": "*",