forked from hypothesis/via
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
57 lines (52 loc) · 1.79 KB
/
.eslintrc
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
{
"extends": [
"hypothesis",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"prefer-arrow-callback": "error",
"prefer-const": ["error", { "destructuring": "all" }],
// Props are checked by TS.
"react/prop-types": "off",
// Upgrade TS rules from warning to error.
"@typescript-eslint/no-unused-vars": "error",
// Disable TS rules that we dislike.
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-this-alias": "off",
// Enforce consistency in cases where TypeScript supports old and new
// syntaxes for the same thing.
//
// - Require `<var> as <type>` for casts
// - Require `import type` for type imports. The corresponding rule for
// exports is not enabled yet because that requires setting up type-aware
// linting.
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-imports": "error",
},
"overrides": [
// Additional rules that require type information. These can only be run
// on files included in the TS project by tsconfig.json.
{
"files": "via/static/scripts/*.{js,ts,tsx}",
"excludedFiles": ["karma.config.js", "setup-tests.js", "**/test/*.js"],
"rules": {
"@typescript-eslint/no-unnecessary-condition": "error"
},
"parserOptions": {
"project": "via/static/scripts/tsconfig.json"
}
},
// Code that runs in Node
{
"files": "*.js",
"excludedFiles": ["via/**"],
"env": { "node": true },
}
]
}