-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
105 lines (105 loc) · 2.75 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
{
"extends": [
"eslint:recommended",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended"
],
"plugins": ["react", "@typescript-eslint"],
"env": {
"node": true,
"browser": true,
"jasmine": true,
"jest": true,
"es6": true
},
"rules": {
/* React rules */
"react/react-in-jsx-scope": "off",
"react/no-direct-mutation-state": "error",
"react/no-unused-prop-types": "warn",
"react/self-closing-comp": [
"warn",
{
"component": true,
"html": true
}
],
"react/prop-types": "off",
"react/button-has-type": "warn",
"react/no-array-index-key": "warn",
"react/no-render-return-value": 0,
/* JSX rules */
"react/jsx-key": "error",
/* Since we are using React 17+ we no longer need these */
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
/* eslint basic rules */
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "function",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "function"
},
{
"blankLine": "always",
"prev": "*",
"next": "return"
}
],
// Disable this in favour of @typescript-eslint/no-unused-expressions
// so that function calls with optional chaining do not throw warnings
// https://github.com/facebook/create-react-app/issues/8107#issuecomment-565365982
// "no-unused-expressions": "warn",
"no-unused-vars": "off",
"no-debugger": "warn",
"no-console": "warn"
},
"overrides": [
/* Typescript rules */
{
"files": ["**/*.ts?(x)"],
"rules": {
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"args": "all",
"argsIgnorePattern": "^__",
"varsIgnorePattern": "^__|React"
}
],
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/prefer-interface": 0,
"@typescript-eslint/no-inferrable-types": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-explicit-any": "warn"
}
}
],
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
}
}