-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
53 lines (53 loc) · 1.65 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
// https://github.com/facebook/create-react-app/issues/7160#issuecomment-502631002
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: ['react-hooks'],
rules: {
curly: 'error',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/display-name': 'warn',
'no-console': 'error',
'@typescript-eslint/no-this-alias': [
'error',
{
'allowDestructuring': true, // Allow `const { props, state } = this`; false by default
'allowedNames': ['self'] // Allow `const self = this`; `[]` by default
}
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
overrides: [
{
files: ['*.spec.ts', '*.spec.tsx'],
rules: {
// Allow testing runtime errors to suppress TS errors
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
settings: {
react: {
pragma: 'React',
version: 'detect',
},
},
};