This repository has been archived by the owner on Sep 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc
149 lines (138 loc) · 4.58 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
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"prettier/react",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"import",
"react",
"dependencies",
"lodash-fp",
"prettier",
"@typescript-eslint"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
// Possible Errors
"no-console": "error",
"no-unexpected-multiline": "error",
// Best Practices
"class-methods-use-this": "off",
"consistent-return": ["error", { "treatUndefinedAsUnspecified": true }],
"dot-location": ["error", "property"],
"no-implicit-globals": "error",
"no-invalid-this": "error",
"no-param-reassign": ["error", { "props": false }],
"no-unmodified-loop-condition": "error",
"no-useless-call": "error",
"no-void": "off",
"no-else-return": "off", // for type refinements
"no-catch-shadow": "error",
"no-label-var": "error",
"no-shadow": [
"error",
{ "allow": ["cb", "next", "req", "res", "err", "error"] }
],
"no-undef-init": "error",
"no-undefined": "error",
"no-use-before-define": ["error", "nofunc"],
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
// Node.js
"callback-return": "error",
"no-path-concat": "error",
// Stylistic Issues
"linebreak-style": ["error", "unix"],
"no-plusplus": "off",
// ES2015
"constructor-super": "error",
"generator-star-spacing": ["error", "after"],
"no-this-before-super": "error",
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }],
"prefer-spread": "error",
"prefer-template": "off",
// React
"react/no-danger": "error",
"react/no-deprecated": "error",
"react/no-did-mount-set-state": "error",
"react/no-did-update-set-state": "error",
"react/no-direct-mutation-state": "error",
"react/no-is-mounted": "error",
"react/no-set-state": "error",
"react/no-string-refs": "error",
"react/prefer-stateless-function": "error",
"react/prop-types": "off",
"react/self-closing-comp": "off",
"react/destructuring-assignment": "off",
// a11y
"jsx-a11y/no-static-element-interactions": "off",
// "jsx-a11y/anchor-is-valid": [ "error", {
// "components": [ "Link" ],
// "specialLink": [ "to" ]
// }],
"jsx-a11y/label-has-for": "off",
// "jsx-a11y/label-has-associated-control": [ 2, {
// "controlComponents": ["Field"],
// "depth": 2
// }],
// dependencies
"dependencies/case-sensitive": "error",
"dependencies/no-cycles": "error",
"dependencies/no-unresolved": "off",
// lodash-fp
"lodash-fp/consistent-compose": ["error", "flow"],
"lodash-fp/consistent-name": ["error", "lodash"],
"lodash-fp/no-argumentless-calls": "error",
"lodash-fp/no-chain": "error",
"lodash-fp/no-extraneous-args": "error",
"lodash-fp/no-extraneous-function-wrapping": "error",
"lodash-fp/no-extraneous-iteratee-args": "error",
"lodash-fp/no-for-each": "off",
"lodash-fp/no-partial-of-curried": "error",
"lodash-fp/no-single-composition": "error",
"lodash-fp/no-submodule-destructuring": "error",
"lodash-fp/no-unused-result": "error",
"lodash-fp/prefer-compact": "error",
"lodash-fp/prefer-composition-grouping": "error",
"lodash-fp/prefer-constant": ["error", { "arrowFunctions": false }],
"lodash-fp/prefer-flat-map": "error",
"lodash-fp/prefer-get": "error",
"lodash-fp/prefer-identity": ["error", { "arrowFunctions": false }],
"lodash-fp/preferred-alias": "off",
// "lodash-fp/use-fp": "error",
// WIP: Disable @typescript-eslint rules
"@typescript-eslint/ban-types": ["off"],
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/prefer-interface": ["off"],
"@typescript-eslint/indent": ["off"],
"@typescript-eslint/no-object-literal": ["off"],
"@typescript-eslint/no-object-literal-type-assertion": ["off"],
"@typescript-eslint/camelcase": ["off"],
"@typescript-eslint/explicit-function-return-type": ["off"],
"@typescript-eslint/no-use-before-define": ["off"],
"@typescript-eslint/explicit-member-accessibility": ["off"],
"@typescript-eslint/array-type": ["off"],
// Use no-unused-locals on tsc
"@typescript-eslint/no-unused-vars": ["off"],
}
}