mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
WebUI: migrate to ESLint v9
This commit is contained in:
parent
79eb7b8e38
commit
e2d6cd31b2
3 changed files with 43 additions and 31 deletions
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es2022": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@stylistic/disable-legacy"
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"html",
|
|
||||||
"@stylistic"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"eqeqeq": "error",
|
|
||||||
"no-undef": "off",
|
|
||||||
"no-unused-vars": "off",
|
|
||||||
"@stylistic/no-mixed-operators": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"groups": [
|
|
||||||
["&", "|", "^", "~", "<<", ">>", ">>>", "==", "!=", "===", "!==", ">", ">=", "<", "<=", "&&", "||", "in", "instanceof"]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@stylistic/nonblock-statement-body-position": ["error", "below"],
|
|
||||||
"@stylistic/semi": "error"
|
|
||||||
}
|
|
||||||
}
|
|
41
src/webui/www/eslint.config.mjs
Normal file
41
src/webui/www/eslint.config.mjs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
import Globals from 'globals';
|
||||||
|
import Html from 'eslint-plugin-html';
|
||||||
|
import Js from '@eslint/js';
|
||||||
|
import Stylistic from '@stylistic/eslint-plugin';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
Js.configs.recommended,
|
||||||
|
Stylistic.configs["disable-legacy"],
|
||||||
|
{
|
||||||
|
files: [
|
||||||
|
"**/*.html",
|
||||||
|
"**/*.js",
|
||||||
|
"**/*.mjs"
|
||||||
|
],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2022,
|
||||||
|
globals: {
|
||||||
|
...Globals.browser
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
Html,
|
||||||
|
Stylistic
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"eqeqeq": "error",
|
||||||
|
"no-undef": "off",
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"Stylistic/no-mixed-operators": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"groups": [
|
||||||
|
["&", "|", "^", "~", "<<", ">>", ">>>", "==", "!=", "===", "!==", ">", ">=", "<", "<=", "&&", "||", "in", "instanceof"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Stylistic/nonblock-statement-body-position": ["error", "below"],
|
||||||
|
"Stylistic/semi": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
|
@ -12,8 +12,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stylistic/eslint-plugin": "*",
|
"@stylistic/eslint-plugin": "*",
|
||||||
"eslint": "^8",
|
"eslint": "*",
|
||||||
"eslint-plugin-html": "^8",
|
"eslint-plugin-html": "*",
|
||||||
"html-validate": "*",
|
"html-validate": "*",
|
||||||
"i18next-parser": "*",
|
"i18next-parser": "*",
|
||||||
"js-beautify": "*",
|
"js-beautify": "*",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue