-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy path.eslintrc
More file actions
138 lines (134 loc) · 4.19 KB
/
Copy path.eslintrc
File metadata and controls
138 lines (134 loc) · 4.19 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{
// Let eslint know were working as a browser to allow the standard globals (document, window, etc.)
"env": {
"browser": true,
"node": true,
"jest": true
},
// Use AirBnb settings as a base
"extends": [
"plugin:@typescript-eslint/recommended",
"@edsc"
],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"rules": {
// https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md
// If you're using a module bundler other than Node or Webpack, you may end up with a lot of false positive reports of missing dependencies.
// We are using Vite, and it is giving incorrect results for .ts files
"import/no-unresolved": "off",
// Enforce extension usage for certain types
"import/extensions": ["error", {
"svg": "always",
"json": "always",
"jpg": "always"
}],
// Allowing cyclic dependencies
"import/no-cycle": "off",
// https://stackoverflow.com/questions/57802057/eslint-configuring-no-unused-vars-for-typescript/61555310#61555310
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {}],
"@typescript-eslint/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
]
},
"overrides": [
{
"files": [
"*.test.js"
],
"rules": {
"import/first": 0
}
},
{
"files": [
"serverless/src/**/*"
],
"rules": {
"import/prefer-default-export": 0
}
},
// Don't run testing-library rules in non-testing library test files
{
"files": [
"tests/**/*", // Playwright tests
"serverless/**/*" // Serverless tests
],
"rules": {
"testing-library/await-async-events": "off",
"testing-library/await-async-queries": "off",
"testing-library/await-async-utils": "off",
"testing-library/consistent-data-testid": "off",
"testing-library/no-await-sync-events": "off",
"testing-library/no-await-sync-queries": "off",
"testing-library/no-container": "off",
"testing-library/no-debugging-utils": "off",
"testing-library/no-dom-import": "off",
"testing-library/no-global-regexp-flag-in-query": "off",
"testing-library/no-manual-cleanup": "off",
"testing-library/no-node-access": "off",
"testing-library/no-promise-in-fire-event": "off",
"testing-library/no-render-in-lifecycle": "off",
"testing-library/no-unnecessary-act": "off",
"testing-library/no-wait-for-multiple-assertions": "off",
"testing-library/no-wait-for-side-effects": "off",
"testing-library/no-wait-for-snapshot": "off",
"testing-library/prefer-explicit-assert": "off",
"testing-library/prefer-find-by": "off",
"testing-library/prefer-implicit-assert": "off",
"testing-library/prefer-presence-queries": "off",
"testing-library/prefer-query-by-disappearance": "off",
"testing-library/prefer-query-matchers": "off",
"testing-library/prefer-screen-queries": "off",
"testing-library/prefer-user-event": "off",
"testing-library/render-result-naming-convention": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"react/require-default-props": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {
"react/require-default-props": [2, {
"functions": "defaultArguments"
}]
}
},
{
// Allow param reassignment in the zustand files (this is handled correctly by immer)
"files": [
"static/src/js/zustand/**/*.ts"
],
"rules": {
"no-param-reassign": [
"error",
{
"props": true, // This is provided in the airbnb config
"ignorePropertyModificationsFor": [
"state" // Allow the state param to be reassigned
]
}
]
}
}
],
// Define version settings
"settings": {
"react": {
"pragma": "React",
"version": "16.12.0"
}
},
// Define any global variables to avoid no-undef errors
"globals": {
"vi": "readonly"
}
}