@bastidood/eslint-config 0.3.0 → 0.5.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 +11 -9
- package/dist/compose/index.mjs +0 -1
- package/dist/{convert-Bc-edfKh.mjs → convert-BXtGAZpc.mjs} +32 -508
- package/dist/core-NeXMRUpu.mjs +475 -0
- package/dist/core.mjs +2 -1
- package/dist/jsdoc.mjs +2 -1
- package/dist/node.mjs +2 -1
- package/dist/promise.mjs +2 -1
- package/dist/tanstack/query.d.mts +3 -0
- package/dist/tanstack/query.mjs +24 -0
- package/dist/tanstack/table.d.mts +3 -0
- package/dist/tanstack/table.mjs +64 -0
- package/dist/unicorn.mjs +2 -1
- package/dist/vitest.mjs +2 -2
- package/package.json +12 -7
package/README.md
CHANGED
|
@@ -25,15 +25,17 @@ List `CORE` first.
|
|
|
25
25
|
|
|
26
26
|
## Entry Points
|
|
27
27
|
|
|
28
|
-
| Entry point
|
|
29
|
-
|
|
|
30
|
-
| `@bastidood/eslint-config`
|
|
31
|
-
| `@bastidood/eslint-config/core`
|
|
32
|
-
| `@bastidood/eslint-config/unicorn`
|
|
33
|
-
| `@bastidood/eslint-config/promise`
|
|
34
|
-
| `@bastidood/eslint-config/node`
|
|
35
|
-
| `@bastidood/eslint-config/vitest`
|
|
36
|
-
| `@bastidood/eslint-config/jsdoc`
|
|
28
|
+
| Entry point | Contents |
|
|
29
|
+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `@bastidood/eslint-config` | `compose` |
|
|
31
|
+
| `@bastidood/eslint-config/core` | ESLint core, `import`, and `@typescript-eslint` rules |
|
|
32
|
+
| `@bastidood/eslint-config/unicorn` | `unicorn` rules |
|
|
33
|
+
| `@bastidood/eslint-config/promise` | `promise` rules |
|
|
34
|
+
| `@bastidood/eslint-config/node` | Node.js rules |
|
|
35
|
+
| `@bastidood/eslint-config/vitest` | Vitest rules |
|
|
36
|
+
| `@bastidood/eslint-config/jsdoc` | JSDoc rules for documentation that TypeScript does not cover |
|
|
37
|
+
| `@bastidood/eslint-config/tanstack/query` | Enables the slopstopper TanStack Query rules: `prefer-query-key-context`, `no-defaulted-query-key`, `no-standalone-mutate-async`, and `no-mutate-callback-cache-update` |
|
|
38
|
+
| `@bastidood/eslint-config/tanstack/table` | Enables the slopstopper TanStack Table rules: `prefer-table-atoms`, `require-table-state-pairs`, `no-render-scoped-table-schema`, and `require-exclusive-indeterminate`; bans `stockFeatures` and reading column templates outside `FlexRender` |
|
|
37
39
|
|
|
38
40
|
## Limitations
|
|
39
41
|
|
package/dist/compose/index.mjs
CHANGED
|
@@ -12,7 +12,6 @@ var RestrictionLists = class RestrictionLists {
|
|
|
12
12
|
#globals = ["error"];
|
|
13
13
|
#properties = ["error"];
|
|
14
14
|
#syntax = ["error"];
|
|
15
|
-
/** Append every list of an entry point's restrictions. */
|
|
16
15
|
append({ importPaths, importPatterns, globals, properties, syntax }) {
|
|
17
16
|
appendAll(this.#imports.paths, importPaths);
|
|
18
17
|
appendAll(this.#imports.patterns, importPatterns);
|
|
@@ -1,477 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
/** ESLint core, `import`, `oxc`, and type-aware `typescript` rules. Rules that the TypeScript compiler already reports are off. */
|
|
3
|
-
const CORE = {
|
|
4
|
-
config: {
|
|
5
|
-
plugins: [
|
|
6
|
-
"import",
|
|
7
|
-
"oxc",
|
|
8
|
-
"typescript"
|
|
9
|
-
],
|
|
10
|
-
jsPlugins: [{
|
|
11
|
-
name: "eslint-js",
|
|
12
|
-
specifier: "oxlint-plugin-eslint"
|
|
13
|
-
}, {
|
|
14
|
-
name: "slopstopper",
|
|
15
|
-
specifier: "@bastidood/eslint-plugin-slopstopper"
|
|
16
|
-
}],
|
|
17
|
-
categories: {
|
|
18
|
-
correctness: "error",
|
|
19
|
-
perf: "error",
|
|
20
|
-
suspicious: "error"
|
|
21
|
-
},
|
|
22
|
-
options: {
|
|
23
|
-
denyWarnings: true,
|
|
24
|
-
typeAware: true
|
|
25
|
-
},
|
|
26
|
-
overrides: [{
|
|
27
|
-
files: [
|
|
28
|
-
"**/*.js",
|
|
29
|
-
"**/*.mjs",
|
|
30
|
-
"**/*.cjs"
|
|
31
|
-
],
|
|
32
|
-
rules: { "no-unused-vars": ["error", {
|
|
33
|
-
argsIgnorePattern: "^_",
|
|
34
|
-
varsIgnorePattern: "^_"
|
|
35
|
-
}] }
|
|
36
|
-
}],
|
|
37
|
-
rules: {
|
|
38
|
-
"accessor-pairs": ["error", { enforceForTSTypes: true }],
|
|
39
|
-
"array-callback-return": ["error", { checkForEach: true }],
|
|
40
|
-
"arrow-body-style": "error",
|
|
41
|
-
"block-scoped-var": "error",
|
|
42
|
-
"capitalized-comments": [
|
|
43
|
-
"error",
|
|
44
|
-
"always",
|
|
45
|
-
{ ignoreConsecutiveComments: true }
|
|
46
|
-
],
|
|
47
|
-
"class-methods-use-this": "error",
|
|
48
|
-
complexity: "off",
|
|
49
|
-
"constructor-super": "off",
|
|
50
|
-
curly: [
|
|
51
|
-
"error",
|
|
52
|
-
"multi-line",
|
|
53
|
-
"consistent"
|
|
54
|
-
],
|
|
55
|
-
"default-case-last": "error",
|
|
56
|
-
"default-param-last": "error",
|
|
57
|
-
eqeqeq: "error",
|
|
58
|
-
"eslint-js/no-octal-escape": "error",
|
|
59
|
-
"eslint-js/no-undef-init": "error",
|
|
60
|
-
"eslint-js/require-atomic-updates": "error",
|
|
61
|
-
"for-direction": "error",
|
|
62
|
-
"func-name-matching": "off",
|
|
63
|
-
"func-names": ["error", "as-needed"],
|
|
64
|
-
"func-style": ["error", "declaration"],
|
|
65
|
-
"getter-return": "off",
|
|
66
|
-
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
67
|
-
"guard-for-in": "error",
|
|
68
|
-
"id-denylist": "off",
|
|
69
|
-
"id-length": "off",
|
|
70
|
-
"id-match": "off",
|
|
71
|
-
"import/consistent-type-specifier-style": ["error", "prefer-top-level-if-only-type-imports"],
|
|
72
|
-
"import/default": "off",
|
|
73
|
-
"import/exports-last": "off",
|
|
74
|
-
"import/first": "error",
|
|
75
|
-
"import/group-exports": "off",
|
|
76
|
-
"import/max-dependencies": "off",
|
|
77
|
-
"import/namespace": "off",
|
|
78
|
-
"import/newline-after-import": "error",
|
|
79
|
-
"import/no-absolute-path": "error",
|
|
80
|
-
"import/no-amd": "error",
|
|
81
|
-
"import/no-anonymous-default-export": "error",
|
|
82
|
-
"import/no-commonjs": "error",
|
|
83
|
-
"import/no-cycle": "error",
|
|
84
|
-
"import/no-default-export": "off",
|
|
85
|
-
"import/no-dynamic-require": "error",
|
|
86
|
-
"import/no-empty-named-blocks": "error",
|
|
87
|
-
"import/no-mutable-exports": "error",
|
|
88
|
-
"import/no-named-as-default": "error",
|
|
89
|
-
"import/no-named-as-default-member": "error",
|
|
90
|
-
"import/no-named-default": "error",
|
|
91
|
-
"import/no-named-export": "off",
|
|
92
|
-
"import/no-namespace": "off",
|
|
93
|
-
"import/no-nodejs-modules": "off",
|
|
94
|
-
"import/no-self-import": "error",
|
|
95
|
-
"import/no-unassigned-import": "off",
|
|
96
|
-
"import/no-webpack-loader-syntax": "error",
|
|
97
|
-
"import/prefer-default-export": "off",
|
|
98
|
-
"init-declarations": "off",
|
|
99
|
-
"logical-assignment-operators": "error",
|
|
100
|
-
"max-classes-per-file": "off",
|
|
101
|
-
"max-lines": "off",
|
|
102
|
-
"max-lines-per-function": "off",
|
|
103
|
-
"max-nested-callbacks": "off",
|
|
104
|
-
"max-params": "off",
|
|
105
|
-
"max-statements": "off",
|
|
106
|
-
"new-cap": "error",
|
|
107
|
-
"no-alert": "error",
|
|
108
|
-
"no-array-constructor": "error",
|
|
109
|
-
"no-async-promise-executor": "error",
|
|
110
|
-
"no-await-in-loop": "error",
|
|
111
|
-
"no-bitwise": "error",
|
|
112
|
-
"no-caller": "error",
|
|
113
|
-
"no-case-declarations": "error",
|
|
114
|
-
"no-class-assign": "off",
|
|
115
|
-
"no-compare-neg-zero": "error",
|
|
116
|
-
"no-cond-assign": "error",
|
|
117
|
-
"no-console": "error",
|
|
118
|
-
"no-const-assign": "off",
|
|
119
|
-
"no-constant-binary-expression": "error",
|
|
120
|
-
"no-constant-condition": ["error", { checkLoops: "allExceptWhileTrue" }],
|
|
121
|
-
"no-constructor-return": "error",
|
|
122
|
-
"no-continue": "off",
|
|
123
|
-
"no-control-regex": "error",
|
|
124
|
-
"no-debugger": "error",
|
|
125
|
-
"no-delete-var": "off",
|
|
126
|
-
"no-div-regex": "error",
|
|
127
|
-
"no-dupe-class-members": "off",
|
|
128
|
-
"no-dupe-else-if": "error",
|
|
129
|
-
"no-dupe-keys": "off",
|
|
130
|
-
"no-duplicate-case": "error",
|
|
131
|
-
"no-duplicate-imports": "error",
|
|
132
|
-
"no-else-return": "error",
|
|
133
|
-
"no-empty": "error",
|
|
134
|
-
"no-empty-character-class": "error",
|
|
135
|
-
"no-empty-function": "error",
|
|
136
|
-
"no-empty-pattern": "error",
|
|
137
|
-
"no-empty-static-block": "error",
|
|
138
|
-
"no-eq-null": "error",
|
|
139
|
-
"no-eval": "error",
|
|
140
|
-
"no-ex-assign": "error",
|
|
141
|
-
"no-extend-native": "error",
|
|
142
|
-
"no-extra-bind": "error",
|
|
143
|
-
"no-extra-boolean-cast": "error",
|
|
144
|
-
"no-extra-label": "error",
|
|
145
|
-
"no-fallthrough": "error",
|
|
146
|
-
"no-func-assign": "off",
|
|
147
|
-
"no-global-assign": "error",
|
|
148
|
-
"no-implicit-coercion": "error",
|
|
149
|
-
"no-implicit-globals": "error",
|
|
150
|
-
"no-implied-eval": "off",
|
|
151
|
-
"no-import-assign": "off",
|
|
152
|
-
"no-inline-comments": "off",
|
|
153
|
-
"no-inner-declarations": "off",
|
|
154
|
-
"no-invalid-regexp": "error",
|
|
155
|
-
"no-irregular-whitespace": "error",
|
|
156
|
-
"no-iterator": "error",
|
|
157
|
-
"no-label-var": "error",
|
|
158
|
-
"no-labels": "error",
|
|
159
|
-
"no-lone-blocks": "error",
|
|
160
|
-
"no-lonely-if": "error",
|
|
161
|
-
"no-loop-func": "error",
|
|
162
|
-
"no-loss-of-precision": "error",
|
|
163
|
-
"no-magic-numbers": "off",
|
|
164
|
-
"no-misleading-character-class": "error",
|
|
165
|
-
"no-multi-assign": "error",
|
|
166
|
-
"no-multi-str": "error",
|
|
167
|
-
"no-negated-condition": "error",
|
|
168
|
-
"no-nested-ternary": "error",
|
|
169
|
-
"no-new": "error",
|
|
170
|
-
"no-new-func": "error",
|
|
171
|
-
"no-new-native-nonconstructor": "off",
|
|
172
|
-
"no-new-wrappers": "error",
|
|
173
|
-
"no-nonoctal-decimal-escape": "error",
|
|
174
|
-
"no-obj-calls": "off",
|
|
175
|
-
"no-object-constructor": "error",
|
|
176
|
-
"no-param-reassign": "error",
|
|
177
|
-
"no-plusplus": "off",
|
|
178
|
-
"no-promise-executor-return": "error",
|
|
179
|
-
"no-proto": "error",
|
|
180
|
-
"no-prototype-builtins": "error",
|
|
181
|
-
"no-regex-spaces": "error",
|
|
182
|
-
"no-restricted-exports": "off",
|
|
183
|
-
"no-return-assign": "error",
|
|
184
|
-
"no-script-url": "error",
|
|
185
|
-
"no-self-assign": "error",
|
|
186
|
-
"no-self-compare": "error",
|
|
187
|
-
"no-sequences": "error",
|
|
188
|
-
"no-setter-return": "off",
|
|
189
|
-
"no-shadow": "off",
|
|
190
|
-
"no-shadow-restricted-names": "error",
|
|
191
|
-
"no-sparse-arrays": "error",
|
|
192
|
-
"no-template-curly-in-string": "error",
|
|
193
|
-
"no-ternary": "off",
|
|
194
|
-
"no-this-before-super": "off",
|
|
195
|
-
"no-unassigned-vars": "error",
|
|
196
|
-
"no-underscore-dangle": ["error", {
|
|
197
|
-
enforceInMethodNames: true,
|
|
198
|
-
enforceInClassFields: true
|
|
199
|
-
}],
|
|
200
|
-
"no-unexpected-multiline": "error",
|
|
201
|
-
"no-unmodified-loop-condition": "error",
|
|
202
|
-
"no-unneeded-ternary": "error",
|
|
203
|
-
"no-unreachable": "off",
|
|
204
|
-
"no-unreachable-loop": "error",
|
|
205
|
-
"no-unsafe-finally": "error",
|
|
206
|
-
"no-unsafe-negation": "off",
|
|
207
|
-
"no-unsafe-optional-chaining": "off",
|
|
208
|
-
"no-unused-expressions": "error",
|
|
209
|
-
"no-unused-labels": "off",
|
|
210
|
-
"no-unused-private-class-members": "off",
|
|
211
|
-
"no-unused-vars": "off",
|
|
212
|
-
"no-use-before-define": "off",
|
|
213
|
-
"no-useless-assignment": "error",
|
|
214
|
-
"no-useless-backreference": "error",
|
|
215
|
-
"no-useless-call": "error",
|
|
216
|
-
"no-useless-catch": "error",
|
|
217
|
-
"no-useless-computed-key": "error",
|
|
218
|
-
"no-useless-concat": "error",
|
|
219
|
-
"no-useless-constructor": "error",
|
|
220
|
-
"no-useless-escape": "error",
|
|
221
|
-
"no-useless-rename": "error",
|
|
222
|
-
"no-useless-return": "error",
|
|
223
|
-
"no-var": "error",
|
|
224
|
-
"no-void": "off",
|
|
225
|
-
"no-warning-comments": "off",
|
|
226
|
-
"no-with": "off",
|
|
227
|
-
"object-shorthand": [
|
|
228
|
-
"error",
|
|
229
|
-
"always",
|
|
230
|
-
{ avoidExplicitReturnArrows: true }
|
|
231
|
-
],
|
|
232
|
-
"one-var": ["error", "never"],
|
|
233
|
-
"operator-assignment": "error",
|
|
234
|
-
"oxc/approx-constant": "error",
|
|
235
|
-
"oxc/bad-array-method-on-arguments": "error",
|
|
236
|
-
"oxc/bad-bitwise-operator": "error",
|
|
237
|
-
"oxc/bad-char-at-comparison": "error",
|
|
238
|
-
"oxc/bad-comparison-sequence": "error",
|
|
239
|
-
"oxc/bad-match-all-arg": "error",
|
|
240
|
-
"oxc/bad-min-max-func": "error",
|
|
241
|
-
"oxc/bad-object-literal-comparison": "error",
|
|
242
|
-
"oxc/bad-replace-all-arg": "error",
|
|
243
|
-
"oxc/branches-sharing-code": "error",
|
|
244
|
-
"oxc/const-comparisons": "error",
|
|
245
|
-
"oxc/double-comparisons": "error",
|
|
246
|
-
"oxc/erasing-op": "error",
|
|
247
|
-
"oxc/misrefactored-assign-op": "error",
|
|
248
|
-
"oxc/missing-throw": "error",
|
|
249
|
-
"oxc/no-accumulating-spread": "error",
|
|
250
|
-
"oxc/no-async-endpoint-handlers": "off",
|
|
251
|
-
"oxc/no-barrel-file": ["error", { threshold: 0 }],
|
|
252
|
-
"oxc/no-const-enum": "error",
|
|
253
|
-
"oxc/no-map-spread": ["error", {
|
|
254
|
-
ignoreArgs: false,
|
|
255
|
-
ignoreRereads: false
|
|
256
|
-
}],
|
|
257
|
-
"oxc/no-this-in-exported-function": "off",
|
|
258
|
-
"oxc/number-arg-out-of-range": "error",
|
|
259
|
-
"oxc/only-used-in-recursion": "error",
|
|
260
|
-
"oxc/uninvoked-array-callback": "error",
|
|
261
|
-
"prefer-arrow-callback": "error",
|
|
262
|
-
"prefer-const": "error",
|
|
263
|
-
"prefer-destructuring": "error",
|
|
264
|
-
"prefer-exponentiation-operator": "error",
|
|
265
|
-
"prefer-named-capture-group": "error",
|
|
266
|
-
"prefer-numeric-literals": "error",
|
|
267
|
-
"prefer-object-has-own": "error",
|
|
268
|
-
"prefer-object-spread": "error",
|
|
269
|
-
"prefer-regex-literals": "error",
|
|
270
|
-
"prefer-rest-params": "error",
|
|
271
|
-
"prefer-spread": "error",
|
|
272
|
-
"prefer-template": "error",
|
|
273
|
-
"preserve-caught-error": "error",
|
|
274
|
-
radix: "error",
|
|
275
|
-
"require-unicode-regexp": "error",
|
|
276
|
-
"require-yield": "error",
|
|
277
|
-
"slopstopper/destructure-on-sight": "error",
|
|
278
|
-
"slopstopper/handle-or-rethrow": "error",
|
|
279
|
-
"slopstopper/merge-exclusive-branches": "error",
|
|
280
|
-
"slopstopper/needless-type-intersection": "error",
|
|
281
|
-
"slopstopper/no-alias-object-type": "error",
|
|
282
|
-
"slopstopper/no-array-filter-map": "error",
|
|
283
|
-
"slopstopper/no-conditional-empty-object-spread": "error",
|
|
284
|
-
"slopstopper/no-equality-chain": "error",
|
|
285
|
-
"slopstopper/no-inferrable-return-type": "error",
|
|
286
|
-
"slopstopper/no-known-value-widening": "error",
|
|
287
|
-
"slopstopper/no-multiple-optional-parameters": "error",
|
|
288
|
-
"slopstopper/no-negated-group": "error",
|
|
289
|
-
"slopstopper/no-negated-quantifier-callback": "error",
|
|
290
|
-
"slopstopper/no-plain-template-literal": "error",
|
|
291
|
-
"slopstopper/no-positional-scalars": "error",
|
|
292
|
-
"slopstopper/no-private-modifier": "error",
|
|
293
|
-
"slopstopper/no-reduce-accumulator-copy": "error",
|
|
294
|
-
"slopstopper/no-temporary-access": "error",
|
|
295
|
-
"slopstopper/no-type-predicates": "error",
|
|
296
|
-
"slopstopper/no-unknown-returns": "error",
|
|
297
|
-
"slopstopper/no-unknown-type-aliases": "error",
|
|
298
|
-
"slopstopper/no-unsafe-dictionary-type": "error",
|
|
299
|
-
"slopstopper/prefer-class-over-factory": "error",
|
|
300
|
-
"slopstopper/prefer-de-morgan": "error",
|
|
301
|
-
"slopstopper/prefer-prefix-increment": "error",
|
|
302
|
-
"slopstopper/prefer-switch": "error",
|
|
303
|
-
"slopstopper/prefer-typeof-undefined": "error",
|
|
304
|
-
"slopstopper/prefer-while-true": "error",
|
|
305
|
-
"slopstopper/stepdown-order": "error",
|
|
306
|
-
"sort-keys": "off",
|
|
307
|
-
"symbol-description": "error",
|
|
308
|
-
"typescript/adjacent-overload-signatures": "error",
|
|
309
|
-
"typescript/array-type": "error",
|
|
310
|
-
"typescript/await-thenable": "error",
|
|
311
|
-
"typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
|
|
312
|
-
"typescript/ban-tslint-comment": "error",
|
|
313
|
-
"typescript/class-literal-property-style": "error",
|
|
314
|
-
"typescript/consistent-generic-constructors": "error",
|
|
315
|
-
"typescript/consistent-indexed-object-style": "error",
|
|
316
|
-
"typescript/consistent-return": "off",
|
|
317
|
-
"typescript/consistent-type-assertions": "error",
|
|
318
|
-
"typescript/consistent-type-definitions": ["error", "interface"],
|
|
319
|
-
"typescript/dot-notation": "error",
|
|
320
|
-
"typescript/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
|
|
321
|
-
"typescript/init-declarations": "error",
|
|
322
|
-
"typescript/method-signature-style": "error",
|
|
323
|
-
"typescript/no-array-delete": "error",
|
|
324
|
-
"typescript/no-base-to-string": ["error", {
|
|
325
|
-
checkUnknown: true,
|
|
326
|
-
ignoredTypeNames: []
|
|
327
|
-
}],
|
|
328
|
-
"typescript/no-confusing-non-null-assertion": "error",
|
|
329
|
-
"typescript/no-confusing-void-expression": "off",
|
|
330
|
-
"typescript/no-deprecated": "error",
|
|
331
|
-
"typescript/no-duplicate-enum-values": "error",
|
|
332
|
-
"typescript/no-duplicate-type-constituents": "error",
|
|
333
|
-
"typescript/no-dynamic-delete": "error",
|
|
334
|
-
"typescript/no-empty-object-type": "error",
|
|
335
|
-
"typescript/no-explicit-any": "error",
|
|
336
|
-
"typescript/no-extra-non-null-assertion": "error",
|
|
337
|
-
"typescript/no-extraneous-class": "error",
|
|
338
|
-
"typescript/no-floating-promises": ["error", { ignoreVoid: false }],
|
|
339
|
-
"typescript/no-for-in-array": "error",
|
|
340
|
-
"typescript/no-generated-empty-object-type": "error",
|
|
341
|
-
"typescript/no-implied-eval": "error",
|
|
342
|
-
"typescript/no-import-type-side-effects": "error",
|
|
343
|
-
"typescript/no-inferrable-types": "error",
|
|
344
|
-
"typescript/no-invalid-void-type": "error",
|
|
345
|
-
"typescript/no-meaningless-void-operator": "error",
|
|
346
|
-
"typescript/no-misused-new": "error",
|
|
347
|
-
"typescript/no-misused-promises": "error",
|
|
348
|
-
"typescript/no-misused-spread": "error",
|
|
349
|
-
"typescript/no-mixed-enums": "error",
|
|
350
|
-
"typescript/no-namespace": "error",
|
|
351
|
-
"typescript/no-non-null-asserted-nullish-coalescing": "error",
|
|
352
|
-
"typescript/no-non-null-asserted-optional-chain": "error",
|
|
353
|
-
"typescript/no-non-null-assertion": "error",
|
|
354
|
-
"typescript/no-redundant-type-constituents": "error",
|
|
355
|
-
"typescript/no-require-imports": "error",
|
|
356
|
-
"typescript/no-restricted-types": ["error", { types: {
|
|
357
|
-
object: "Use a precise `interface` contract instead of `object`; accept `unknown` only at an untrusted boundary and parse it into a trusted type there.",
|
|
358
|
-
"Record<string, unknown>": "Do not use `Record<string, unknown>`: it is a variant of `any`. Declare a precise `interface`, or accept `unknown` only at an untrusted boundary and parse it into a trusted type there."
|
|
359
|
-
} }],
|
|
360
|
-
"typescript/no-this-alias": "error",
|
|
361
|
-
"typescript/no-unnecessary-boolean-literal-compare": "error",
|
|
362
|
-
"typescript/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
|
|
363
|
-
"typescript/no-unnecessary-parameter-property-assignment": "off",
|
|
364
|
-
"typescript/no-unnecessary-template-expression": "error",
|
|
365
|
-
"typescript/no-unnecessary-type-arguments": "error",
|
|
366
|
-
"typescript/no-unnecessary-type-assertion": "error",
|
|
367
|
-
"typescript/no-unnecessary-type-constraint": "error",
|
|
368
|
-
"typescript/no-unnecessary-type-conversion": "error",
|
|
369
|
-
"typescript/no-unnecessary-type-parameters": "error",
|
|
370
|
-
"typescript/no-unsafe-argument": "error",
|
|
371
|
-
"typescript/no-unsafe-assignment": "error",
|
|
372
|
-
"typescript/no-unsafe-call": "error",
|
|
373
|
-
"typescript/no-unsafe-declaration-merging": "error",
|
|
374
|
-
"typescript/no-unsafe-enum-assignment": "error",
|
|
375
|
-
"typescript/no-unsafe-enum-comparison": "error",
|
|
376
|
-
"typescript/no-unsafe-function-type": "error",
|
|
377
|
-
"typescript/no-unsafe-member-access": "error",
|
|
378
|
-
"typescript/no-unsafe-return": "error",
|
|
379
|
-
"typescript/no-unsafe-type-assertion": "error",
|
|
380
|
-
"typescript/no-unsafe-unary-minus": "error",
|
|
381
|
-
"typescript/no-useless-default-assignment": "error",
|
|
382
|
-
"typescript/no-useless-empty-export": "error",
|
|
383
|
-
"typescript/no-wrapper-object-types": "error",
|
|
384
|
-
"typescript/non-nullable-type-assertion-style": "error",
|
|
385
|
-
"typescript/only-throw-error": "error",
|
|
386
|
-
"typescript/parameter-properties": ["error", { prefer: "class-property" }],
|
|
387
|
-
"typescript/prefer-as-const": "error",
|
|
388
|
-
"typescript/prefer-enum-initializers": "off",
|
|
389
|
-
"typescript/prefer-find": "error",
|
|
390
|
-
"typescript/prefer-for-of": "error",
|
|
391
|
-
"typescript/prefer-function-type": "error",
|
|
392
|
-
"typescript/prefer-includes": "error",
|
|
393
|
-
"typescript/prefer-literal-enum-member": "error",
|
|
394
|
-
"typescript/prefer-namespace-keyword": "error",
|
|
395
|
-
"typescript/prefer-nullish-coalescing": ["error", { ignorePrimitives: { string: true } }],
|
|
396
|
-
"typescript/prefer-optional-chain": "error",
|
|
397
|
-
"typescript/prefer-promise-reject-errors": "error",
|
|
398
|
-
"typescript/prefer-readonly": "error",
|
|
399
|
-
"typescript/prefer-reduce-type-parameter": "error",
|
|
400
|
-
"typescript/prefer-regexp-exec": "error",
|
|
401
|
-
"typescript/prefer-return-this-type": "error",
|
|
402
|
-
"typescript/prefer-string-starts-ends-with": "error",
|
|
403
|
-
"typescript/promise-function-async": "error",
|
|
404
|
-
"typescript/related-getter-setter-pairs": "error",
|
|
405
|
-
"typescript/require-array-sort-compare": "error",
|
|
406
|
-
"typescript/require-await": "error",
|
|
407
|
-
"typescript/restrict-plus-operands": ["error", {
|
|
408
|
-
allowAny: false,
|
|
409
|
-
allowBoolean: false,
|
|
410
|
-
allowNullish: false,
|
|
411
|
-
allowNumberAndString: false,
|
|
412
|
-
allowRegExp: false
|
|
413
|
-
}],
|
|
414
|
-
"typescript/restrict-template-expressions": ["error", {
|
|
415
|
-
allow: [],
|
|
416
|
-
allowAny: false,
|
|
417
|
-
allowBoolean: true,
|
|
418
|
-
allowNever: false,
|
|
419
|
-
allowNullish: false,
|
|
420
|
-
allowNumber: true,
|
|
421
|
-
allowRegExp: false
|
|
422
|
-
}],
|
|
423
|
-
"typescript/return-await": ["error", "always"],
|
|
424
|
-
"typescript/strict-boolean-expressions": ["error", {
|
|
425
|
-
allowNullableObject: false,
|
|
426
|
-
allowNullableNumber: false,
|
|
427
|
-
allowNullableString: false,
|
|
428
|
-
allowNumber: false,
|
|
429
|
-
allowString: false
|
|
430
|
-
}],
|
|
431
|
-
"typescript/strict-void-return": "error",
|
|
432
|
-
"typescript/switch-exhaustiveness-check": ["error", {
|
|
433
|
-
allowDefaultCaseForExhaustiveSwitch: false,
|
|
434
|
-
considerDefaultExhaustiveForUnions: false,
|
|
435
|
-
requireDefaultForNonUnion: false
|
|
436
|
-
}],
|
|
437
|
-
"typescript/triple-slash-reference": "error",
|
|
438
|
-
"typescript/unbound-method": "error",
|
|
439
|
-
"typescript/unified-signatures": "error",
|
|
440
|
-
"typescript/use-unknown-in-catch-callback-variable": "error",
|
|
441
|
-
"unicode-bom": "off",
|
|
442
|
-
"use-isnan": "off",
|
|
443
|
-
"valid-typeof": "off",
|
|
444
|
-
yoda: [
|
|
445
|
-
"error",
|
|
446
|
-
"never",
|
|
447
|
-
{ exceptRange: true }
|
|
448
|
-
]
|
|
449
|
-
}
|
|
450
|
-
},
|
|
451
|
-
restrictions: {
|
|
452
|
-
importPatterns: [{
|
|
453
|
-
regex: String.raw`(^|/)\.\.(?:/|$)`,
|
|
454
|
-
message: "Import through a path alias or package subpath import instead of a parent-relative path (`../`)."
|
|
455
|
-
}],
|
|
456
|
-
globals: [{
|
|
457
|
-
name: "Reflect",
|
|
458
|
-
message: "Call typed functions and read typed properties directly instead of through `Reflect`, and parse dynamic input into a domain type first. Suppress this diagnostic with a reason only where a typed access is impossible."
|
|
459
|
-
}, {
|
|
460
|
-
name: "undefined",
|
|
461
|
-
message: "Omit absent values instead of writing `undefined`: add the property in an `if` after declaring the object (as `exactOptionalPropertyTypes` requires) or leave out the argument, and use a `typeof` check to test for absence. Pass `void 0` only to a parameter that cannot be omitted and is explicitly typed to accept `undefined`."
|
|
462
|
-
}],
|
|
463
|
-
properties: [{
|
|
464
|
-
object: "process",
|
|
465
|
-
property: "env",
|
|
466
|
-
message: "Read environment variables only in the entry point: validate them there and pass the values as explicit parameters. Opt the entry point out with a file-level disable comment."
|
|
467
|
-
}],
|
|
468
|
-
syntax: [{
|
|
469
|
-
selector: "UnaryExpression[operator=\"void\"][argument.type=\"Literal\"]:not(:matches(CallExpression, NewExpression) > UnaryExpression.arguments)",
|
|
470
|
-
message: "Do not write `void 0` to produce `undefined`: omit the absent value by conditionally inserting the property (as `exactOptionalPropertyTypes` requires). `void 0` is allowed only as an argument to a parameter that cannot be omitted and is explicitly typed to accept `undefined`."
|
|
471
|
-
}]
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
// ../../node_modules/.pnpm/eslint-plugin-oxlint@1.90.0_oxlint@1.90.0_oxlint-tsgolint@7.0.2005_/node_modules/eslint-plugin-oxlint/dist/generated/rules-by-category.mjs
|
|
1
|
+
// ../../node_modules/.pnpm/eslint-plugin-oxlint@1.90.0_oxlint@1.91.0_oxlint-tsgolint@7.0.2005_/node_modules/eslint-plugin-oxlint/dist/generated/rules-by-category.mjs
|
|
475
2
|
const pedanticRules = {
|
|
476
3
|
"accessor-pairs": "off",
|
|
477
4
|
"array-callback-return": "off",
|
|
@@ -1394,7 +921,7 @@ const restrictionTypeAwareRules = {
|
|
|
1394
921
|
"@typescript-eslint/promise-function-async": "off",
|
|
1395
922
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "off"
|
|
1396
923
|
};
|
|
1397
|
-
// ../../node_modules/.pnpm/eslint-plugin-oxlint@1.90.0_oxlint@1.
|
|
924
|
+
// ../../node_modules/.pnpm/eslint-plugin-oxlint@1.90.0_oxlint@1.91.0_oxlint-tsgolint@7.0.2005_/node_modules/eslint-plugin-oxlint/dist/generated/rules-by-scope.mjs
|
|
1398
925
|
const reactHooksRules = {
|
|
1399
926
|
"react-hooks/capitalized-calls": "off",
|
|
1400
927
|
"react-hooks/error-boundaries": "off",
|
|
@@ -1449,7 +976,6 @@ function writeEslintRules(target, rules) {
|
|
|
1449
976
|
if (isSupportedInEslint(eslintName)) target[eslintName] = toEslintRuleEntry(rule);
|
|
1450
977
|
}
|
|
1451
978
|
}
|
|
1452
|
-
/** Translate an Oxlint rule name into the name of the same rule in ESLint and its plugins. */
|
|
1453
979
|
function toEslintRuleName(name) {
|
|
1454
980
|
const separator = name.indexOf("/");
|
|
1455
981
|
if (separator === -1) return name;
|
|
@@ -1469,32 +995,24 @@ function toEslintRuleName(name) {
|
|
|
1469
995
|
function toEslintRuleEntry(rule) {
|
|
1470
996
|
return Array.isArray(rule) ? [toEslintSeverity(rule[0]), ...rule.values().drop(1)] : toEslintSeverity(rule);
|
|
1471
997
|
}
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
if (!Object.hasOwn(ruleSet, name) || !isSupportedInEslint(name)) continue;
|
|
1489
|
-
const namespace = namespaceOf(name);
|
|
1490
|
-
const eslintName = renamedInEslint(name);
|
|
1491
|
-
const names = byNamespace.get(namespace);
|
|
1492
|
-
if (typeof names === "undefined") byNamespace.set(namespace, [eslintName]);
|
|
1493
|
-
else names.push(eslintName);
|
|
1494
|
-
}
|
|
1495
|
-
index.set(category, byNamespace);
|
|
998
|
+
const CORRECTNESS = indexByNamespace(correctnessRules, correctnessTypeAwareRules);
|
|
999
|
+
const NURSERY = indexByNamespace(nurseryRules, nurseryTypeAwareRules);
|
|
1000
|
+
const PEDANTIC = indexByNamespace(pedanticRules, pedanticTypeAwareRules);
|
|
1001
|
+
const PERF = indexByNamespace(perfRules);
|
|
1002
|
+
const RESTRICTION = indexByNamespace(restrictionRules, restrictionTypeAwareRules);
|
|
1003
|
+
const STYLE = indexByNamespace(styleRules, styleTypeAwareRules);
|
|
1004
|
+
const SUSPICIOUS = indexByNamespace(suspiciousRules, suspiciousTypeAwareRules);
|
|
1005
|
+
function indexByNamespace(...ruleSets) {
|
|
1006
|
+
const byNamespace = /* @__PURE__ */ new Map();
|
|
1007
|
+
for (const ruleSet of ruleSets) for (const name in ruleSet) {
|
|
1008
|
+
if (!Object.hasOwn(ruleSet, name) || !isSupportedInEslint(name)) continue;
|
|
1009
|
+
const namespace = namespaceOf(name);
|
|
1010
|
+
const eslintName = renamedInEslint(name);
|
|
1011
|
+
const names = byNamespace.get(namespace);
|
|
1012
|
+
if (typeof names === "undefined") byNamespace.set(namespace, [eslintName]);
|
|
1013
|
+
else names.push(eslintName);
|
|
1496
1014
|
}
|
|
1497
|
-
return
|
|
1015
|
+
return byNamespace;
|
|
1498
1016
|
}
|
|
1499
1017
|
/**
|
|
1500
1018
|
* Whether ESLint can run a rule, given its ESLint name. The conversion prunes unsupported rules: Oxlint-only rules,
|
|
@@ -1540,12 +1058,18 @@ function writeExtensionRules(target, rules, extensions) {
|
|
|
1540
1058
|
}
|
|
1541
1059
|
}
|
|
1542
1060
|
/** Write the ESLint rules that the configured Oxlint categories enable for the given Oxlint plugins. */
|
|
1543
|
-
function writeCategoryRules(target,
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1061
|
+
function writeCategoryRules(target, { correctness, nursery, pedantic, perf, restriction, style, suspicious }, plugins) {
|
|
1062
|
+
writeCategory(target, CORRECTNESS, correctness, plugins);
|
|
1063
|
+
writeCategory(target, NURSERY, nursery, plugins);
|
|
1064
|
+
writeCategory(target, PEDANTIC, pedantic, plugins);
|
|
1065
|
+
writeCategory(target, PERF, perf, plugins);
|
|
1066
|
+
writeCategory(target, RESTRICTION, restriction, plugins);
|
|
1067
|
+
writeCategory(target, STYLE, style, plugins);
|
|
1068
|
+
writeCategory(target, SUSPICIOUS, suspicious, plugins);
|
|
1069
|
+
}
|
|
1070
|
+
function writeCategory(target, byNamespace, severity, plugins) {
|
|
1071
|
+
if (typeof severity === "undefined") return;
|
|
1072
|
+
writeNamespaceRules(target, byNamespace, plugins, toEslintSeverity(severity));
|
|
1549
1073
|
}
|
|
1550
1074
|
function writeNamespaceRules(target, byNamespace, plugins, severity) {
|
|
1551
1075
|
for (const plugin of plugins) {
|
|
@@ -1590,4 +1114,4 @@ function toEslintSeverity(severity) {
|
|
|
1590
1114
|
}
|
|
1591
1115
|
}
|
|
1592
1116
|
}
|
|
1593
|
-
export {
|
|
1117
|
+
export { writeEslintRules as n, writeExtensionRules as r, writeCategoryRules as t };
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
// ../oxlint/src/core.ts
|
|
2
|
+
/** ESLint core, `import`, `oxc`, and type-aware `typescript` rules. Rules that the TypeScript compiler already reports are off. */
|
|
3
|
+
const CORE = {
|
|
4
|
+
config: {
|
|
5
|
+
plugins: [
|
|
6
|
+
"import",
|
|
7
|
+
"oxc",
|
|
8
|
+
"typescript"
|
|
9
|
+
],
|
|
10
|
+
jsPlugins: [{
|
|
11
|
+
name: "eslint-js",
|
|
12
|
+
specifier: "oxlint-plugin-eslint"
|
|
13
|
+
}, {
|
|
14
|
+
name: "slopstopper",
|
|
15
|
+
specifier: "@bastidood/eslint-plugin-slopstopper"
|
|
16
|
+
}],
|
|
17
|
+
categories: {
|
|
18
|
+
correctness: "error",
|
|
19
|
+
perf: "error",
|
|
20
|
+
suspicious: "error"
|
|
21
|
+
},
|
|
22
|
+
options: {
|
|
23
|
+
denyWarnings: true,
|
|
24
|
+
typeAware: true
|
|
25
|
+
},
|
|
26
|
+
overrides: [{
|
|
27
|
+
files: [
|
|
28
|
+
"**/*.js",
|
|
29
|
+
"**/*.mjs",
|
|
30
|
+
"**/*.cjs"
|
|
31
|
+
],
|
|
32
|
+
rules: { "no-unused-vars": ["error", {
|
|
33
|
+
argsIgnorePattern: "^_",
|
|
34
|
+
varsIgnorePattern: "^_"
|
|
35
|
+
}] }
|
|
36
|
+
}],
|
|
37
|
+
rules: {
|
|
38
|
+
"accessor-pairs": ["error", { enforceForTSTypes: true }],
|
|
39
|
+
"array-callback-return": ["error", { checkForEach: true }],
|
|
40
|
+
"arrow-body-style": "error",
|
|
41
|
+
"block-scoped-var": "error",
|
|
42
|
+
"capitalized-comments": [
|
|
43
|
+
"error",
|
|
44
|
+
"always",
|
|
45
|
+
{ ignoreConsecutiveComments: true }
|
|
46
|
+
],
|
|
47
|
+
"class-methods-use-this": "error",
|
|
48
|
+
complexity: "off",
|
|
49
|
+
"constructor-super": "off",
|
|
50
|
+
curly: [
|
|
51
|
+
"error",
|
|
52
|
+
"multi-line",
|
|
53
|
+
"consistent"
|
|
54
|
+
],
|
|
55
|
+
"default-case-last": "error",
|
|
56
|
+
"default-param-last": "error",
|
|
57
|
+
eqeqeq: "error",
|
|
58
|
+
"eslint-js/no-octal-escape": "error",
|
|
59
|
+
"eslint-js/no-undef-init": "error",
|
|
60
|
+
"eslint-js/require-atomic-updates": "error",
|
|
61
|
+
"for-direction": "error",
|
|
62
|
+
"func-name-matching": "off",
|
|
63
|
+
"func-names": ["error", "as-needed"],
|
|
64
|
+
"func-style": ["error", "declaration"],
|
|
65
|
+
"getter-return": "off",
|
|
66
|
+
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
67
|
+
"guard-for-in": "error",
|
|
68
|
+
"id-denylist": "off",
|
|
69
|
+
"id-length": "off",
|
|
70
|
+
"id-match": "off",
|
|
71
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level-if-only-type-imports"],
|
|
72
|
+
"import/default": "off",
|
|
73
|
+
"import/exports-last": "off",
|
|
74
|
+
"import/first": "error",
|
|
75
|
+
"import/group-exports": "off",
|
|
76
|
+
"import/max-dependencies": "off",
|
|
77
|
+
"import/namespace": "off",
|
|
78
|
+
"import/newline-after-import": "error",
|
|
79
|
+
"import/no-absolute-path": "error",
|
|
80
|
+
"import/no-amd": "error",
|
|
81
|
+
"import/no-anonymous-default-export": "error",
|
|
82
|
+
"import/no-commonjs": "error",
|
|
83
|
+
"import/no-cycle": "error",
|
|
84
|
+
"import/no-default-export": "off",
|
|
85
|
+
"import/no-dynamic-require": "error",
|
|
86
|
+
"import/no-empty-named-blocks": "error",
|
|
87
|
+
"import/no-mutable-exports": "error",
|
|
88
|
+
"import/no-named-as-default": "error",
|
|
89
|
+
"import/no-named-as-default-member": "error",
|
|
90
|
+
"import/no-named-default": "error",
|
|
91
|
+
"import/no-named-export": "off",
|
|
92
|
+
"import/no-namespace": "off",
|
|
93
|
+
"import/no-nodejs-modules": "off",
|
|
94
|
+
"import/no-self-import": "error",
|
|
95
|
+
"import/no-unassigned-import": "off",
|
|
96
|
+
"import/no-webpack-loader-syntax": "error",
|
|
97
|
+
"import/prefer-default-export": "off",
|
|
98
|
+
"init-declarations": "off",
|
|
99
|
+
"logical-assignment-operators": "error",
|
|
100
|
+
"max-classes-per-file": "off",
|
|
101
|
+
"max-lines": "off",
|
|
102
|
+
"max-lines-per-function": "off",
|
|
103
|
+
"max-nested-callbacks": "off",
|
|
104
|
+
"max-params": "off",
|
|
105
|
+
"max-statements": "off",
|
|
106
|
+
"new-cap": "error",
|
|
107
|
+
"no-alert": "error",
|
|
108
|
+
"no-array-constructor": "error",
|
|
109
|
+
"no-async-promise-executor": "error",
|
|
110
|
+
"no-await-in-loop": "error",
|
|
111
|
+
"no-bitwise": "error",
|
|
112
|
+
"no-caller": "error",
|
|
113
|
+
"no-case-declarations": "error",
|
|
114
|
+
"no-class-assign": "off",
|
|
115
|
+
"no-compare-neg-zero": "error",
|
|
116
|
+
"no-cond-assign": "error",
|
|
117
|
+
"no-console": "error",
|
|
118
|
+
"no-const-assign": "off",
|
|
119
|
+
"no-constant-binary-expression": "error",
|
|
120
|
+
"no-constant-condition": ["error", { checkLoops: "allExceptWhileTrue" }],
|
|
121
|
+
"no-constructor-return": "error",
|
|
122
|
+
"no-continue": "off",
|
|
123
|
+
"no-control-regex": "error",
|
|
124
|
+
"no-debugger": "error",
|
|
125
|
+
"no-delete-var": "off",
|
|
126
|
+
"no-div-regex": "error",
|
|
127
|
+
"no-dupe-class-members": "off",
|
|
128
|
+
"no-dupe-else-if": "error",
|
|
129
|
+
"no-dupe-keys": "off",
|
|
130
|
+
"no-duplicate-case": "error",
|
|
131
|
+
"no-duplicate-imports": "error",
|
|
132
|
+
"no-else-return": "error",
|
|
133
|
+
"no-empty": "error",
|
|
134
|
+
"no-empty-character-class": "error",
|
|
135
|
+
"no-empty-function": "error",
|
|
136
|
+
"no-empty-pattern": "error",
|
|
137
|
+
"no-empty-static-block": "error",
|
|
138
|
+
"no-eq-null": "error",
|
|
139
|
+
"no-eval": "error",
|
|
140
|
+
"no-ex-assign": "error",
|
|
141
|
+
"no-extend-native": "error",
|
|
142
|
+
"no-extra-bind": "error",
|
|
143
|
+
"no-extra-boolean-cast": "error",
|
|
144
|
+
"no-extra-label": "error",
|
|
145
|
+
"no-fallthrough": "error",
|
|
146
|
+
"no-func-assign": "off",
|
|
147
|
+
"no-global-assign": "error",
|
|
148
|
+
"no-implicit-coercion": "error",
|
|
149
|
+
"no-implicit-globals": "error",
|
|
150
|
+
"no-implied-eval": "off",
|
|
151
|
+
"no-import-assign": "off",
|
|
152
|
+
"no-inline-comments": "off",
|
|
153
|
+
"no-inner-declarations": "off",
|
|
154
|
+
"no-invalid-regexp": "error",
|
|
155
|
+
"no-irregular-whitespace": "error",
|
|
156
|
+
"no-iterator": "error",
|
|
157
|
+
"no-label-var": "error",
|
|
158
|
+
"no-labels": "error",
|
|
159
|
+
"no-lone-blocks": "error",
|
|
160
|
+
"no-lonely-if": "error",
|
|
161
|
+
"no-loop-func": "error",
|
|
162
|
+
"no-loss-of-precision": "error",
|
|
163
|
+
"no-magic-numbers": "off",
|
|
164
|
+
"no-misleading-character-class": "error",
|
|
165
|
+
"no-multi-assign": "error",
|
|
166
|
+
"no-multi-str": "error",
|
|
167
|
+
"no-negated-condition": "error",
|
|
168
|
+
"no-nested-ternary": "error",
|
|
169
|
+
"no-new": "error",
|
|
170
|
+
"no-new-func": "error",
|
|
171
|
+
"no-new-native-nonconstructor": "off",
|
|
172
|
+
"no-new-wrappers": "error",
|
|
173
|
+
"no-nonoctal-decimal-escape": "error",
|
|
174
|
+
"no-obj-calls": "off",
|
|
175
|
+
"no-object-constructor": "error",
|
|
176
|
+
"no-param-reassign": "error",
|
|
177
|
+
"no-plusplus": "off",
|
|
178
|
+
"no-promise-executor-return": "error",
|
|
179
|
+
"no-proto": "error",
|
|
180
|
+
"no-prototype-builtins": "error",
|
|
181
|
+
"no-regex-spaces": "error",
|
|
182
|
+
"no-restricted-exports": "off",
|
|
183
|
+
"no-return-assign": "error",
|
|
184
|
+
"no-script-url": "error",
|
|
185
|
+
"no-self-assign": "error",
|
|
186
|
+
"no-self-compare": "error",
|
|
187
|
+
"no-sequences": "error",
|
|
188
|
+
"no-setter-return": "off",
|
|
189
|
+
"no-shadow": "off",
|
|
190
|
+
"no-shadow-restricted-names": "error",
|
|
191
|
+
"no-sparse-arrays": "error",
|
|
192
|
+
"no-template-curly-in-string": "error",
|
|
193
|
+
"no-ternary": "off",
|
|
194
|
+
"no-this-before-super": "off",
|
|
195
|
+
"no-unassigned-vars": "error",
|
|
196
|
+
"no-underscore-dangle": ["error", {
|
|
197
|
+
enforceInMethodNames: true,
|
|
198
|
+
enforceInClassFields: true
|
|
199
|
+
}],
|
|
200
|
+
"no-unexpected-multiline": "error",
|
|
201
|
+
"no-unmodified-loop-condition": "error",
|
|
202
|
+
"no-unneeded-ternary": "error",
|
|
203
|
+
"no-unreachable": "off",
|
|
204
|
+
"no-unreachable-loop": "error",
|
|
205
|
+
"no-unsafe-finally": "error",
|
|
206
|
+
"no-unsafe-negation": "off",
|
|
207
|
+
"no-unsafe-optional-chaining": "off",
|
|
208
|
+
"no-unused-expressions": "error",
|
|
209
|
+
"no-unused-labels": "off",
|
|
210
|
+
"no-unused-private-class-members": "off",
|
|
211
|
+
"no-unused-vars": "off",
|
|
212
|
+
"no-use-before-define": "off",
|
|
213
|
+
"no-useless-assignment": "error",
|
|
214
|
+
"no-useless-backreference": "error",
|
|
215
|
+
"no-useless-call": "error",
|
|
216
|
+
"no-useless-catch": "error",
|
|
217
|
+
"no-useless-computed-key": "error",
|
|
218
|
+
"no-useless-concat": "error",
|
|
219
|
+
"no-useless-constructor": "error",
|
|
220
|
+
"no-useless-escape": "error",
|
|
221
|
+
"no-useless-rename": "error",
|
|
222
|
+
"no-useless-return": "error",
|
|
223
|
+
"no-var": "error",
|
|
224
|
+
"no-void": "off",
|
|
225
|
+
"no-warning-comments": "off",
|
|
226
|
+
"no-with": "off",
|
|
227
|
+
"object-shorthand": [
|
|
228
|
+
"error",
|
|
229
|
+
"always",
|
|
230
|
+
{ avoidExplicitReturnArrows: true }
|
|
231
|
+
],
|
|
232
|
+
"one-var": ["error", "never"],
|
|
233
|
+
"operator-assignment": "error",
|
|
234
|
+
"oxc/approx-constant": "error",
|
|
235
|
+
"oxc/bad-array-method-on-arguments": "error",
|
|
236
|
+
"oxc/bad-bitwise-operator": "error",
|
|
237
|
+
"oxc/bad-char-at-comparison": "error",
|
|
238
|
+
"oxc/bad-comparison-sequence": "error",
|
|
239
|
+
"oxc/bad-match-all-arg": "error",
|
|
240
|
+
"oxc/bad-min-max-func": "error",
|
|
241
|
+
"oxc/bad-object-literal-comparison": "error",
|
|
242
|
+
"oxc/bad-replace-all-arg": "error",
|
|
243
|
+
"oxc/branches-sharing-code": "error",
|
|
244
|
+
"oxc/const-comparisons": "error",
|
|
245
|
+
"oxc/double-comparisons": "error",
|
|
246
|
+
"oxc/erasing-op": "error",
|
|
247
|
+
"oxc/misrefactored-assign-op": "error",
|
|
248
|
+
"oxc/missing-throw": "error",
|
|
249
|
+
"oxc/no-accumulating-spread": "error",
|
|
250
|
+
"oxc/no-async-endpoint-handlers": "off",
|
|
251
|
+
"oxc/no-barrel-file": ["error", { threshold: 0 }],
|
|
252
|
+
"oxc/no-const-enum": "error",
|
|
253
|
+
"oxc/no-map-spread": ["error", {
|
|
254
|
+
ignoreArgs: false,
|
|
255
|
+
ignoreRereads: false
|
|
256
|
+
}],
|
|
257
|
+
"oxc/no-this-in-exported-function": "off",
|
|
258
|
+
"oxc/number-arg-out-of-range": "error",
|
|
259
|
+
"oxc/only-used-in-recursion": "error",
|
|
260
|
+
"oxc/uninvoked-array-callback": "error",
|
|
261
|
+
"prefer-arrow-callback": "error",
|
|
262
|
+
"prefer-const": "error",
|
|
263
|
+
"prefer-destructuring": "error",
|
|
264
|
+
"prefer-exponentiation-operator": "error",
|
|
265
|
+
"prefer-named-capture-group": "error",
|
|
266
|
+
"prefer-numeric-literals": "error",
|
|
267
|
+
"prefer-object-has-own": "error",
|
|
268
|
+
"prefer-object-spread": "error",
|
|
269
|
+
"prefer-regex-literals": "error",
|
|
270
|
+
"prefer-rest-params": "error",
|
|
271
|
+
"prefer-spread": "error",
|
|
272
|
+
"prefer-template": "error",
|
|
273
|
+
"preserve-caught-error": "error",
|
|
274
|
+
radix: "error",
|
|
275
|
+
"require-unicode-regexp": "error",
|
|
276
|
+
"require-yield": "error",
|
|
277
|
+
"slopstopper/destructure-on-sight": "error",
|
|
278
|
+
"slopstopper/handle-or-rethrow": "error",
|
|
279
|
+
"slopstopper/merge-exclusive-branches": "error",
|
|
280
|
+
"slopstopper/needless-type-intersection": "error",
|
|
281
|
+
"slopstopper/no-alias-object-type": "error",
|
|
282
|
+
"slopstopper/no-array-filter-map": "error",
|
|
283
|
+
"slopstopper/no-conditional-empty-object-spread": "error",
|
|
284
|
+
"slopstopper/no-equality-chain": "error",
|
|
285
|
+
"slopstopper/no-inferrable-return-type": "error",
|
|
286
|
+
"slopstopper/no-known-value-widening": "error",
|
|
287
|
+
"slopstopper/no-multiple-optional-parameters": "error",
|
|
288
|
+
"slopstopper/no-negated-group": "error",
|
|
289
|
+
"slopstopper/no-negated-quantifier-callback": "error",
|
|
290
|
+
"slopstopper/no-plain-template-literal": "error",
|
|
291
|
+
"slopstopper/no-positional-scalars": "error",
|
|
292
|
+
"slopstopper/no-private-modifier": "error",
|
|
293
|
+
"slopstopper/no-reduce-accumulator-copy": "error",
|
|
294
|
+
"slopstopper/no-temporary-access": "error",
|
|
295
|
+
"slopstopper/no-type-predicates": "error",
|
|
296
|
+
"slopstopper/no-unknown-returns": "error",
|
|
297
|
+
"slopstopper/no-unknown-type-aliases": "error",
|
|
298
|
+
"slopstopper/no-unsafe-dictionary-type": "error",
|
|
299
|
+
"slopstopper/no-untyped-empty-initializer": "error",
|
|
300
|
+
"slopstopper/prefer-class-over-factory": "error",
|
|
301
|
+
"slopstopper/prefer-de-morgan": "error",
|
|
302
|
+
"slopstopper/prefer-prefix-increment": "error",
|
|
303
|
+
"slopstopper/prefer-switch": "error",
|
|
304
|
+
"slopstopper/prefer-typeof-undefined": "error",
|
|
305
|
+
"slopstopper/prefer-while-true": "error",
|
|
306
|
+
"slopstopper/stepdown-order": "error",
|
|
307
|
+
"sort-keys": "off",
|
|
308
|
+
"symbol-description": "error",
|
|
309
|
+
"typescript/adjacent-overload-signatures": "error",
|
|
310
|
+
"typescript/array-type": "error",
|
|
311
|
+
"typescript/await-thenable": "error",
|
|
312
|
+
"typescript/ban-ts-comment": ["error", { minimumDescriptionLength: 10 }],
|
|
313
|
+
"typescript/ban-tslint-comment": "error",
|
|
314
|
+
"typescript/class-literal-property-style": "error",
|
|
315
|
+
"typescript/consistent-generic-constructors": "error",
|
|
316
|
+
"typescript/consistent-indexed-object-style": "error",
|
|
317
|
+
"typescript/consistent-return": "off",
|
|
318
|
+
"typescript/consistent-type-assertions": "error",
|
|
319
|
+
"typescript/consistent-type-definitions": ["error", "interface"],
|
|
320
|
+
"typescript/dot-notation": "error",
|
|
321
|
+
"typescript/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
|
|
322
|
+
"typescript/init-declarations": "off",
|
|
323
|
+
"typescript/method-signature-style": "error",
|
|
324
|
+
"typescript/no-array-delete": "error",
|
|
325
|
+
"typescript/no-base-to-string": ["error", {
|
|
326
|
+
checkUnknown: true,
|
|
327
|
+
ignoredTypeNames: []
|
|
328
|
+
}],
|
|
329
|
+
"typescript/no-confusing-non-null-assertion": "error",
|
|
330
|
+
"typescript/no-confusing-void-expression": "off",
|
|
331
|
+
"typescript/no-deprecated": "error",
|
|
332
|
+
"typescript/no-duplicate-enum-values": "error",
|
|
333
|
+
"typescript/no-duplicate-type-constituents": "error",
|
|
334
|
+
"typescript/no-dynamic-delete": "error",
|
|
335
|
+
"typescript/no-empty-object-type": "error",
|
|
336
|
+
"typescript/no-explicit-any": "error",
|
|
337
|
+
"typescript/no-extra-non-null-assertion": "error",
|
|
338
|
+
"typescript/no-extraneous-class": "error",
|
|
339
|
+
"typescript/no-floating-promises": ["error", { ignoreVoid: false }],
|
|
340
|
+
"typescript/no-for-in-array": "error",
|
|
341
|
+
"typescript/no-generated-empty-object-type": "error",
|
|
342
|
+
"typescript/no-implied-eval": "error",
|
|
343
|
+
"typescript/no-import-type-side-effects": "error",
|
|
344
|
+
"typescript/no-inferrable-types": "error",
|
|
345
|
+
"typescript/no-invalid-void-type": "error",
|
|
346
|
+
"typescript/no-meaningless-void-operator": "error",
|
|
347
|
+
"typescript/no-misused-new": "error",
|
|
348
|
+
"typescript/no-misused-promises": "error",
|
|
349
|
+
"typescript/no-misused-spread": "error",
|
|
350
|
+
"typescript/no-mixed-enums": "error",
|
|
351
|
+
"typescript/no-namespace": "error",
|
|
352
|
+
"typescript/no-non-null-asserted-nullish-coalescing": "error",
|
|
353
|
+
"typescript/no-non-null-asserted-optional-chain": "error",
|
|
354
|
+
"typescript/no-non-null-assertion": "error",
|
|
355
|
+
"typescript/no-redundant-type-constituents": "error",
|
|
356
|
+
"typescript/no-require-imports": "error",
|
|
357
|
+
"typescript/no-restricted-types": ["error", { types: {
|
|
358
|
+
object: "Use a precise `interface` contract instead of `object`; accept `unknown` only at an untrusted boundary and parse it into a trusted type there.",
|
|
359
|
+
"Record<string, unknown>": "Do not use `Record<string, unknown>`: it is a variant of `any`. Declare a precise `interface`, or accept `unknown` only at an untrusted boundary and parse it into a trusted type there."
|
|
360
|
+
} }],
|
|
361
|
+
"typescript/no-this-alias": "error",
|
|
362
|
+
"typescript/no-unnecessary-boolean-literal-compare": "error",
|
|
363
|
+
"typescript/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
|
|
364
|
+
"typescript/no-unnecessary-parameter-property-assignment": "off",
|
|
365
|
+
"typescript/no-unnecessary-template-expression": "error",
|
|
366
|
+
"typescript/no-unnecessary-type-arguments": "error",
|
|
367
|
+
"typescript/no-unnecessary-type-assertion": "error",
|
|
368
|
+
"typescript/no-unnecessary-type-constraint": "error",
|
|
369
|
+
"typescript/no-unnecessary-type-conversion": "error",
|
|
370
|
+
"typescript/no-unnecessary-type-parameters": "error",
|
|
371
|
+
"typescript/no-unsafe-argument": "error",
|
|
372
|
+
"typescript/no-unsafe-assignment": "error",
|
|
373
|
+
"typescript/no-unsafe-call": "error",
|
|
374
|
+
"typescript/no-unsafe-declaration-merging": "error",
|
|
375
|
+
"typescript/no-unsafe-enum-assignment": "error",
|
|
376
|
+
"typescript/no-unsafe-enum-comparison": "error",
|
|
377
|
+
"typescript/no-unsafe-function-type": "error",
|
|
378
|
+
"typescript/no-unsafe-member-access": "error",
|
|
379
|
+
"typescript/no-unsafe-return": "error",
|
|
380
|
+
"typescript/no-unsafe-type-assertion": "error",
|
|
381
|
+
"typescript/no-unsafe-unary-minus": "error",
|
|
382
|
+
"typescript/no-useless-default-assignment": "error",
|
|
383
|
+
"typescript/no-useless-empty-export": "error",
|
|
384
|
+
"typescript/no-wrapper-object-types": "error",
|
|
385
|
+
"typescript/non-nullable-type-assertion-style": "error",
|
|
386
|
+
"typescript/only-throw-error": "error",
|
|
387
|
+
"typescript/parameter-properties": ["error", { prefer: "class-property" }],
|
|
388
|
+
"typescript/prefer-as-const": "error",
|
|
389
|
+
"typescript/prefer-enum-initializers": "off",
|
|
390
|
+
"typescript/prefer-find": "error",
|
|
391
|
+
"typescript/prefer-for-of": "error",
|
|
392
|
+
"typescript/prefer-function-type": "error",
|
|
393
|
+
"typescript/prefer-includes": "error",
|
|
394
|
+
"typescript/prefer-literal-enum-member": "error",
|
|
395
|
+
"typescript/prefer-namespace-keyword": "error",
|
|
396
|
+
"typescript/prefer-nullish-coalescing": ["error", { ignorePrimitives: { string: true } }],
|
|
397
|
+
"typescript/prefer-optional-chain": "error",
|
|
398
|
+
"typescript/prefer-promise-reject-errors": "error",
|
|
399
|
+
"typescript/prefer-readonly": "error",
|
|
400
|
+
"typescript/prefer-reduce-type-parameter": "error",
|
|
401
|
+
"typescript/prefer-regexp-exec": "error",
|
|
402
|
+
"typescript/prefer-return-this-type": "error",
|
|
403
|
+
"typescript/prefer-string-starts-ends-with": "error",
|
|
404
|
+
"typescript/promise-function-async": "error",
|
|
405
|
+
"typescript/related-getter-setter-pairs": "error",
|
|
406
|
+
"typescript/require-array-sort-compare": "error",
|
|
407
|
+
"typescript/require-await": "error",
|
|
408
|
+
"typescript/restrict-plus-operands": ["error", {
|
|
409
|
+
allowAny: false,
|
|
410
|
+
allowBoolean: false,
|
|
411
|
+
allowNullish: false,
|
|
412
|
+
allowNumberAndString: false,
|
|
413
|
+
allowRegExp: false
|
|
414
|
+
}],
|
|
415
|
+
"typescript/restrict-template-expressions": ["error", {
|
|
416
|
+
allow: [],
|
|
417
|
+
allowAny: false,
|
|
418
|
+
allowBoolean: true,
|
|
419
|
+
allowNever: false,
|
|
420
|
+
allowNullish: false,
|
|
421
|
+
allowNumber: true,
|
|
422
|
+
allowRegExp: false
|
|
423
|
+
}],
|
|
424
|
+
"typescript/return-await": ["error", "always"],
|
|
425
|
+
"typescript/strict-boolean-expressions": ["error", {
|
|
426
|
+
allowNullableObject: false,
|
|
427
|
+
allowNullableNumber: false,
|
|
428
|
+
allowNullableString: false,
|
|
429
|
+
allowNumber: false,
|
|
430
|
+
allowString: false
|
|
431
|
+
}],
|
|
432
|
+
"typescript/strict-void-return": "error",
|
|
433
|
+
"typescript/switch-exhaustiveness-check": ["error", {
|
|
434
|
+
allowDefaultCaseForExhaustiveSwitch: false,
|
|
435
|
+
considerDefaultExhaustiveForUnions: false,
|
|
436
|
+
requireDefaultForNonUnion: false
|
|
437
|
+
}],
|
|
438
|
+
"typescript/triple-slash-reference": "error",
|
|
439
|
+
"typescript/unbound-method": "error",
|
|
440
|
+
"typescript/unified-signatures": "error",
|
|
441
|
+
"typescript/use-unknown-in-catch-callback-variable": "error",
|
|
442
|
+
"unicode-bom": "off",
|
|
443
|
+
"use-isnan": "off",
|
|
444
|
+
"valid-typeof": "off",
|
|
445
|
+
yoda: [
|
|
446
|
+
"error",
|
|
447
|
+
"never",
|
|
448
|
+
{ exceptRange: true }
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
restrictions: {
|
|
453
|
+
importPatterns: [{
|
|
454
|
+
regex: String.raw`(^|/)\.\.(?:/|$)`,
|
|
455
|
+
message: "Import through a path alias or package subpath import instead of a parent-relative path (`../`)."
|
|
456
|
+
}],
|
|
457
|
+
globals: [{
|
|
458
|
+
name: "Reflect",
|
|
459
|
+
message: "Call typed functions and read typed properties directly instead of through `Reflect`, and parse dynamic input into a domain type first. Suppress this diagnostic with a reason only where a typed access is impossible."
|
|
460
|
+
}, {
|
|
461
|
+
name: "undefined",
|
|
462
|
+
message: "Omit absent values instead of writing `undefined`: add the property in an `if` after declaring the object (as `exactOptionalPropertyTypes` requires) or leave out the argument, and use a `typeof` check to test for absence. Pass `void 0` only to a parameter that cannot be omitted and is explicitly typed to accept `undefined`."
|
|
463
|
+
}],
|
|
464
|
+
properties: [{
|
|
465
|
+
object: "process",
|
|
466
|
+
property: "env",
|
|
467
|
+
message: "Read environment variables only in the entry point: validate them there and pass the values as explicit parameters. Opt the entry point out with a file-level disable comment."
|
|
468
|
+
}],
|
|
469
|
+
syntax: [{
|
|
470
|
+
selector: "UnaryExpression[operator=\"void\"][argument.type=\"Literal\"]:not(:matches(CallExpression, NewExpression) > UnaryExpression.arguments)",
|
|
471
|
+
message: "Do not write `void 0` to produce `undefined`: omit the absent value by conditionally inserting the property (as `exactOptionalPropertyTypes` requires). `void 0` is allowed only as an argument to a parameter that cannot be omitted and is explicitly typed to accept `undefined`."
|
|
472
|
+
}]
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
export { CORE as t };
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE$1 } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, r as writeExtensionRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import SLOPSTOPPER from "@bastidood/eslint-plugin-slopstopper";
|
|
3
4
|
import { importX } from "eslint-plugin-import-x";
|
|
4
5
|
import tseslint from "typescript-eslint";
|
package/dist/jsdoc.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
3
4
|
// ../oxlint/src/jsdoc.ts
|
|
4
5
|
const JSDOC$1 = { config: {
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import nodePlugin from "eslint-plugin-n";
|
|
3
4
|
// ../oxlint/src/node.ts
|
|
4
5
|
/** Node.js rules for code that runs on Node.js. */
|
package/dist/promise.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import promisePlugin from "eslint-plugin-promise";
|
|
3
4
|
// ../oxlint/src/promise.ts
|
|
4
5
|
const PROMISE$1 = { config: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { n as writeEslintRules } from "../convert-BXtGAZpc.mjs";
|
|
2
|
+
// ../oxlint/src/tanstack/query.ts
|
|
3
|
+
/** TanStack Query rules that apply to every framework adapter. */
|
|
4
|
+
const TANSTACK_QUERY$1 = { config: {
|
|
5
|
+
jsPlugins: [{
|
|
6
|
+
name: "slopstopper",
|
|
7
|
+
specifier: "@bastidood/eslint-plugin-slopstopper"
|
|
8
|
+
}],
|
|
9
|
+
rules: {
|
|
10
|
+
"slopstopper/no-defaulted-query-key": "error",
|
|
11
|
+
"slopstopper/no-mutate-callback-cache-update": "error",
|
|
12
|
+
"slopstopper/no-standalone-mutate-async": "error",
|
|
13
|
+
"slopstopper/prefer-query-key-context": "error"
|
|
14
|
+
}
|
|
15
|
+
} };
|
|
16
|
+
// src/tanstack/query.ts
|
|
17
|
+
const RULES = {};
|
|
18
|
+
writeEslintRules(RULES, TANSTACK_QUERY$1.config.rules);
|
|
19
|
+
/** TanStack Query rules for every framework adapter, generated from the Oxlint `tanstack/query` entry point. */
|
|
20
|
+
const TANSTACK_QUERY = { configs: [{
|
|
21
|
+
name: "@bastidood/eslint-config/tanstack/query",
|
|
22
|
+
rules: RULES
|
|
23
|
+
}] };
|
|
24
|
+
export { TANSTACK_QUERY };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { n as writeEslintRules } from "../convert-BXtGAZpc.mjs";
|
|
2
|
+
// ../oxlint/src/tanstack/table.ts
|
|
3
|
+
const STOCK_FEATURES_MESSAGE = "Register only the features that this table uses in `tableFeatures({...})`. `stockFeatures` hides which features the table depends on and keeps every unused feature in the bundle. Do not suppress this.";
|
|
4
|
+
const RAW_TEMPLATE_MESSAGE = "Render through `FlexRender` with `cell`, `header`, or `footer` instead of reading the column template. For cells, it renders `aggregatedCell` and skips placeholders, and calling a template directly runs its hooks in the calling component. For a column label, use `column.id` or a label map.";
|
|
5
|
+
/** TanStack Table rules that apply to every framework adapter. */
|
|
6
|
+
const TANSTACK_TABLE$1 = {
|
|
7
|
+
config: {
|
|
8
|
+
jsPlugins: [{
|
|
9
|
+
name: "slopstopper",
|
|
10
|
+
specifier: "@bastidood/eslint-plugin-slopstopper"
|
|
11
|
+
}],
|
|
12
|
+
rules: {
|
|
13
|
+
"slopstopper/no-render-scoped-table-schema": "error",
|
|
14
|
+
"slopstopper/prefer-table-atoms": "error",
|
|
15
|
+
"slopstopper/require-exclusive-indeterminate": "error",
|
|
16
|
+
"slopstopper/require-table-state-pairs": "error"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
restrictions: {
|
|
20
|
+
importPaths: [
|
|
21
|
+
{
|
|
22
|
+
name: "@tanstack/table-core",
|
|
23
|
+
importNames: ["stockFeatures"],
|
|
24
|
+
message: STOCK_FEATURES_MESSAGE
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "@tanstack/react-table",
|
|
28
|
+
importNames: ["stockFeatures"],
|
|
29
|
+
message: STOCK_FEATURES_MESSAGE
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "@tanstack/svelte-table",
|
|
33
|
+
importNames: ["stockFeatures"],
|
|
34
|
+
message: STOCK_FEATURES_MESSAGE
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
syntax: [
|
|
38
|
+
{
|
|
39
|
+
selector: "MemberExpression[property.name=/^(?:cell|header|footer|aggregatedCell)$/]:matches([object.name=\"columnDef\"], [object.property.name=\"columnDef\"])",
|
|
40
|
+
message: RAW_TEMPLATE_MESSAGE
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
selector: "VariableDeclarator:matches([init.name=\"columnDef\"], [init.property.name=\"columnDef\"]) > ObjectPattern > Property[key.name=/^(?:cell|header|footer|aggregatedCell)$/]",
|
|
44
|
+
message: RAW_TEMPLATE_MESSAGE
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
selector: "Property[key.name=\"columnDef\"] > ObjectPattern > Property[key.name=/^(?:cell|header|footer|aggregatedCell)$/]",
|
|
48
|
+
message: RAW_TEMPLATE_MESSAGE
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
// src/tanstack/table.ts
|
|
54
|
+
const RULES = {};
|
|
55
|
+
writeEslintRules(RULES, TANSTACK_TABLE$1.config.rules);
|
|
56
|
+
/** TanStack Table rules for every framework adapter, generated from the Oxlint `tanstack/table` entry point. */
|
|
57
|
+
const TANSTACK_TABLE = {
|
|
58
|
+
configs: [{
|
|
59
|
+
name: "@bastidood/eslint-config/tanstack/table",
|
|
60
|
+
rules: RULES
|
|
61
|
+
}],
|
|
62
|
+
restrictions: TANSTACK_TABLE$1.restrictions
|
|
63
|
+
};
|
|
64
|
+
export { TANSTACK_TABLE };
|
package/dist/unicorn.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import unicornPlugin from "eslint-plugin-unicorn";
|
|
3
4
|
// ../oxlint/src/unicorn.ts
|
|
4
5
|
const UNICORN$1 = { config: {
|
package/dist/vitest.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as CORE } from "./core-NeXMRUpu.mjs";
|
|
2
|
+
import { n as writeEslintRules, t as writeCategoryRules } from "./convert-BXtGAZpc.mjs";
|
|
2
3
|
import vitestPlugin from "@vitest/eslint-plugin";
|
|
3
4
|
// ../oxlint/src/vitest.ts
|
|
4
|
-
/** Steers module mocks toward dependency injection, as honest functions take their external collaborators as parameters. */
|
|
5
5
|
const MODULE_MOCK_MESSAGE = "A module mock swaps out a dependency that the code under test hides. Make the code honest instead: have it take the stateful or external collaborator (a database, network client, file system, or clock) as a parameter, inject the real one from the entry point, and pass a fake in the test. If a mock is unavoidable, suppress this diagnostic with a reason and mock through `import()` so that the path stays type-checked.";
|
|
6
6
|
const VITEST$1 = { config: {
|
|
7
7
|
plugins: ["vitest"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastidood/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Strict baseline ESLint configuration generated from @bastidood/oxlint-config.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/BastiDood/slopstopper",
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"directory": "configs/eslint"
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
|
+
"imports": {
|
|
14
|
+
"#*": "./src/*"
|
|
15
|
+
},
|
|
13
16
|
"exports": {
|
|
14
17
|
".": "./dist/compose/index.mjs",
|
|
15
18
|
"./core": "./dist/core.mjs",
|
|
@@ -17,7 +20,9 @@
|
|
|
17
20
|
"./promise": "./dist/promise.mjs",
|
|
18
21
|
"./node": "./dist/node.mjs",
|
|
19
22
|
"./vitest": "./dist/vitest.mjs",
|
|
20
|
-
"./jsdoc": "./dist/jsdoc.mjs"
|
|
23
|
+
"./jsdoc": "./dist/jsdoc.mjs",
|
|
24
|
+
"./tanstack/query": "./dist/tanstack/query.mjs",
|
|
25
|
+
"./tanstack/table": "./dist/tanstack/table.mjs"
|
|
21
26
|
},
|
|
22
27
|
"files": [
|
|
23
28
|
"dist"
|
|
@@ -26,22 +31,22 @@
|
|
|
26
31
|
"access": "public"
|
|
27
32
|
},
|
|
28
33
|
"dependencies": {
|
|
29
|
-
"@bastidood/eslint-plugin-slopstopper": "^0.
|
|
34
|
+
"@bastidood/eslint-plugin-slopstopper": "^0.4.0",
|
|
30
35
|
"@vitest/eslint-plugin": "^1.6.28",
|
|
31
36
|
"eslint-plugin-import-x": "^4.17.1",
|
|
32
|
-
"eslint-plugin-jsdoc": "^65.4.
|
|
37
|
+
"eslint-plugin-jsdoc": "^65.4.3",
|
|
33
38
|
"eslint-plugin-n": "^18.5.0",
|
|
34
39
|
"eslint-plugin-promise": "^7.3.0",
|
|
35
40
|
"eslint-plugin-unicorn": "^79.0.0",
|
|
36
41
|
"typescript-eslint": "^8.72.1"
|
|
37
42
|
},
|
|
38
43
|
"devDependencies": {
|
|
39
|
-
"@bastidood/oxlint-config": "0.
|
|
44
|
+
"@bastidood/oxlint-config": "0.5.0",
|
|
40
45
|
"@bastidood/tsconfig": "0.1.1",
|
|
41
46
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
42
|
-
"eslint": "^10.
|
|
47
|
+
"eslint": "^10.14.0",
|
|
43
48
|
"eslint-plugin-oxlint": "^1.90.0",
|
|
44
|
-
"tsdown": "^0.23.
|
|
49
|
+
"tsdown": "^0.23.5",
|
|
45
50
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
46
51
|
},
|
|
47
52
|
"peerDependencies": {
|