@paratco/eslint-config 1.0.15 → 2.1.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.
- package/dist/configs/base.d.ts +124 -0
- package/dist/configs/base.d.ts.map +1 -0
- package/dist/configs/base.js +21 -0
- package/dist/configs/import.d.ts +83 -0
- package/dist/configs/import.d.ts.map +1 -0
- package/dist/configs/import.js +41 -0
- package/dist/configs/node.d.ts +203 -0
- package/dist/configs/node.d.ts.map +1 -0
- package/{src → dist}/configs/node.js +3 -5
- package/dist/configs/prettierFormatter.d.ts +4 -0
- package/dist/configs/prettierFormatter.d.ts.map +1 -0
- package/{src → dist}/configs/prettierFormatter.js +0 -1
- package/dist/configs/react.d.ts +2863 -0
- package/dist/configs/react.d.ts.map +1 -0
- package/dist/configs/react.js +51 -0
- package/dist/configs/stylisticFormatter.d.ts +218 -0
- package/dist/configs/stylisticFormatter.d.ts.map +1 -0
- package/dist/configs/stylisticFormatter.js +29 -0
- package/dist/index.d.ts +3484 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/rules/import.d.ts +59 -0
- package/dist/rules/import.d.ts.map +1 -0
- package/dist/rules/import.js +139 -0
- package/dist/rules/javascript.d.ts +23 -0
- package/dist/rules/javascript.d.ts.map +1 -0
- package/dist/rules/javascript.js +42 -0
- package/dist/rules/react.d.ts +112 -0
- package/dist/rules/react.d.ts.map +1 -0
- package/dist/rules/react.js +330 -0
- package/dist/rules/stylistic.d.ts +208 -0
- package/dist/rules/stylistic.d.ts.map +1 -0
- package/dist/rules/stylistic.js +439 -0
- package/dist/rules/typescript.d.ts +96 -0
- package/dist/rules/typescript.d.ts.map +1 -0
- package/dist/rules/typescript.js +254 -0
- package/package.json +25 -12
- package/.github/dependabot.yml +0 -14
- package/.github/workflows/publish.yml +0 -52
- package/.prettierrc.json +0 -22
- package/.yarnrc.yml +0 -1
- package/index.js +0 -15
- package/prettier/README.md +0 -22
- package/prettier/index.json +0 -22
- package/prettier/package.json +0 -20
- package/src/configs/base.js +0 -25
- package/src/configs/import.js +0 -43
- package/src/configs/react.js +0 -58
- package/src/configs/stylisticFormatter.js +0 -33
- package/src/lints/import/index.js +0 -175
- package/src/lints/javascript/index.js +0 -37
- package/src/lints/react/index.js +0 -425
- package/src/lints/stylistic/index.js +0 -529
- package/src/lints/typescript/index.js +0 -295
|
@@ -1,295 +0,0 @@
|
|
|
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": "off",
|
|
102
|
-
"@typescript-eslint/no-dupe-class-members": ["off"],
|
|
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": [
|
|
142
|
-
"error",
|
|
143
|
-
{
|
|
144
|
-
patterns: [
|
|
145
|
-
{
|
|
146
|
-
regex: "^(node:)?process$",
|
|
147
|
-
message: "Please dont import node:process."
|
|
148
|
-
}
|
|
149
|
-
]
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
|
|
153
|
-
// Disallow certain types
|
|
154
|
-
// https://typescript-eslint.io/rules/no-restricted-types/
|
|
155
|
-
// "@typescript-eslint/no-restricted-types": ["off"],
|
|
156
|
-
|
|
157
|
-
// Disallow variable declarations from shadowing variables declared in the outer scope.
|
|
158
|
-
// https://typescript-eslint.io/rules/no-shadow
|
|
159
|
-
// Note: you must disable the base rule as it can report incorrect errors
|
|
160
|
-
"no-shadow": "off",
|
|
161
|
-
"@typescript-eslint/no-shadow": ["error"],
|
|
162
|
-
|
|
163
|
-
// https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment/
|
|
164
|
-
// Disallow unnecessary assignment of constructor property parameter
|
|
165
|
-
"@typescript-eslint/no-unnecessary-parameter-property-assignment": ["off"],
|
|
166
|
-
|
|
167
|
-
// Disallow unnecessary namespace qualifiers.
|
|
168
|
-
// https://typescript-eslint.io/rules/no-unnecessary-qualifier
|
|
169
|
-
"@typescript-eslint/no-unnecessary-qualifier": ["warn"],
|
|
170
|
-
|
|
171
|
-
// Require unary negation to take a number.
|
|
172
|
-
// https://typescript-eslint.io/rules/no-unsafe-unary-minus
|
|
173
|
-
// Added to recommended
|
|
174
|
-
// "@typescript-eslint/no-unsafe-unary-minus": ["error"],
|
|
175
|
-
|
|
176
|
-
// Disallow unused expressions.
|
|
177
|
-
// https://typescript-eslint.io/rules/no-unused-expressions
|
|
178
|
-
// Note: you must disable the base rule as it can report incorrect errors
|
|
179
|
-
// Added to recommended
|
|
180
|
-
// "no-unused-expressions": "off",
|
|
181
|
-
// "@typescript-eslint/no-unused-expressions": ["off"],
|
|
182
|
-
|
|
183
|
-
// Disallow the use of variables before they are defined.
|
|
184
|
-
// https://typescript-eslint.io/rules/no-use-before-define
|
|
185
|
-
// Note: you must disable the base rule as it can report incorrect errors
|
|
186
|
-
"no-use-before-define": "off",
|
|
187
|
-
"@typescript-eslint/no-use-before-define": ["error"],
|
|
188
|
-
|
|
189
|
-
// Disallow empty exports that don't change anything in a module file.
|
|
190
|
-
// https://typescript-eslint.io/rules/no-useless-empty-export
|
|
191
|
-
"@typescript-eslint/no-useless-empty-export": ["warn"],
|
|
192
|
-
|
|
193
|
-
// Require or disallow parameter properties in class constructors.
|
|
194
|
-
// https://typescript-eslint.io/rules/parameter-properties
|
|
195
|
-
"@typescript-eslint/parameter-properties": ["error"],
|
|
196
|
-
|
|
197
|
-
// Require destructuring from arrays and/or objects.
|
|
198
|
-
// https://typescript-eslint.io/rules/prefer-destructuring
|
|
199
|
-
// Note: you must disable the base rule as it can report incorrect errors
|
|
200
|
-
"prefer-destructuring": "off",
|
|
201
|
-
"@typescript-eslint/prefer-destructuring": ["off"],
|
|
202
|
-
|
|
203
|
-
// Require each enum member value to be explicitly initialized.
|
|
204
|
-
// https://typescript-eslint.io/rules/prefer-enum-initializers
|
|
205
|
-
"@typescript-eslint/prefer-enum-initializers": ["off"],
|
|
206
|
-
|
|
207
|
-
// Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result.
|
|
208
|
-
// https://typescript-eslint.io/rules/prefer-find
|
|
209
|
-
// Added to stylistic
|
|
210
|
-
// "@typescript-eslint/prefer-find": ["warn"],
|
|
211
|
-
|
|
212
|
-
// Require private members to be marked as readonly if they're never modified outside the constructor.
|
|
213
|
-
// https://typescript-eslint.io/rules/prefer-readonly
|
|
214
|
-
"@typescript-eslint/prefer-readonly": ["warn"],
|
|
215
|
-
|
|
216
|
-
// Require function parameters to be typed as readonly to prevent accidental mutation of inputs.
|
|
217
|
-
// https://typescript-eslint.io/rules/prefer-readonly-parameter-types
|
|
218
|
-
"@typescript-eslint/prefer-readonly-parameter-types": ["off"],
|
|
219
|
-
|
|
220
|
-
// Enforce RegExp#exec over String#match if no global flag is provided.
|
|
221
|
-
// https://typescript-eslint.io/rules/prefer-regexp-exec
|
|
222
|
-
// Added to stylistic
|
|
223
|
-
// "@typescript-eslint/prefer-regexp-exec": ["warn"],
|
|
224
|
-
|
|
225
|
-
// Require any function or method that returns a Promise to be marked async.
|
|
226
|
-
// https://typescript-eslint.io/rules/promise-function-async
|
|
227
|
-
"@typescript-eslint/promise-function-async": ["error"],
|
|
228
|
-
|
|
229
|
-
// Require Array#sort and Array#toSorted calls to always provide a compareFunction.
|
|
230
|
-
// https://typescript-eslint.io/rules/require-array-sort-compare
|
|
231
|
-
"@typescript-eslint/require-array-sort-compare": ["error"],
|
|
232
|
-
|
|
233
|
-
// Enforce consistent returning of awaited values.
|
|
234
|
-
// https://typescript-eslint.io/rules/return-await
|
|
235
|
-
// Note: you must disable the base rule as it can report incorrect errors
|
|
236
|
-
// Added to recommended
|
|
237
|
-
// "no-return-await": "off",
|
|
238
|
-
// "@typescript-eslint/return-await": ["off"],
|
|
239
|
-
|
|
240
|
-
// Disallow certain types in boolean expressions.
|
|
241
|
-
// https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
242
|
-
"@typescript-eslint/strict-boolean-expressions": [
|
|
243
|
-
"error",
|
|
244
|
-
{
|
|
245
|
-
allowString: false,
|
|
246
|
-
allowNumber: false,
|
|
247
|
-
allowNullableObject: false
|
|
248
|
-
}
|
|
249
|
-
],
|
|
250
|
-
|
|
251
|
-
// Require switch-case statements to be exhaustive.
|
|
252
|
-
// https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
253
|
-
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
|
|
254
|
-
|
|
255
|
-
// Require type annotations in certain places.
|
|
256
|
-
// https://typescript-eslint.io/rules/typedef
|
|
257
|
-
"@typescript-eslint/typedef": ["off"],
|
|
258
|
-
|
|
259
|
-
// Enforce template literal expressions to be of string type.
|
|
260
|
-
// https://typescript-eslint.io/rules/restrict-template-expressions
|
|
261
|
-
"@typescript-eslint/restrict-template-expressions": [
|
|
262
|
-
"error",
|
|
263
|
-
{
|
|
264
|
-
allowBoolean: true,
|
|
265
|
-
allowNumber: true,
|
|
266
|
-
allowRegExp: true
|
|
267
|
-
}
|
|
268
|
-
],
|
|
269
|
-
|
|
270
|
-
// Disallow type parameters that aren't used multiple times
|
|
271
|
-
// https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
272
|
-
// Note: This rule is in the strict rules. But we decided to disable this rule.
|
|
273
|
-
"@typescript-eslint/no-unnecessary-type-parameters": ["off"],
|
|
274
|
-
|
|
275
|
-
// Disallow unused variables.
|
|
276
|
-
// https://typescript-eslint.io/rules/no-unused-vars
|
|
277
|
-
// Note: This rule is in the recommended rules. But we modify it.
|
|
278
|
-
"no-unused-vars": ["off"],
|
|
279
|
-
"@typescript-eslint/no-unused-vars": [
|
|
280
|
-
"error",
|
|
281
|
-
{
|
|
282
|
-
args: "all",
|
|
283
|
-
argsIgnorePattern: "^_",
|
|
284
|
-
caughtErrors: "all",
|
|
285
|
-
caughtErrorsIgnorePattern: "^_",
|
|
286
|
-
destructuredArrayIgnorePattern: "^_",
|
|
287
|
-
ignoreRestSiblings: true
|
|
288
|
-
}
|
|
289
|
-
],
|
|
290
|
-
|
|
291
|
-
// Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects
|
|
292
|
-
// https://typescript-eslint.io/rules/prefer-optional-chain
|
|
293
|
-
// Note: This rule is in the recommended rules. But we remove it.
|
|
294
|
-
"@typescript-eslint/prefer-optional-chain": ["off"]
|
|
295
|
-
};
|