@paratco/eslint-config 0.7.5 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,249 +1,259 @@
1
- export default {
2
- // Enforce that class methods utilize this.
3
- // https://typescript-eslint.io/rules/class-methods-use-this
4
- // Note: you must disable the base rule as it can report incorrect errors
5
- "class-methods-use-this": "off",
6
- "@typescript-eslint/class-methods-use-this": [
7
- "error",
8
- {
9
- ignoreOverrideMethods: true,
10
- ignoreClassesThatImplementAnInterface: true
11
- }
12
- ],
13
-
14
- // Require return statements to either always or never specify values
15
- // https://typescript-eslint.io/rules/consistent-return/
16
- // Note: you must disable the base rule as it can report incorrect errors
17
- "consistent-return": "off",
18
- "@typescript-eslint/consistent-return": "off",
19
-
20
- // Enforce consistent usage of type exports.
21
- // https://typescript-eslint.io/rules/consistent-type-exports
22
- "@typescript-eslint/consistent-type-exports": [
23
- "error",
24
- {
25
- fixMixedExportsWithInlineTypeSpecifier: true
26
- }
27
- ],
28
-
29
- // Enforce consistent usage of type imports.
30
- // https://typescript-eslint.io/rules/consistent-type-imports
31
- "@typescript-eslint/consistent-type-imports": ["error"],
32
-
33
- // Enforce default parameters to be last.
34
- // https://typescript-eslint.io/rules/default-param-last
35
- // Note: you must disable the base rule as it can report incorrect errors
36
- "default-param-last": "off",
37
- "@typescript-eslint/default-param-last": ["error"],
38
-
39
- // Require explicit return types on functions and class methods.
40
- // https://typescript-eslint.io/rules/explicit-function-return-type
41
- "@typescript-eslint/explicit-function-return-type": [
42
- "error",
43
- {
44
- allowExpressions: true
45
- }
46
- ],
47
-
48
- // Require explicit accessibility modifiers on class properties and methods.
49
- // https://typescript-eslint.io/rules/explicit-member-accessibility
50
- "@typescript-eslint/explicit-member-accessibility": [
51
- "error",
52
- {
53
- accessibility: "no-public",
54
- overrides: {
55
- constructors: "off"
56
- }
57
- }
58
- ],
59
-
60
- // Require explicit return and argument types on exported functions' and classes' public class methods.
61
- // https://typescript-eslint.io/rules/explicit-module-boundary-types
62
- "@typescript-eslint/explicit-module-boundary-types": ["error"],
63
-
64
- // Require or disallow initialization in variable declarations.
65
- // https://typescript-eslint.io/rules/init-declarations
66
- // Note: you must disable the base rule as it can report incorrect errors
67
- "init-declarations": "off",
68
- "@typescript-eslint/init-declarations": ["off"],
69
-
70
- // Enforce a maximum number of parameters in function definitions.
71
- // https://typescript-eslint.io/rules/max-params
72
- // Note: you must disable the base rule as it can report incorrect errors
73
- "max-params": "off",
74
- "@typescript-eslint/max-params": ["off"],
75
-
76
- // Require a consistent member declaration order.
77
- // https://typescript-eslint.io/rules/member-ordering
78
- "@typescript-eslint/member-ordering": [
79
- "error",
80
- { default: ["constructor", "field", "static-method", "method", "signature"] }
81
- ],
82
-
83
- // Enforce using a particular method signature syntax.
84
- // https://typescript-eslint.io/rules/method-signature-style
85
- "@typescript-eslint/method-signature-style": ["error"],
86
-
87
- // Enforce naming conventions for everything across a codebase.
88
- // https://typescript-eslint.io/rules/naming-convention
89
- // TODO: We can split this rule. for components it enforces PascalCase and functions camelCase
90
- "@typescript-eslint/naming-convention": [
91
- "error",
92
- {
93
- selector: "function",
94
- format: ["PascalCase", "camelCase"]
95
- }
96
- ],
97
-
98
- // Disallow duplicate class members.
99
- // https://typescript-eslint.io/rules/no-dupe-class-members
100
- // Note: you must disable the base rule as it can report incorrect errors
101
- "no-dupe-class-members": "error",
102
- "@typescript-eslint/no-dupe-class-members": ["error"],
103
-
104
- // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
105
- // https://typescript-eslint.io/rules/no-import-type-side-effects
106
- "@typescript-eslint/no-import-type-side-effects": ["error"],
107
-
108
- // Disallow this keywords outside of classes or class-like objects.
109
- // https://typescript-eslint.io/rules/no-invalid-this
110
- // Note: you must disable the base rule as it can report incorrect errors
111
- "no-invalid-this": "off",
112
- "@typescript-eslint/no-invalid-this": ["error"],
113
-
114
- // Disallow function declarations that contain unsafe references inside loop statements.
115
- // https://typescript-eslint.io/rules/no-loop-func
116
- // Note: you must disable the base rule as it can report incorrect errors
117
- "no-loop-func": "off",
118
- "@typescript-eslint/no-loop-func": ["error"],
119
-
120
- // Disallow magic numbers.
121
- // https://typescript-eslint.io/rules/no-magic-numbers
122
- // Note: you must disable the base rule as it can report incorrect errors
123
- "no-magic-numbers": "off",
124
- "@typescript-eslint/no-magic-numbers": ["off"],
125
-
126
- // Disallow variable redeclaration.
127
- // https://typescript-eslint.io/rules/no-redeclare
128
- // Note: you must disable the base rule as it can report incorrect errors
129
- "no-redeclare": "off",
130
- "@typescript-eslint/no-redeclare": ["off"],
131
-
132
- // Disallow invocation of require().
133
- // https://typescript-eslint.io/rules/no-require-imports
134
- "@typescript-eslint/no-require-imports": ["error"],
135
-
136
- // Disallow specified modules when loaded by import.
137
- // https://typescript-eslint.io/rules/no-restricted-imports
138
- // Note: you must disable the base rule as it can report incorrect errors
139
- "no-restricted-imports": "off",
140
- "@typescript-eslint/no-restricted-imports": ["off"],
141
-
142
- // Disallow variable declarations from shadowing variables declared in the outer scope.
143
- // https://typescript-eslint.io/rules/no-shadow
144
- // Note: you must disable the base rule as it can report incorrect errors
145
- "no-shadow": "off",
146
- "@typescript-eslint/no-shadow": ["error"],
147
-
148
- // Disallow unnecessary namespace qualifiers.
149
- // https://typescript-eslint.io/rules/no-unnecessary-qualifier
150
- "@typescript-eslint/no-unnecessary-qualifier": ["warn"],
151
-
152
- // Require unary negation to take a number.
153
- // https://typescript-eslint.io/rules/no-unsafe-unary-minus
154
- "@typescript-eslint/no-unsafe-unary-minus": ["error"],
155
-
156
- // Disallow unused expressions.
157
- // https://typescript-eslint.io/rules/no-unused-expressions
158
- // Note: you must disable the base rule as it can report incorrect errors
159
- "no-unused-expressions": "off",
160
- "@typescript-eslint/no-unused-expressions": ["off"],
161
-
162
- // Disallow the use of variables before they are defined.
163
- // https://typescript-eslint.io/rules/no-use-before-define
164
- // Note: you must disable the base rule as it can report incorrect errors
165
- "no-use-before-define": "off",
166
- "@typescript-eslint/no-use-before-define": ["error"],
167
-
168
- // Disallow empty exports that don't change anything in a module file.
169
- // https://typescript-eslint.io/rules/no-useless-empty-export
170
- "@typescript-eslint/no-useless-empty-export": ["warn"],
171
-
172
- // Require or disallow parameter properties in class constructors.
173
- // https://typescript-eslint.io/rules/parameter-properties
174
- "@typescript-eslint/parameter-properties": ["error"],
175
-
176
- // Require destructuring from arrays and/or objects.
177
- // https://typescript-eslint.io/rules/prefer-destructuring
178
- // Note: you must disable the base rule as it can report incorrect errors
179
- "prefer-destructuring": "off",
180
- "@typescript-eslint/prefer-destructuring": ["off"],
181
-
182
- // Require each enum member value to be explicitly initialized.
183
- // https://typescript-eslint.io/rules/prefer-enum-initializers
184
- "@typescript-eslint/prefer-enum-initializers": ["off"],
185
-
186
- // Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
187
- // https://typescript-eslint.io/rules/prefer-find
188
- "@typescript-eslint/prefer-find": ["warn"],
189
-
190
- // Require private members to be marked as readonly if they're never modified outside the constructor.
191
- // https://typescript-eslint.io/rules/prefer-readonly
192
- "@typescript-eslint/prefer-readonly": ["warn"],
193
-
194
- // Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
195
- // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
196
- "@typescript-eslint/prefer-readonly-parameter-types": ["off"],
197
-
198
- // Enforce RegExp#exec over String#match if no global flag is provided.
199
- // https://typescript-eslint.io/rules/prefer-regexp-exec
200
- "@typescript-eslint/prefer-regexp-exec": ["warn"],
201
-
202
- // Require any function or method that returns a Promise to be marked async.
203
- // https://typescript-eslint.io/rules/promise-function-async
204
- "@typescript-eslint/promise-function-async": ["error"],
205
-
206
- // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
207
- // https://typescript-eslint.io/rules/require-array-sort-compare
208
- "@typescript-eslint/require-array-sort-compare": ["error"],
209
-
210
- // Enforce consistent returning of awaited values.
211
- // https://typescript-eslint.io/rules/return-await
212
- // Note: you must disable the base rule as it can report incorrect errors
213
- "no-return-await": "off",
214
- "@typescript-eslint/return-await": ["off"],
215
-
216
- // Enforce constituents of a type union/intersection to be sorted alphabetically.
217
- // https://typescript-eslint.io/rules/sort-type-constituents
218
- "@typescript-eslint/sort-type-constituents": ["warn"],
219
-
220
- // Disallow certain types in boolean expressions.
221
- // https://typescript-eslint.io/rules/strict-boolean-expressions
222
- "@typescript-eslint/strict-boolean-expressions": [
223
- "error",
224
- {
225
- allowString: false,
226
- allowNumber: false,
227
- allowNullableObject: false
228
- }
229
- ],
230
-
231
- // Require switch-case statements to be exhaustive.
232
- // https://typescript-eslint.io/rules/switch-exhaustiveness-check
233
- "@typescript-eslint/switch-exhaustiveness-check": ["error"],
234
-
235
- // Require type annotations in certain places.
236
- // https://typescript-eslint.io/rules/typedef
237
- "@typescript-eslint/typedef": ["off"],
238
-
239
- // Enforce template literal expressions to be of string type.
240
- // https://typescript-eslint.io/rules/restrict-template-expressions
241
- "@typescript-eslint/restrict-template-expressions": [
242
- "error",
243
- {
244
- allowBoolean: true,
245
- allowNumber: true,
246
- allowRegExp: true
247
- }
248
- ]
249
- };
1
+ export default {
2
+ // Enforce that class methods utilize this.
3
+ // https://typescript-eslint.io/rules/class-methods-use-this
4
+ // Note: you must disable the base rule as it can report incorrect errors
5
+ "class-methods-use-this": "off",
6
+ "@typescript-eslint/class-methods-use-this": [
7
+ "error",
8
+ {
9
+ ignoreOverrideMethods: true,
10
+ ignoreClassesThatImplementAnInterface: true
11
+ }
12
+ ],
13
+
14
+ // Require return statements to either always or never specify values
15
+ // https://typescript-eslint.io/rules/consistent-return/
16
+ // Note: you must disable the base rule as it can report incorrect errors
17
+ "consistent-return": "off",
18
+ "@typescript-eslint/consistent-return": "off",
19
+
20
+ // Enforce consistent usage of type exports.
21
+ // https://typescript-eslint.io/rules/consistent-type-exports
22
+ "@typescript-eslint/consistent-type-exports": [
23
+ "error",
24
+ {
25
+ fixMixedExportsWithInlineTypeSpecifier: true
26
+ }
27
+ ],
28
+
29
+ // Enforce consistent usage of type imports.
30
+ // https://typescript-eslint.io/rules/consistent-type-imports
31
+ "@typescript-eslint/consistent-type-imports": ["error"],
32
+
33
+ // Enforce default parameters to be last.
34
+ // https://typescript-eslint.io/rules/default-param-last
35
+ // Note: you must disable the base rule as it can report incorrect errors
36
+ "default-param-last": "off",
37
+ "@typescript-eslint/default-param-last": ["error"],
38
+
39
+ // Require explicit return types on functions and class methods.
40
+ // https://typescript-eslint.io/rules/explicit-function-return-type
41
+ "@typescript-eslint/explicit-function-return-type": [
42
+ "error",
43
+ {
44
+ allowExpressions: true
45
+ }
46
+ ],
47
+
48
+ // Require explicit accessibility modifiers on class properties and methods.
49
+ // https://typescript-eslint.io/rules/explicit-member-accessibility
50
+ "@typescript-eslint/explicit-member-accessibility": [
51
+ "error",
52
+ {
53
+ accessibility: "no-public",
54
+ overrides: {
55
+ constructors: "off"
56
+ }
57
+ }
58
+ ],
59
+
60
+ // Require explicit return and argument types on exported functions' and classes' public class methods.
61
+ // https://typescript-eslint.io/rules/explicit-module-boundary-types
62
+ "@typescript-eslint/explicit-module-boundary-types": ["error"],
63
+
64
+ // Require or disallow initialization in variable declarations.
65
+ // https://typescript-eslint.io/rules/init-declarations
66
+ // Note: you must disable the base rule as it can report incorrect errors
67
+ "init-declarations": "off",
68
+ "@typescript-eslint/init-declarations": ["off"],
69
+
70
+ // Enforce a maximum number of parameters in function definitions.
71
+ // https://typescript-eslint.io/rules/max-params
72
+ // Note: you must disable the base rule as it can report incorrect errors
73
+ "max-params": "off",
74
+ "@typescript-eslint/max-params": ["off"],
75
+
76
+ // Require a consistent member declaration order.
77
+ // https://typescript-eslint.io/rules/member-ordering
78
+ "@typescript-eslint/member-ordering": [
79
+ "error",
80
+ { default: ["constructor", "field", "static-method", "method", "signature"] }
81
+ ],
82
+
83
+ // Enforce using a particular method signature syntax.
84
+ // https://typescript-eslint.io/rules/method-signature-style
85
+ "@typescript-eslint/method-signature-style": ["error"],
86
+
87
+ // Enforce naming conventions for everything across a codebase.
88
+ // https://typescript-eslint.io/rules/naming-convention
89
+ // TODO: We can split this rule. for components it enforces PascalCase and functions camelCase
90
+ "@typescript-eslint/naming-convention": [
91
+ "error",
92
+ {
93
+ selector: "function",
94
+ format: ["PascalCase", "camelCase"]
95
+ }
96
+ ],
97
+
98
+ // Disallow duplicate class members.
99
+ // https://typescript-eslint.io/rules/no-dupe-class-members
100
+ // Note: you must disable the base rule as it can report incorrect errors
101
+ "no-dupe-class-members": "error",
102
+ "@typescript-eslint/no-dupe-class-members": ["error"],
103
+
104
+ // Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.
105
+ // https://typescript-eslint.io/rules/no-import-type-side-effects
106
+ "@typescript-eslint/no-import-type-side-effects": ["error"],
107
+
108
+ // Disallow this keywords outside of classes or class-like objects.
109
+ // https://typescript-eslint.io/rules/no-invalid-this
110
+ // Note: you must disable the base rule as it can report incorrect errors
111
+ "no-invalid-this": "off",
112
+ "@typescript-eslint/no-invalid-this": ["error"],
113
+
114
+ // Disallow function declarations that contain unsafe references inside loop statements.
115
+ // https://typescript-eslint.io/rules/no-loop-func
116
+ // Note: you must disable the base rule as it can report incorrect errors
117
+ "no-loop-func": "off",
118
+ "@typescript-eslint/no-loop-func": ["error"],
119
+
120
+ // Disallow magic numbers.
121
+ // https://typescript-eslint.io/rules/no-magic-numbers
122
+ // Note: you must disable the base rule as it can report incorrect errors
123
+ "no-magic-numbers": "off",
124
+ "@typescript-eslint/no-magic-numbers": ["off"],
125
+
126
+ // Disallow variable redeclaration.
127
+ // https://typescript-eslint.io/rules/no-redeclare
128
+ // Note: you must disable the base rule as it can report incorrect errors
129
+ "no-redeclare": "off",
130
+ "@typescript-eslint/no-redeclare": ["off"],
131
+
132
+ // Disallow invocation of require().
133
+ // https://typescript-eslint.io/rules/no-require-imports
134
+ // Added to recommended
135
+ // "@typescript-eslint/no-require-imports": ["error"],
136
+
137
+ // Disallow specified modules when loaded by import.
138
+ // https://typescript-eslint.io/rules/no-restricted-imports
139
+ // Note: you must disable the base rule as it can report incorrect errors
140
+ "no-restricted-imports": "off",
141
+ "@typescript-eslint/no-restricted-imports": ["off"],
142
+
143
+ // Disallow certain types
144
+ // https://typescript-eslint.io/rules/no-restricted-types/
145
+ // "@typescript-eslint/no-restricted-types": ["off"],
146
+
147
+ // Disallow variable declarations from shadowing variables declared in the outer scope.
148
+ // https://typescript-eslint.io/rules/no-shadow
149
+ // Note: you must disable the base rule as it can report incorrect errors
150
+ "no-shadow": "off",
151
+ "@typescript-eslint/no-shadow": ["error"],
152
+
153
+ // https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment/
154
+ // Disallow unnecessary assignment of constructor property parameter
155
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": ["off"],
156
+
157
+ // Disallow unnecessary namespace qualifiers.
158
+ // https://typescript-eslint.io/rules/no-unnecessary-qualifier
159
+ "@typescript-eslint/no-unnecessary-qualifier": ["warn"],
160
+
161
+ // Require unary negation to take a number.
162
+ // https://typescript-eslint.io/rules/no-unsafe-unary-minus
163
+ // Added to recommended
164
+ // "@typescript-eslint/no-unsafe-unary-minus": ["error"],
165
+
166
+ // Disallow unused expressions.
167
+ // https://typescript-eslint.io/rules/no-unused-expressions
168
+ // Note: you must disable the base rule as it can report incorrect errors
169
+ // Added to recommended
170
+ // "no-unused-expressions": "off",
171
+ // "@typescript-eslint/no-unused-expressions": ["off"],
172
+
173
+ // Disallow the use of variables before they are defined.
174
+ // https://typescript-eslint.io/rules/no-use-before-define
175
+ // Note: you must disable the base rule as it can report incorrect errors
176
+ "no-use-before-define": "off",
177
+ "@typescript-eslint/no-use-before-define": ["error"],
178
+
179
+ // Disallow empty exports that don't change anything in a module file.
180
+ // https://typescript-eslint.io/rules/no-useless-empty-export
181
+ "@typescript-eslint/no-useless-empty-export": ["warn"],
182
+
183
+ // Require or disallow parameter properties in class constructors.
184
+ // https://typescript-eslint.io/rules/parameter-properties
185
+ "@typescript-eslint/parameter-properties": ["error"],
186
+
187
+ // Require destructuring from arrays and/or objects.
188
+ // https://typescript-eslint.io/rules/prefer-destructuring
189
+ // Note: you must disable the base rule as it can report incorrect errors
190
+ "prefer-destructuring": "off",
191
+ "@typescript-eslint/prefer-destructuring": ["off"],
192
+
193
+ // Require each enum member value to be explicitly initialized.
194
+ // https://typescript-eslint.io/rules/prefer-enum-initializers
195
+ "@typescript-eslint/prefer-enum-initializers": ["off"],
196
+
197
+ // Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
198
+ // https://typescript-eslint.io/rules/prefer-find
199
+ // Added to stylistic
200
+ // "@typescript-eslint/prefer-find": ["warn"],
201
+
202
+ // Require private members to be marked as readonly if they're never modified outside the constructor.
203
+ // https://typescript-eslint.io/rules/prefer-readonly
204
+ "@typescript-eslint/prefer-readonly": ["warn"],
205
+
206
+ // Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
207
+ // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
208
+ "@typescript-eslint/prefer-readonly-parameter-types": ["off"],
209
+
210
+ // Enforce RegExp#exec over String#match if no global flag is provided.
211
+ // https://typescript-eslint.io/rules/prefer-regexp-exec
212
+ // Added to stylistic
213
+ // "@typescript-eslint/prefer-regexp-exec": ["warn"],
214
+
215
+ // Require any function or method that returns a Promise to be marked async.
216
+ // https://typescript-eslint.io/rules/promise-function-async
217
+ "@typescript-eslint/promise-function-async": ["error"],
218
+
219
+ // Require Array#sort and Array#toSorted calls to always provide a compareFunction.
220
+ // https://typescript-eslint.io/rules/require-array-sort-compare
221
+ "@typescript-eslint/require-array-sort-compare": ["error"],
222
+
223
+ // Enforce consistent returning of awaited values.
224
+ // https://typescript-eslint.io/rules/return-await
225
+ // Note: you must disable the base rule as it can report incorrect errors
226
+ // Added to recommended
227
+ // "no-return-await": "off",
228
+ // "@typescript-eslint/return-await": ["off"],
229
+
230
+ // Disallow certain types in boolean expressions.
231
+ // https://typescript-eslint.io/rules/strict-boolean-expressions
232
+ "@typescript-eslint/strict-boolean-expressions": [
233
+ "error",
234
+ {
235
+ allowString: false,
236
+ allowNumber: false,
237
+ allowNullableObject: false
238
+ }
239
+ ],
240
+
241
+ // Require switch-case statements to be exhaustive.
242
+ // https://typescript-eslint.io/rules/switch-exhaustiveness-check
243
+ "@typescript-eslint/switch-exhaustiveness-check": ["error"],
244
+
245
+ // Require type annotations in certain places.
246
+ // https://typescript-eslint.io/rules/typedef
247
+ "@typescript-eslint/typedef": ["off"],
248
+
249
+ // Enforce template literal expressions to be of string type.
250
+ // https://typescript-eslint.io/rules/restrict-template-expressions
251
+ "@typescript-eslint/restrict-template-expressions": [
252
+ "error",
253
+ {
254
+ allowBoolean: true,
255
+ allowNumber: true,
256
+ allowRegExp: true
257
+ }
258
+ ]
259
+ };