WebUI: Use `closest()` to get parent element
[qBittorrent.git] / src / webui / www / eslint.config.mjs
blob293288b0349c882785158e73ba3675c40adefdcc
1 import Globals from "globals";
2 import Html from "eslint-plugin-html";
3 import Js from "@eslint/js";
4 import PreferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
5 import Stylistic from "@stylistic/eslint-plugin";
6 import * as RegexpPlugin from "eslint-plugin-regexp";
8 export default [
9     Js.configs.recommended,
10     RegexpPlugin.configs["flat/recommended"],
11     Stylistic.configs["disable-legacy"],
12     {
13         files: [
14             "**/*.html",
15             "**/*.js",
16             "**/*.mjs"
17         ],
18         languageOptions: {
19             ecmaVersion: 2022,
20             globals: {
21                 ...Globals.browser
22             }
23         },
24         plugins: {
25             Html,
26             PreferArrowFunctions,
27             RegexpPlugin,
28             Stylistic
29         },
30         rules: {
31             "curly": ["error", "multi-or-nest", "consistent"],
32             "eqeqeq": "error",
33             "guard-for-in": "error",
34             "no-undef": "off",
35             "no-unused-vars": "off",
36             "no-var": "error",
37             "operator-assignment": "error",
38             "prefer-arrow-callback": "error",
39             "prefer-const": "error",
40             "radix": "error",
41             "PreferArrowFunctions/prefer-arrow-functions": "error",
42             "Stylistic/no-mixed-operators": [
43                 "error",
44                 {
45                     "groups": [
46                         ["&", "|", "^", "~", "<<", ">>", ">>>", "==", "!=", "===", "!==", ">", ">=", "<", "<=", "&&", "||", "in", "instanceof"]
47                     ]
48                 }
49             ],
50             "Stylistic/nonblock-statement-body-position": ["error", "below"],
51             "Stylistic/quotes": [
52                 "error",
53                 "double",
54                 {
55                     "avoidEscape": true,
56                     "allowTemplateLiterals": true
57                 }
58             ],
59             "Stylistic/semi": "error",
60             "Stylistic/spaced-comment": ["error", "always", { "exceptions": ["*"] }]
61         }
62     }