-
Notifications
You must be signed in to change notification settings - Fork 35
/
eslint.config.mjs
54 lines (53 loc) · 1.12 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import globals from "globals";
import jestConfig from 'eslint-plugin-jest';
import js from "@eslint/js";
export default [
{
files: [
"app/assets/**/*.{js,mjs}",
"tests/**/*.{js,mjs}"
],
rules: {
...js.configs.recommended.rules,
"semi": ["error", "always"],
"no-prototype-builtins": "warn",
"no-unused-vars": "warn",
"no-extra-boolean-cast": "warn",
"no-undef": "warn",
"no-useless-escape": "warn",
"no-unexpected-multiline": "warn",
//needs more standardjs rules
},
ignores: [
'tests/**/*.{js,mjs}'
],
},
{
files: ["app/assets/**/*.js"],
languageOptions: {
sourceType: "commonjs",
globals: {
...globals.browser,
'$': 'writable',
"GOVUK": "readonly"
}
},
},
{
files: ["**/*.mjs"],
languageOptions: {
sourceType: "module",
globals: {
...globals.browser
}
}
},
{
files: ['**/*.test.{js,mjs}'],
...jestConfig.configs['flat/recommended'],
rules: {
"jest/no-disabled-tests": "error",
"jest/no-focused-tests": "warn",
}
},
];