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,
"es2022": true
},
"extends": "eslint:recommended",
"extends": [
"eslint:recommended",
"plugin:@stylistic/disable-legacy"
],
"plugins": [
"html"
"html",
"@stylistic"
],
"rules": {
"eqeqeq": "error",
"no-mixed-operators": [
"no-undef": "off",
"no-unused-vars": "off",
"@stylistic/no-mixed-operators": [
"error",
{
"groups": [
@ -17,9 +23,7 @@
]
}
],
"no-undef": "off",
"no-unused-vars": "off",
"nonblock-statement-body-position": ["error", "below"],
"semi": "error"
"@stylistic/nonblock-statement-body-position": ["error", "below"],
"@stylistic/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"
},
"devDependencies": {
"@stylistic/eslint-plugin": "*",
"eslint": "^8",
"eslint-plugin-html": "^8",
"html-validate": "*",