-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
82 lines (79 loc) · 2.32 KB
/
.eslintrc.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
module.exports = {
env: {
browser: true,
es2021: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 12,
sourceType: "module",
project: "./tsconfig.json",
},
plugins: [
"@typescript-eslint",
"@emotion",
],
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
// see for rational https://basarat.gitbook.io/typescript/main-1/defaultisbad
"import/no-default-export": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-this-alias": "warn",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/consistent-type-imports": "error",
// doesn’t detect inputs nested in a component so disabling it is easier
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/no-noninteractive-tabindex": "off",
"import/extensions": [
"error",
{
js: "never",
json: "always",
jsx: "never",
ts: "never",
tsx: "never",
},
],
"react/react-in-jsx-scope": "off",
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
},
settings: {
react: {
// to indicate latest version
// https://github.com/yannickcr/eslint-plugin-react/blob/b8e91a571bc6b58cc3c78e9e62e8b60ecb45e233/lib/util/version.js#L48
version: "999.999.999",
},
"import/core-modules": ["moire"],
"import/order": {
alphabetize: { order: "asc", caseInsensitive: true },
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
},
},
ignorePatterns: ["dist", "node_modules"],
}