-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
97 lines (95 loc) · 2.15 KB
/
eslint.config.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// @ts-check
import eslint from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
const config = [
eslint.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.node
}
},
rules: {
"no-unused-vars": "off",
"no-console": [
"error",
{
allow: ["warn", "error", "info", "assert"]
}
],
"no-warning-comments": ["error", { terms: ["xxx", "no-commit"] }],
"quote-props": ["warn", "as-needed"],
"require-await": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true
}
],
"@typescript-eslint/no-explicit-any": "off"
}
},
{
files: ["tests/cypress/**"],
// https://github.com/cypress-io/eslint-plugin-cypress/issues/155
// See plugin:cypress/recommended
languageOptions: {
globals: {
...globals.browser,
cy: true,
context: true,
Cypress: true,
it: true,
before: true,
beforeEach: true
}
}
},
{
files: ["legacy/**"],
languageOptions: {
globals: {
...globals.browser
}
},
rules: {
"@typescript-eslint/no-unused-vars": "off"
}
},
{
files: ["src/**"],
languageOptions: {
globals: {
...globals.browser
}
},
rules: {
"@typescript-eslint/no-unused-vars": "off"
}
},
// https://github.com/eslint/eslint/issues/17400#issuecomment-1646873272
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
{
ignores: [
"**/built/**",
"**/data/**/*",
"**/documentation/**",
"**/tmp/**",
"vendor/**",
"**/unused/**",
"tests/cypress.config.cjs",
"www/api"
]
}
];
export default config;