-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
97 lines (94 loc) · 2.56 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
module.exports = {
env: {
"jest/globals": true,
browser: true,
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"airbnb",
"prettier",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
__NONCE__: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: "module",
},
plugins: ["react", "@typescript-eslint", "import", "react-hooks", "jest"],
rules: {
"react/destructuring-assignment": "off", // to allow `props.whateverProp`
"arrow-body-style": ["error", "as-needed"],
"no-console": "error",
"import/no-extraneous-dependencies": "off",
"react/display-name": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"react/jsx-props-no-spreading": "off",
"no-underscore-dangle": "off",
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"no-restricted-syntax": "off",
"import/extensions": [
"error",
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never",
json: "allow",
},
],
"react/jsx-filename-extension": [1, { extensions: [".tsx"] }],
"react/jsx-one-expression-per-line": "off",
/**
* The following rules conflict with TypeScript
*/
"no-unused-expressions": "off", // Conflicts with TypeScript optional chaining
"react/jsx-no-undef": "off",
"import/no-unresolved": "off",
"react/prop-types": "off",
"@typescript-eslint/no-unused-vars": 2,
"no-unused-vars": "off",
"no-prototype-builtins": "off",
"no-useless-constructor": "off",
"no-empty-function": "off",
/**
* The following rules conflict with Prettier
*/
"react/jsx-curly-newline": "off",
"react/jsx-wrap-multilines": "off",
"react/jsx-indent": "off",
/**
* I found it very difficult to style a button as an anchor link. It's much
* easier to use an `a` element with an `onClick` handler. Does using
* `role="button"` on the element solve the accessibility problem?
*
* I'd like to hear from someone who knows about this stuff.
*/
"jsx-a11y/anchor-is-valid": "off",
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
};