WebUI: migrate to ESLint v9

This commit is contained in:
Chocobo1 2024-04-06 15:28:33 +08:00
parent 79eb7b8e38
commit e2d6cd31b2
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 43 additions and 31 deletions

View file

@ -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"
}
}

View 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"
}
}
];

View file

@ -12,8 +12,8 @@
},
"devDependencies": {
"@stylistic/eslint-plugin": "*",
"eslint": "^8",
"eslint-plugin-html": "^8",
"eslint": "*",
"eslint-plugin-html": "*",
"html-validate": "*",
"i18next-parser": "*",
"js-beautify": "*",