-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
156 lines (156 loc) · 4.72 KB
/
.eslintrc.json
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": ["airbnb", "prettier"],
"overrides": [
{
"files": ["**/**/*.ts", "**/**/*.tsx"],
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint"],
"rules": {
"no-var": "off",
"no-unsafe-optional-chaining": 0,
"react/jsx-no-useless-fragment": [2, {"allowExpressions": true}],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-shadow": ["error"]
}
},
{
"files": ["**/*.js"],
"rules": {
"no-use-before-define": [
"error",
{
"functions": false
}
]
}
},
{
// 3) Now we enable eslint-plugin-testing-library rules or preset only for matching testing files!
"files": ["**/__tests__/**/*.[jt]s?(x)", "**/test?(*.).[jt]s?(x)"],
"extends": ["plugin:testing-library/react", "plugin:jest/recommended", "plugin:jest/style"],
"rules": {
"testing-library/no-debugging-utils": "error",
"testing-library/no-container": 0,
"testing-library/no-node-access": ["error", {"allowContainerFirstChild": true}]
}
}
],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["."]
},
"typescript": {}
}
},
"env": {
"jest": true,
"browser": true
},
"plugins": ["react", "no-only-tests", "react-hooks", "testing-library", "jest", "no-storage"],
"rules": {
"linebreak-style": ["error", "windows"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"arrow-body-style": 0,
"camelcase": 0,
"no-mixed-operators": 0,
"class-methods-use-this": 0,
"no-bitwise": 0,
"default-param-last": 0,
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}
],
"no-use-before-define": "off",
"object-curly-spacing": [2, "never"],
"curly": ["error", "all"],
"no-shadow": 0,
"no-underscore-dangle": 0,
"no-await-in-loop": 0,
"prefer-regex-literals": 0,
"prefer-destructuring": 0,
"prefer-promise-reject-errors": 0,
"vars-on-top": 0,
"no-else-return": ["error", {"allowElseIf": true}],
"no-restricted-globals": 0,
"no-restricted-syntax": 0,
"no-promise-executor-return": 0,
"no-unsafe-optional-chaining": 0,
"import/no-named-as-default-member": 0,
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": ["**/*test*.js", "**/*test*.ts", "**/*test*.tsx"],
"optionalDependencies": false,
"peerDependencies": false
}
],
"import/no-named-as-default": 0,
"import/extensions": 0,
"import/prefer-default-export": 0,
"import/no-unresolved": [
"error",
{
"commonjs": true
}
],
"import/no-cycle": 0, // off by default, should be checked regularly
"import/named": 0,
"react/jsx-fragments": [1, "element"],
"react/jsx-no-target-blank": 0,
"react/jsx-filename-extension": 0,
"react/forbid-prop-types": 0,
"react/jsx-props-no-spreading": 0,
"react/require-default-props": 0,
"react/static-property-placement": 0,
"react/state-in-constructor": 0,
"react/jsx-indent-props": [2, 4],
"react/destructuring-assignment": 0,
"react/forbid-foreign-prop-types": 0,
"react/function-component-definition": 0,
"react/no-unstable-nested-components": 0,
"react/jsx-no-useless-fragment": [2, {"allowExpressions": true}],
"react/jsx-no-constructed-context-values": 0,
"jsx-a11y/control-has-associated-label": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/mouse-events-have-key-events": 0,
"jsx-a11y/no-autofocus": 0,
"no-only-tests/no-only-tests": 2,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"no-storage/no-browser-storage": 2,
"no-param-reassign": ["error", {"props": false}],
"react/no-array-index-key": "off"
}
}