Skip to content

Commit ea19eb8

Browse files
committed
Build: Migrate to the ESLint flat config
1 parent 700212e commit ea19eb8

File tree

6 files changed

+166
-204
lines changed

6 files changed

+166
-204
lines changed

.eslintignore

-5
This file was deleted.

.eslintrc.json

-25
This file was deleted.

app/src/.eslintrc.json

-10
This file was deleted.

eslint.config.mjs

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import jqueryConfig from "eslint-config-jquery";
2+
import globals from "globals";
3+
4+
export default [
5+
{
6+
linterOptions: {
7+
reportUnusedDisableDirectives: "error"
8+
}
9+
},
10+
11+
{
12+
ignores: [
13+
"app/dist/**",
14+
"external/**",
15+
"jquery-ui/**",
16+
"template/**",
17+
"test/fixtures/**",
18+
"tmp/**",
19+
"*.min.js"
20+
]
21+
},
22+
23+
{
24+
languageOptions: {
25+
sourceType: "commonjs",
26+
ecmaVersion: 2022,
27+
parserOptions: {
28+
globalReturn: true
29+
},
30+
globals: {
31+
...globals.es2021,
32+
...globals.node
33+
}
34+
},
35+
rules: {
36+
...jqueryConfig.rules,
37+
strict: [ "error", "global" ],
38+
39+
// Too many violations
40+
"camelcase": "off",
41+
"max-len": "off",
42+
"no-unused-vars": "off"
43+
}
44+
},
45+
46+
{
47+
files: [ "*.mjs" ],
48+
languageOptions: {
49+
sourceType: "module"
50+
}
51+
},
52+
53+
{
54+
files: [ "test/*.js" ],
55+
languageOptions: {
56+
globals: {
57+
...globals.es2021,
58+
...globals.node,
59+
...globals.mocha
60+
}
61+
}
62+
},
63+
64+
{
65+
files: [ "app/src/**/*.js" ],
66+
languageOptions: {
67+
sourceType: "script",
68+
parserOptions: {
69+
globalReturn: false
70+
},
71+
globals: {
72+
...globals.es2021,
73+
...globals.browser,
74+
jQuery: false
75+
}
76+
},
77+
rules: {
78+
"strict": [ "error", "function" ]
79+
}
80+
}
81+
];

0 commit comments

Comments
 (0)