-
Notifications
You must be signed in to change notification settings - Fork 359
/
.eslintrc
164 lines (159 loc) · 5.74 KB
/
.eslintrc
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
157
158
159
160
161
162
163
164
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true // Allows support of JSX, but use of React plugin is required to support React semantics
}
},
"parser": "@typescript-eslint/parser",
"plugins": [
"node",
"promise",
"react",
"@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"amd": true,
"browser": true,
"jquery": true,
"node": true,
"es6": true, // This enables ES6 global variables AND ES6 syntax
"worker": true
},
"rules": {
// The below are some, but not all, of the rules from eslint:recommended https://github.com/eslint/eslint/blob/master/conf/eslint-recommended.js (all errors set to warning)
"constructor-super": 1,
"for-direction": 1,
"getter-return": 1,
"no-async-promise-executor": 1,
"no-case-declarations": 1,
"no-class-assign": 1,
"no-compare-neg-zero": 1,
"no-cond-assign": 1,
"no-const-assign": 1,
"no-constant-condition": 1,
"no-control-regex": 1,
"no-debugger": 1,
"no-delete-var": 1,
"no-dupe-args": 1,
"no-dupe-class-members": 1,
"no-dupe-keys": 1,
"no-duplicate-case": 1,
"no-empty": 1,
"no-empty-character-class": 1,
"no-empty-pattern": 1,
"no-ex-assign": 1,
"no-extra-boolean-cast": 1,
"no-fallthrough": 1,
"no-func-assign": 1,
"no-global-assign": 1,
"no-inner-declarations": 1,
"no-invalid-regexp": 1,
"no-misleading-character-class": 1,
"no-mixed-spaces-and-tabs": 1,
"no-new-symbol": 1,
"no-obj-calls": 1,
"no-octal": 1,
"no-prototype-builtins": 1,
"no-redeclare": 1,
"no-regex-spaces": 1,
"no-self-assign": 1,
"no-shadow-restricted-names": 1,
"no-sparse-arrays": 1,
"no-this-before-super": 1,
"no-unexpected-multiline": 1,
"no-unreachable": 1,
"no-unsafe-finally": 1,
"no-unsafe-negation": 1,
"no-unused-labels": 1,
"no-useless-catch": 1,
"no-useless-escape": 1,
"no-with": 1,
"require-atomic-updates": 1,
"require-yield": 1,
"use-isnan": 1,
"valid-typeof": 1,
// Other rules
"default-param-last": 1,
"eqeqeq": 1,
// The below are some, but not all, of the rules from eslint-plugin-react:recommended https://github.com/yannickcr/eslint-plugin-react#recommended (all errors set to warn)
"react/display-name": 1,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-undef": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-children-prop": 1,
"react/no-danger-with-children": 1,
"react/no-deprecated": 1,
"react/no-direct-mutation-state": 1,
"react/no-find-dom-node": 1,
"react/no-is-mounted": 1,
"react/no-render-return-value": 1,
"react/no-string-refs": 1,
"react/no-unescaped-entities": 1,
"react/no-unknown-property": 1,
"react/require-render-return": 1,
// Some additional React rules
"react/no-danger": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1
},
"overrides": [
{
"files": [ "*.ts", "*.tsx" ],
"rules": {
// The below are all rules from @typescript-eslint/eslint:recommended https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/eslint-recommended.ts (all errors set to warn)
"getter-return": 0, //Checked by Typescript - ts(2378)
"no-dupe-args": 0, // Checked by Typescript - ts(2300)
"no-dupe-keys": 0, // Checked by Typescript - ts(1117)
"no-unreachable": 0, // Checked by Typescript - ts(7027)
"valid-typeof": 0, // Checked by Typescript - ts(2367)
"no-const-assign": 0, // Checked by Typescript - ts(2588)
"no-new-symbol": 0, // Checked by Typescript - ts(2588)
"no-this-before-super": 0, // Checked by Typescript - ts(2376)
"no-undef": 0, // This is checked by Typescript using the option `strictNullChecks`.
"no-dupe-class-members": 0, // This is already checked by Typescript.
"no-redeclare": 0, // This is already checked by Typescript.
// The below is some, but not all, of the rules from @typescript-eslint/recommended https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json (all errors set to warn)
"@typescript-eslint/adjacent-overload-signatures": 1,
"@typescript-eslint/ban-ts-ignore": 1,
"@typescript-eslint/ban-types": 1,
"camelcase": 0,
"@typescript-eslint/camelcase": 1,
"@typescript-eslint/class-name-casing": 1,
"@typescript-eslint/consistent-type-assertions": 1,
"@typescript-eslint/interface-name-prefix": 1,
"@typescript-eslint/member-delimiter-style": 1,
"no-array-constructor": 0,
"@typescript-eslint/no-array-constructor": 1,
"no-empty-function": 0,
"@typescript-eslint/no-empty-function": 1,
"@typescript-eslint/no-empty-interface": 1,
"@typescript-eslint/no-explicit-any": 1,
"@typescript-eslint/no-inferrable-types": 1,
"@typescript-eslint/no-misused-new": 1,
"@typescript-eslint/no-namespace": 1,
"@typescript-eslint/no-non-null-assertion": 1,
"@typescript-eslint/no-this-alias": 1,
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": 1,
"no-use-before-define": 0,
"@typescript-eslint/no-use-before-define": 1,
"@typescript-eslint/no-var-requires": 1,
"@typescript-eslint/prefer-namespace-keyword": 1,
"@typescript-eslint/triple-slash-reference": 1,
"@typescript-eslint/type-annotation-spacing": 1,
"no-var": 1,
"prefer-const": 1,
"prefer-rest-params": 1,
"prefer-spread": 1
}
}
]
}