diff --git a/src/webui/www/.eslintrc.json b/src/webui/www/.eslintrc.json deleted file mode 100644 index 69e9d3abf..000000000 --- a/src/webui/www/.eslintrc.json +++ /dev/null @@ -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" - } -} diff --git a/src/webui/www/eslint.config.mjs b/src/webui/www/eslint.config.mjs new file mode 100644 index 000000000..1e84f9d6e --- /dev/null +++ b/src/webui/www/eslint.config.mjs @@ -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" + } + } +]; diff --git a/src/webui/www/package.json b/src/webui/www/package.json index 95e8ad9dc..7b11828f0 100644 --- a/src/webui/www/package.json +++ b/src/webui/www/package.json @@ -12,8 +12,8 @@ }, "devDependencies": { "@stylistic/eslint-plugin": "*", - "eslint": "^8", - "eslint-plugin-html": "^8", + "eslint": "*", + "eslint-plugin-html": "*", "html-validate": "*", "i18next-parser": "*", "js-beautify": "*",