@fullstacksjs/eslint-config 15.2.0 → 15.3.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/README.md +2 -2
- package/dist/index.mjs +163 -193
- package/package.json +19 -21
- package/src/modules/base.mjs +43 -1
- package/src/modules/cypress.mjs +3 -0
- package/src/modules/imports.mjs +2 -0
- package/src/modules/jest.mjs +22 -7
- package/src/modules/next.mjs +1 -0
- package/src/modules/node.mjs +1 -1
- package/src/modules/playwright.mjs +9 -0
- package/src/modules/react.mjs +48 -47
- package/src/modules/storybook.mjs +1 -1
- package/src/modules/typescript.mjs +15 -9
- package/src/modules/vitest.mjs +17 -0
|
@@ -39,8 +39,8 @@ function typescript(options = {}) {
|
|
|
39
39
|
},
|
|
40
40
|
],
|
|
41
41
|
'@typescript-eslint/ban-tslint-comment': 'off',
|
|
42
|
-
'@typescript-eslint/camelcase': 'off',
|
|
43
42
|
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
|
|
43
|
+
'@typescript-eslint/class-methods-use-this': 'off',
|
|
44
44
|
'@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
|
|
45
45
|
'@typescript-eslint/consistent-indexed-object-style': 'warn',
|
|
46
46
|
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
@@ -57,9 +57,8 @@ function typescript(options = {}) {
|
|
|
57
57
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
58
58
|
'@typescript-eslint/explicit-member-accessibility': 'off',
|
|
59
59
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
60
|
-
'@typescript-eslint/generic-type-naming': 'off',
|
|
61
60
|
'@typescript-eslint/init-declarations': 'off',
|
|
62
|
-
'@typescript-eslint/
|
|
61
|
+
'@typescript-eslint/max-params': ['error', { max: 3 }],
|
|
63
62
|
'@typescript-eslint/member-ordering': 'off',
|
|
64
63
|
'@typescript-eslint/method-signature-style': ['warn', 'property'],
|
|
65
64
|
'@typescript-eslint/naming-convention': [
|
|
@@ -90,7 +89,6 @@ function typescript(options = {}) {
|
|
|
90
89
|
'@typescript-eslint/no-inferrable-types': 'off',
|
|
91
90
|
'@typescript-eslint/no-invalid-this': ['error', { capIsConstructor: false }],
|
|
92
91
|
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
93
|
-
'@typescript-eslint/no-loop-func': 'error',
|
|
94
92
|
'@typescript-eslint/no-magic-numbers': ['off', { ignoreEnums: true }], // Not good enough yet
|
|
95
93
|
'@typescript-eslint/no-misused-new': 'error',
|
|
96
94
|
'@typescript-eslint/no-namespace': 'error',
|
|
@@ -102,17 +100,17 @@ function typescript(options = {}) {
|
|
|
102
100
|
}),
|
|
103
101
|
'@typescript-eslint/no-redeclare': ['off', { ignoreDeclarationMerge: true }], // useful in FP.
|
|
104
102
|
'@typescript-eslint/no-require-imports': 'error',
|
|
105
|
-
'@typescript-eslint/no-restricted-
|
|
103
|
+
'@typescript-eslint/no-restricted-types': 'off',
|
|
106
104
|
'@typescript-eslint/no-shadow': 'error',
|
|
107
105
|
'@typescript-eslint/no-this-alias': 'error',
|
|
108
106
|
'@typescript-eslint/no-unnecessary-type-constraint': 'warn',
|
|
107
|
+
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 'warn',
|
|
109
108
|
'@typescript-eslint/no-unsafe-argument': strict(options, 'warn'),
|
|
110
109
|
'@typescript-eslint/no-unsafe-assignment': strict(options, 'warn'),
|
|
111
110
|
'@typescript-eslint/no-unsafe-call': strict(options, 'warn'),
|
|
112
111
|
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
|
|
113
112
|
'@typescript-eslint/no-unsafe-member-access': strict(options, ['warn', { allowOptionalChaining: true }]),
|
|
114
113
|
'@typescript-eslint/no-unsafe-return': strict(options, 'warn'),
|
|
115
|
-
'@typescript-eslint/no-untyped-public-signature': 'off',
|
|
116
114
|
'@typescript-eslint/no-unused-expressions': 'error',
|
|
117
115
|
'@typescript-eslint/no-unused-vars': [
|
|
118
116
|
'warn',
|
|
@@ -130,8 +128,10 @@ function typescript(options = {}) {
|
|
|
130
128
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
131
129
|
'@typescript-eslint/no-useless-default-assignment': 'warn',
|
|
132
130
|
'@typescript-eslint/no-useless-empty-export': 'warn',
|
|
131
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
133
132
|
'@typescript-eslint/parameter-properties': 'off',
|
|
134
133
|
'@typescript-eslint/prefer-as-const': 'warn',
|
|
134
|
+
'@typescript-eslint/prefer-destructuring': 'off', // Annoying
|
|
135
135
|
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
136
136
|
'@typescript-eslint/prefer-for-of': 'warn',
|
|
137
137
|
'@typescript-eslint/prefer-function-type': 'warn',
|
|
@@ -146,7 +146,6 @@ function typescript(options = {}) {
|
|
|
146
146
|
},
|
|
147
147
|
], // I'm not sure...
|
|
148
148
|
'@typescript-eslint/prefer-readonly': 'off',
|
|
149
|
-
'@typescript-eslint/prefer-readonlysemi': 'off', // Annoying with auto-fix on save.
|
|
150
149
|
'@typescript-eslint/promise-function-async': 'off', // Breaks react component when return type is React.ReactNode
|
|
151
150
|
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
152
151
|
'@typescript-eslint/strict-boolean-expressions': 'off', // Annoying
|
|
@@ -157,6 +156,7 @@ function typescript(options = {}) {
|
|
|
157
156
|
|
|
158
157
|
...predicate(projectService, {
|
|
159
158
|
'@typescript-eslint/await-thenable': 'error',
|
|
159
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
160
160
|
'@typescript-eslint/consistent-return': 'off',
|
|
161
161
|
'@typescript-eslint/consistent-type-exports': 'warn',
|
|
162
162
|
'@typescript-eslint/dot-notation': [
|
|
@@ -172,6 +172,7 @@ function typescript(options = {}) {
|
|
|
172
172
|
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
|
|
173
173
|
'@typescript-eslint/no-deprecated': 'error',
|
|
174
174
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
175
|
+
'@typescript-eslint/no-generated-empty-object-type': 'error',
|
|
175
176
|
'@typescript-eslint/no-implied-eval': 'error',
|
|
176
177
|
'@typescript-eslint/no-meaningless-void-operator': ['warn', { checkNever: false }],
|
|
177
178
|
...predicate(!options.disableExpensiveRules, {
|
|
@@ -195,11 +196,14 @@ function typescript(options = {}) {
|
|
|
195
196
|
'@typescript-eslint/no-unnecessary-template-expression': 'warn',
|
|
196
197
|
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
197
198
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
199
|
+
'@typescript-eslint/no-unnecessary-type-parameters': 'off', // Annoying
|
|
200
|
+
'@typescript-eslint/no-unsafe-type-assertion': 'off', // Annoying
|
|
198
201
|
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
199
202
|
'@typescript-eslint/no-unused-private-class-members': 'warn',
|
|
200
203
|
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
|
|
201
204
|
'@typescript-eslint/only-throw-error': ['warn', { allowRethrowing: true }],
|
|
202
205
|
'@typescript-eslint/prefer-includes': 'warn',
|
|
206
|
+
'@typescript-eslint/prefer-find': 'warn',
|
|
203
207
|
'@typescript-eslint/prefer-optional-chain': 'warn',
|
|
204
208
|
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
205
209
|
'@typescript-eslint/prefer-nullish-coalescing': [
|
|
@@ -230,6 +234,7 @@ function typescript(options = {}) {
|
|
|
230
234
|
'@typescript-eslint/require-await': 'error',
|
|
231
235
|
'@typescript-eslint/return-await': 'error',
|
|
232
236
|
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
237
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'warn',
|
|
233
238
|
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
|
|
234
239
|
|
|
235
240
|
// collisions
|
|
@@ -239,6 +244,7 @@ function typescript(options = {}) {
|
|
|
239
244
|
|
|
240
245
|
// Conflicts with @typescript-eslint
|
|
241
246
|
'no-unused-private-class-members': 'off',
|
|
247
|
+
'no-unused-expressions': 'off',
|
|
242
248
|
'no-empty-function': 'off',
|
|
243
249
|
'default-case': 'off',
|
|
244
250
|
'import/named': 'off',
|
|
@@ -249,9 +255,9 @@ function typescript(options = {}) {
|
|
|
249
255
|
'default-param-last': 'off',
|
|
250
256
|
'init-declarations': 'off',
|
|
251
257
|
'no-invalid-this': 'off',
|
|
252
|
-
'
|
|
258
|
+
'max-params': 'off',
|
|
259
|
+
'prefer-destructuring': 'off',
|
|
253
260
|
'no-redeclare': 'off',
|
|
254
|
-
'no-restricted-imports': 'off',
|
|
255
261
|
'no-shadow': 'off',
|
|
256
262
|
'no-unused-vars': 'off',
|
|
257
263
|
'no-use-before-define': 'off',
|
package/src/modules/vitest.mjs
CHANGED
|
@@ -40,8 +40,10 @@ function vitest(options = {}) {
|
|
|
40
40
|
rules: {
|
|
41
41
|
'vitest/consistent-test-filename': 'off',
|
|
42
42
|
'vitest/consistent-test-it': 'warn',
|
|
43
|
+
'vitest/consistent-each-for': 'warn',
|
|
43
44
|
'vitest/consistent-vitest-vi': 'warn',
|
|
44
45
|
'vitest/expect-expect': 'warn',
|
|
46
|
+
'vitest/hoisted-apis-on-top': 'warn',
|
|
45
47
|
'vitest/max-expects': 'off',
|
|
46
48
|
'vitest/max-nested-describe': 'off',
|
|
47
49
|
'vitest/no-alias-methods': 'off',
|
|
@@ -65,11 +67,22 @@ function vitest(options = {}) {
|
|
|
65
67
|
'vitest/no-test-prefixes': 'warn',
|
|
66
68
|
'vitest/no-test-return-statement': 'warn',
|
|
67
69
|
'vitest/no-unneeded-async-expect-function': 'warn',
|
|
70
|
+
'vitest/padding-around-after-all-blocks': 'off',
|
|
71
|
+
'vitest/padding-around-after-each-blocks': 'off',
|
|
72
|
+
'vitest/padding-around-all': 'off',
|
|
73
|
+
'vitest/padding-around-before-all-blocks': 'off',
|
|
74
|
+
'vitest/padding-around-before-each-blocks': 'off',
|
|
75
|
+
'vitest/padding-around-describe-blocks': 'off',
|
|
76
|
+
'vitest/padding-around-expect-groups': 'off',
|
|
77
|
+
'vitest/padding-around-test-blocks': 'off',
|
|
68
78
|
|
|
69
79
|
'vitest/prefer-called-once': 'warn',
|
|
80
|
+
'vitest/prefer-called-exactly-once-with': 'off', // Overlaps with prefer-called-once and prefer-called-with
|
|
70
81
|
'vitest/prefer-called-times': 'off',
|
|
71
82
|
'vitest/prefer-called-with': 'warn',
|
|
72
83
|
'vitest/prefer-comparison-matcher': 'warn',
|
|
84
|
+
'vitest/prefer-expect-type-of': 'warn',
|
|
85
|
+
'vitest/prefer-import-in-mock': 'warn',
|
|
73
86
|
'vitest/prefer-describe-function-title': 'off',
|
|
74
87
|
'vitest/prefer-each': 'warn',
|
|
75
88
|
'vitest/prefer-equality-matcher': 'warn',
|
|
@@ -90,14 +103,18 @@ function vitest(options = {}) {
|
|
|
90
103
|
'vitest/prefer-to-be-object': 'warn',
|
|
91
104
|
'vitest/prefer-to-be-truthy': 'off',
|
|
92
105
|
'vitest/prefer-to-contain': 'warn',
|
|
106
|
+
'vitest/prefer-to-have-been-called-times': 'off',
|
|
93
107
|
'vitest/prefer-to-have-length': 'warn',
|
|
94
108
|
'vitest/prefer-todo': 'warn',
|
|
95
109
|
'vitest/prefer-vi-mocked': 'warn',
|
|
96
110
|
'vitest/require-hook': 'off',
|
|
111
|
+
'vitest/require-awaited-expect-poll': 'error',
|
|
97
112
|
'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
|
|
98
113
|
'vitest/require-mock-type-parameters': 'off',
|
|
99
114
|
'vitest/require-to-throw-message': 'warn',
|
|
115
|
+
'vitest/require-test-timeout': 'off',
|
|
100
116
|
'vitest/require-top-level-describe': 'off',
|
|
117
|
+
'vitest/unbound-method': 'off', // Requires type information, covered by @typescript-eslint/unbound-method
|
|
101
118
|
'vitest/valid-describe-callback': 'warn',
|
|
102
119
|
'vitest/valid-expect': 'warn',
|
|
103
120
|
'vitest/valid-expect-in-promise': 'warn',
|