@standard-config/oxlint 1.9.0 → 2.0.1
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 +122 -17
- package/dist/index.d.mts +57 -19
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +201 -167
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -12
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { defineConfig as defineConfig$1 } from "oxlint";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region src/config-base/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* Base config entry containing core rules. No overrides included.
|
|
6
|
+
*/
|
|
3
7
|
const config = {
|
|
4
8
|
plugins: [
|
|
5
9
|
"eslint",
|
|
@@ -36,16 +40,24 @@ const config = {
|
|
|
36
40
|
"eslint/default-param-last": "error",
|
|
37
41
|
"eslint/eqeqeq": "error",
|
|
38
42
|
"eslint/for-direction": "error",
|
|
43
|
+
"eslint/func-name-matching": [
|
|
44
|
+
"error",
|
|
45
|
+
"never",
|
|
46
|
+
{ considerPropertyDescriptor: true }
|
|
47
|
+
],
|
|
39
48
|
"eslint/func-names": "off",
|
|
40
49
|
"eslint/func-style": [
|
|
41
50
|
"error",
|
|
42
51
|
"declaration",
|
|
43
52
|
{ allowArrowFunctions: true }
|
|
44
53
|
],
|
|
54
|
+
"eslint/getter-return": "error",
|
|
45
55
|
"eslint/grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
46
56
|
"eslint/guard-for-in": "error",
|
|
47
57
|
"eslint/id-length": "off",
|
|
58
|
+
"eslint/id-match": "off",
|
|
48
59
|
"eslint/init-declarations": "off",
|
|
60
|
+
"eslint/logical-assignment-operators": "off",
|
|
49
61
|
"eslint/max-classes-per-file": "off",
|
|
50
62
|
"eslint/max-depth": "off",
|
|
51
63
|
"eslint/max-lines": "off",
|
|
@@ -96,6 +108,8 @@ const config = {
|
|
|
96
108
|
"eslint/no-func-assign": "off",
|
|
97
109
|
"eslint/no-global-assign": "error",
|
|
98
110
|
"eslint/no-implicit-coercion": "error",
|
|
111
|
+
"eslint/no-implicit-globals": "error",
|
|
112
|
+
"eslint/no-implied-eval": "error",
|
|
99
113
|
"eslint/no-import-assign": "off",
|
|
100
114
|
"eslint/no-inline-comments": "off",
|
|
101
115
|
"eslint/no-inner-declarations": "off",
|
|
@@ -128,8 +142,10 @@ const config = {
|
|
|
128
142
|
"eslint/no-prototype-builtins": "off",
|
|
129
143
|
"eslint/no-redeclare": "off",
|
|
130
144
|
"eslint/no-regex-spaces": "error",
|
|
145
|
+
"eslint/no-restricted-exports": "off",
|
|
131
146
|
"eslint/no-restricted-globals": "off",
|
|
132
147
|
"eslint/no-restricted-imports": "off",
|
|
148
|
+
"eslint/no-restricted-properties": "off",
|
|
133
149
|
"eslint/no-return-assign": ["error", "always"],
|
|
134
150
|
"eslint/no-script-url": "off",
|
|
135
151
|
"eslint/no-self-assign": ["error", { props: true }],
|
|
@@ -146,10 +162,11 @@ const config = {
|
|
|
146
162
|
"eslint/no-unassigned-vars": "error",
|
|
147
163
|
"eslint/no-undef": "off",
|
|
148
164
|
"eslint/no-undefined": "off",
|
|
165
|
+
"eslint/no-underscore-dangle": "off",
|
|
149
166
|
"eslint/no-unexpected-multiline": "off",
|
|
150
167
|
"eslint/no-unmodified-loop-condition": "error",
|
|
151
168
|
"eslint/no-unneeded-ternary": "warn",
|
|
152
|
-
"eslint/no-unreachable": "
|
|
169
|
+
"eslint/no-unreachable": "off",
|
|
153
170
|
"eslint/no-unsafe-finally": "error",
|
|
154
171
|
"eslint/no-unsafe-negation": "off",
|
|
155
172
|
"eslint/no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
@@ -163,6 +180,7 @@ const config = {
|
|
|
163
180
|
varsIgnorePattern: "^_"
|
|
164
181
|
}],
|
|
165
182
|
"eslint/no-use-before-define": "off",
|
|
183
|
+
"eslint/no-useless-assignment": "warn",
|
|
166
184
|
"eslint/no-useless-backreference": "error",
|
|
167
185
|
"eslint/no-useless-call": "error",
|
|
168
186
|
"eslint/no-useless-catch": "error",
|
|
@@ -178,19 +196,23 @@ const config = {
|
|
|
178
196
|
"eslint/no-with": "error",
|
|
179
197
|
"eslint/object-shorthand": ["error", "always"],
|
|
180
198
|
"eslint/operator-assignment": ["warn", "always"],
|
|
199
|
+
"eslint/prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
|
|
181
200
|
"eslint/prefer-const": "error",
|
|
182
201
|
"eslint/prefer-destructuring": ["error", { enforceForRenamedProperties: false }],
|
|
183
202
|
"eslint/prefer-exponentiation-operator": "warn",
|
|
203
|
+
"eslint/prefer-named-capture-group": "off",
|
|
184
204
|
"eslint/prefer-numeric-literals": "off",
|
|
185
205
|
"eslint/prefer-object-has-own": "error",
|
|
186
206
|
"eslint/prefer-object-spread": "error",
|
|
187
207
|
"eslint/prefer-promise-reject-errors": "off",
|
|
208
|
+
"eslint/prefer-regex-literals": "warn",
|
|
188
209
|
"eslint/prefer-rest-params": "error",
|
|
189
210
|
"eslint/prefer-spread": "warn",
|
|
190
211
|
"eslint/prefer-template": "error",
|
|
191
212
|
"eslint/preserve-caught-error": "error",
|
|
192
213
|
"eslint/radix": "error",
|
|
193
214
|
"eslint/require-await": "off",
|
|
215
|
+
"eslint/require-unicode-regexp": "off",
|
|
194
216
|
"eslint/require-yield": "error",
|
|
195
217
|
"eslint/sort-imports": "off",
|
|
196
218
|
"eslint/sort-keys": "off",
|
|
@@ -213,6 +235,7 @@ const config = {
|
|
|
213
235
|
"import/group-exports": "off",
|
|
214
236
|
"import/max-dependencies": "off",
|
|
215
237
|
"import/namespace": "error",
|
|
238
|
+
"import/newline-after-import": "error",
|
|
216
239
|
"import/no-absolute-path": "error",
|
|
217
240
|
"import/no-amd": "off",
|
|
218
241
|
"import/no-anonymous-default-export": "error",
|
|
@@ -270,6 +293,7 @@ const config = {
|
|
|
270
293
|
"jest/prefer-each": "off",
|
|
271
294
|
"jest/prefer-ending-with-an-expect": "off",
|
|
272
295
|
"jest/prefer-equality-matcher": "off",
|
|
296
|
+
"jest/prefer-expect-assertions": "off",
|
|
273
297
|
"jest/prefer-expect-resolves": "off",
|
|
274
298
|
"jest/prefer-hooks-in-order": "off",
|
|
275
299
|
"jest/prefer-hooks-on-top": "off",
|
|
@@ -294,6 +318,7 @@ const config = {
|
|
|
294
318
|
"jest/valid-expect": "off",
|
|
295
319
|
"jest/valid-expect-in-promise": "off",
|
|
296
320
|
"jest/valid-title": "off",
|
|
321
|
+
"node/callback-return": "off",
|
|
297
322
|
"node/global-require": "off",
|
|
298
323
|
"node/handle-callback-err": ["error", "error"],
|
|
299
324
|
"node/no-exports-assign": "off",
|
|
@@ -369,7 +394,9 @@ const config = {
|
|
|
369
394
|
}],
|
|
370
395
|
"typescript/dot-notation": "warn",
|
|
371
396
|
"typescript/explicit-function-return-type": "off",
|
|
397
|
+
"typescript/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
|
|
372
398
|
"typescript/explicit-module-boundary-types": ["error", { allowArgumentsExplicitlyTypedAsAny: true }],
|
|
399
|
+
"typescript/method-signature-style": ["error", "property"],
|
|
373
400
|
"typescript/no-array-delete": "off",
|
|
374
401
|
"typescript/no-base-to-string": "error",
|
|
375
402
|
"typescript/no-confusing-non-null-assertion": "error",
|
|
@@ -483,6 +510,7 @@ const config = {
|
|
|
483
510
|
"unicorn/escape-case": "error",
|
|
484
511
|
"unicorn/explicit-length-check": "error",
|
|
485
512
|
"unicorn/filename-case": "off",
|
|
513
|
+
"unicorn/import-style": "off",
|
|
486
514
|
"unicorn/new-for-builtins": "error",
|
|
487
515
|
"unicorn/no-abusive-eslint-disable": "error",
|
|
488
516
|
"unicorn/no-accessor-recursion": "error",
|
|
@@ -507,6 +535,7 @@ const config = {
|
|
|
507
535
|
"unicorn/no-length-as-slice-end": "error",
|
|
508
536
|
"unicorn/no-lonely-if": "warn",
|
|
509
537
|
"unicorn/no-magic-array-flat-depth": "error",
|
|
538
|
+
"unicorn/no-negated-condition": "off",
|
|
510
539
|
"unicorn/no-negation-in-equality-check": "error",
|
|
511
540
|
"unicorn/no-nested-ternary": "error",
|
|
512
541
|
"unicorn/no-new-array": "error",
|
|
@@ -603,31 +632,84 @@ const config = {
|
|
|
603
632
|
"unicorn/throw-new-error": "error",
|
|
604
633
|
"vitest/consistent-each-for": "off",
|
|
605
634
|
"vitest/consistent-test-filename": "off",
|
|
635
|
+
"vitest/consistent-test-it": "off",
|
|
606
636
|
"vitest/consistent-vitest-vi": "off",
|
|
637
|
+
"vitest/expect-expect": "off",
|
|
607
638
|
"vitest/hoisted-apis-on-top": "off",
|
|
639
|
+
"vitest/max-expects": "off",
|
|
640
|
+
"vitest/max-nested-describe": "off",
|
|
641
|
+
"vitest/no-alias-methods": "off",
|
|
642
|
+
"vitest/no-commented-out-tests": "off",
|
|
643
|
+
"vitest/no-conditional-expect": "off",
|
|
644
|
+
"vitest/no-conditional-in-test": "off",
|
|
608
645
|
"vitest/no-conditional-tests": "off",
|
|
646
|
+
"vitest/no-disabled-tests": "off",
|
|
647
|
+
"vitest/no-duplicate-hooks": "off",
|
|
648
|
+
"vitest/no-focused-tests": "off",
|
|
649
|
+
"vitest/no-hooks": "off",
|
|
650
|
+
"vitest/no-identical-title": "off",
|
|
609
651
|
"vitest/no-import-node-test": "off",
|
|
610
652
|
"vitest/no-importing-vitest-globals": "off",
|
|
653
|
+
"vitest/no-interpolation-in-snapshots": "off",
|
|
654
|
+
"vitest/no-large-snapshots": "off",
|
|
655
|
+
"vitest/no-mocks-import": "off",
|
|
656
|
+
"vitest/no-restricted-matchers": "off",
|
|
657
|
+
"vitest/no-restricted-vi-methods": "off",
|
|
658
|
+
"vitest/no-standalone-expect": "off",
|
|
659
|
+
"vitest/no-test-prefixes": "off",
|
|
660
|
+
"vitest/no-test-return-statement": "off",
|
|
661
|
+
"vitest/no-unneeded-async-expect-function": "off",
|
|
662
|
+
"vitest/padding-around-after-all-blocks": "off",
|
|
611
663
|
"vitest/prefer-called-exactly-once-with": "off",
|
|
612
664
|
"vitest/prefer-called-once": "off",
|
|
613
665
|
"vitest/prefer-called-times": "off",
|
|
666
|
+
"vitest/prefer-called-with": "off",
|
|
667
|
+
"vitest/prefer-comparison-matcher": "off",
|
|
614
668
|
"vitest/prefer-describe-function-title": "off",
|
|
669
|
+
"vitest/prefer-each": "off",
|
|
670
|
+
"vitest/prefer-equality-matcher": "off",
|
|
671
|
+
"vitest/prefer-expect-assertions": "off",
|
|
672
|
+
"vitest/prefer-expect-resolves": "off",
|
|
615
673
|
"vitest/prefer-expect-type-of": "off",
|
|
674
|
+
"vitest/prefer-hooks-in-order": "off",
|
|
675
|
+
"vitest/prefer-hooks-on-top": "off",
|
|
616
676
|
"vitest/prefer-import-in-mock": "off",
|
|
617
677
|
"vitest/prefer-importing-vitest-globals": "off",
|
|
678
|
+
"vitest/prefer-lowercase-title": "off",
|
|
679
|
+
"vitest/prefer-mock-promise-shorthand": "off",
|
|
680
|
+
"vitest/prefer-mock-return-shorthand": "off",
|
|
681
|
+
"vitest/prefer-snapshot-hint": "off",
|
|
682
|
+
"vitest/prefer-spy-on": "off",
|
|
618
683
|
"vitest/prefer-strict-boolean-matchers": "off",
|
|
684
|
+
"vitest/prefer-strict-equal": "off",
|
|
685
|
+
"vitest/prefer-to-be": "off",
|
|
619
686
|
"vitest/prefer-to-be-falsy": "off",
|
|
620
687
|
"vitest/prefer-to-be-object": "off",
|
|
621
688
|
"vitest/prefer-to-be-truthy": "off",
|
|
689
|
+
"vitest/prefer-to-contain": "off",
|
|
690
|
+
"vitest/prefer-to-have-been-called-times": "off",
|
|
691
|
+
"vitest/prefer-to-have-length": "off",
|
|
692
|
+
"vitest/prefer-todo": "off",
|
|
622
693
|
"vitest/require-awaited-expect-poll": "off",
|
|
694
|
+
"vitest/require-hook": "off",
|
|
623
695
|
"vitest/require-local-test-context-for-concurrent-snapshots": "off",
|
|
624
696
|
"vitest/require-mock-type-parameters": "off",
|
|
625
697
|
"vitest/require-test-timeout": "off",
|
|
698
|
+
"vitest/require-to-throw-message": "off",
|
|
699
|
+
"vitest/require-top-level-describe": "off",
|
|
700
|
+
"vitest/valid-describe-callback": "off",
|
|
701
|
+
"vitest/valid-expect": "off",
|
|
702
|
+
"vitest/valid-expect-in-promise": "off",
|
|
703
|
+
"vitest/valid-title": "off",
|
|
626
704
|
"vitest/warn-todo": "off"
|
|
627
705
|
}
|
|
628
706
|
};
|
|
629
707
|
//#endregion
|
|
630
708
|
//#region src/config-config-files/index.ts
|
|
709
|
+
/**
|
|
710
|
+
* Optional config entry containing core rules that target config files.
|
|
711
|
+
* Intended for explicit overrides.
|
|
712
|
+
*/
|
|
631
713
|
const config$1 = { rules: {
|
|
632
714
|
"import/no-anonymous-default-export": ["error", { allowObject: true }],
|
|
633
715
|
"import/no-unassigned-import": "off",
|
|
@@ -636,144 +718,10 @@ const config$1 = { rules: {
|
|
|
636
718
|
"unicorn/no-empty-file": "off"
|
|
637
719
|
} };
|
|
638
720
|
//#endregion
|
|
639
|
-
//#region ../
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
"react",
|
|
644
|
-
"react-perf"
|
|
645
|
-
],
|
|
646
|
-
rules: {
|
|
647
|
-
"jsx-a11y/alt-text": "error",
|
|
648
|
-
"jsx-a11y/anchor-ambiguous-text": "error",
|
|
649
|
-
"jsx-a11y/anchor-has-content": "error",
|
|
650
|
-
"jsx-a11y/anchor-is-valid": "error",
|
|
651
|
-
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
652
|
-
"jsx-a11y/aria-props": "error",
|
|
653
|
-
"jsx-a11y/aria-proptypes": "error",
|
|
654
|
-
"jsx-a11y/aria-role": "error",
|
|
655
|
-
"jsx-a11y/aria-unsupported-elements": "error",
|
|
656
|
-
"jsx-a11y/autocomplete-valid": "error",
|
|
657
|
-
"jsx-a11y/click-events-have-key-events": "warn",
|
|
658
|
-
"jsx-a11y/heading-has-content": "error",
|
|
659
|
-
"jsx-a11y/html-has-lang": "error",
|
|
660
|
-
"jsx-a11y/iframe-has-title": "error",
|
|
661
|
-
"jsx-a11y/img-redundant-alt": "off",
|
|
662
|
-
"jsx-a11y/label-has-associated-control": "error",
|
|
663
|
-
"jsx-a11y/lang": "error",
|
|
664
|
-
"jsx-a11y/media-has-caption": "off",
|
|
665
|
-
"jsx-a11y/mouse-events-have-key-events": "warn",
|
|
666
|
-
"jsx-a11y/no-access-key": "error",
|
|
667
|
-
"jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
668
|
-
"jsx-a11y/no-autofocus": "error",
|
|
669
|
-
"jsx-a11y/no-distracting-elements": "error",
|
|
670
|
-
"jsx-a11y/no-noninteractive-tabindex": "error",
|
|
671
|
-
"jsx-a11y/no-redundant-roles": "error",
|
|
672
|
-
"jsx-a11y/no-static-element-interactions": "error",
|
|
673
|
-
"jsx-a11y/prefer-tag-over-role": "error",
|
|
674
|
-
"jsx-a11y/role-has-required-aria-props": "error",
|
|
675
|
-
"jsx-a11y/role-supports-aria-props": "error",
|
|
676
|
-
"jsx-a11y/scope": "error",
|
|
677
|
-
"jsx-a11y/tabindex-no-positive": "error",
|
|
678
|
-
"react-perf/jsx-no-jsx-as-prop": "off",
|
|
679
|
-
"react-perf/jsx-no-new-array-as-prop": "error",
|
|
680
|
-
"react-perf/jsx-no-new-function-as-prop": "off",
|
|
681
|
-
"react-perf/jsx-no-new-object-as-prop": "off",
|
|
682
|
-
"react/button-has-type": "error",
|
|
683
|
-
"react/checked-requires-onchange-or-readonly": "error",
|
|
684
|
-
"react/display-name": "off",
|
|
685
|
-
"react/exhaustive-deps": "error",
|
|
686
|
-
"react/forbid-dom-props": "off",
|
|
687
|
-
"react/forbid-elements": "off",
|
|
688
|
-
"react/forward-ref-uses-ref": "off",
|
|
689
|
-
"react/hook-use-state": "error",
|
|
690
|
-
"react/iframe-missing-sandbox": "off",
|
|
691
|
-
"react/jsx-boolean-value": "error",
|
|
692
|
-
"react/jsx-curly-brace-presence": ["error", {
|
|
693
|
-
children: "never",
|
|
694
|
-
propElementValues: "always",
|
|
695
|
-
props: "never"
|
|
696
|
-
}],
|
|
697
|
-
"react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
|
|
698
|
-
"react/jsx-fragments": "error",
|
|
699
|
-
"react/jsx-handler-names": "error",
|
|
700
|
-
"react/jsx-key": "error",
|
|
701
|
-
"react/jsx-max-depth": "off",
|
|
702
|
-
"react/jsx-no-comment-textnodes": "error",
|
|
703
|
-
"react/jsx-no-constructed-context-values": "error",
|
|
704
|
-
"react/jsx-no-duplicate-props": "error",
|
|
705
|
-
"react/jsx-no-script-url": "error",
|
|
706
|
-
"react/jsx-no-target-blank": ["error", { warnOnSpreadAttributes: true }],
|
|
707
|
-
"react/jsx-no-undef": "error",
|
|
708
|
-
"react/jsx-no-useless-fragment": "error",
|
|
709
|
-
"react/jsx-pascal-case": "error",
|
|
710
|
-
"react/jsx-props-no-spread-multi": "error",
|
|
711
|
-
"react/jsx-props-no-spreading": "off",
|
|
712
|
-
"react/no-array-index-key": "error",
|
|
713
|
-
"react/no-children-prop": "error",
|
|
714
|
-
"react/no-clone-element": "off",
|
|
715
|
-
"react/no-danger": "error",
|
|
716
|
-
"react/no-danger-with-children": "error",
|
|
717
|
-
"react/no-did-mount-set-state": "off",
|
|
718
|
-
"react/no-direct-mutation-state": "off",
|
|
719
|
-
"react/no-find-dom-node": "off",
|
|
720
|
-
"react/no-is-mounted": "off",
|
|
721
|
-
"react/no-multi-comp": "off",
|
|
722
|
-
"react/no-namespace": "error",
|
|
723
|
-
"react/no-react-children": "off",
|
|
724
|
-
"react/no-redundant-should-component-update": "off",
|
|
725
|
-
"react/no-render-return-value": "off",
|
|
726
|
-
"react/no-set-state": "off",
|
|
727
|
-
"react/no-string-refs": "off",
|
|
728
|
-
"react/no-this-in-sfc": "off",
|
|
729
|
-
"react/no-unescaped-entities": "error",
|
|
730
|
-
"react/no-unknown-property": "error",
|
|
731
|
-
"react/no-unsafe": "off",
|
|
732
|
-
"react/no-will-update-set-state": "off",
|
|
733
|
-
"react/only-export-components": "off",
|
|
734
|
-
"react/prefer-es6-class": "off",
|
|
735
|
-
"react/prefer-function-component": "off",
|
|
736
|
-
"react/react-in-jsx-scope": "off",
|
|
737
|
-
"react/require-render-return": "off",
|
|
738
|
-
"react/rules-of-hooks": "error",
|
|
739
|
-
"react/self-closing-comp": "error",
|
|
740
|
-
"react/state-in-constructor": "off",
|
|
741
|
-
"react/style-prop-object": "error",
|
|
742
|
-
"react/void-dom-elements-no-children": "error"
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
//#endregion
|
|
746
|
-
//#region ../oxlint-react/src/config-test-files/index.ts
|
|
747
|
-
const config$5 = { rules: {
|
|
748
|
-
"jsx-a11y/alt-text": "off",
|
|
749
|
-
"jsx-a11y/anchor-ambiguous-text": "off",
|
|
750
|
-
"jsx-a11y/anchor-has-content": "off",
|
|
751
|
-
"jsx-a11y/anchor-is-valid": "off",
|
|
752
|
-
"jsx-a11y/click-events-have-key-events": "off",
|
|
753
|
-
"jsx-a11y/heading-has-content": "off",
|
|
754
|
-
"jsx-a11y/html-has-lang": "off",
|
|
755
|
-
"jsx-a11y/iframe-has-title": "off",
|
|
756
|
-
"jsx-a11y/label-has-associated-control": "off",
|
|
757
|
-
"jsx-a11y/lang": "off",
|
|
758
|
-
"jsx-a11y/mouse-events-have-key-events": "off",
|
|
759
|
-
"jsx-a11y/no-access-key": "off",
|
|
760
|
-
"jsx-a11y/no-autofocus": "off",
|
|
761
|
-
"jsx-a11y/no-distracting-elements": "off",
|
|
762
|
-
"jsx-a11y/no-noninteractive-tabindex": "off",
|
|
763
|
-
"jsx-a11y/no-redundant-roles": "off",
|
|
764
|
-
"jsx-a11y/no-static-element-interactions": "off",
|
|
765
|
-
"jsx-a11y/prefer-tag-over-role": "off",
|
|
766
|
-
"jsx-a11y/scope": "off",
|
|
767
|
-
"jsx-a11y/tabindex-no-positive": "off",
|
|
768
|
-
"react-perf/jsx-no-new-array-as-prop": "off",
|
|
769
|
-
"react/button-has-type": "off",
|
|
770
|
-
"react/checked-requires-onchange-or-readonly": "off",
|
|
771
|
-
"react/jsx-no-target-blank": "off",
|
|
772
|
-
"react/jsx-no-useless-fragment": "off",
|
|
773
|
-
"react/no-array-index-key": "off",
|
|
774
|
-
"react/no-children-prop": "off",
|
|
775
|
-
"react/no-danger": "off"
|
|
776
|
-
} };
|
|
721
|
+
//#region ../utilities/src/constants/index.ts
|
|
722
|
+
const GLOB_SET_CONFIG_FILES = ["**/*.config.{js,ts,cjs,cts,mjs,mts}", "**/*.setup.{js,ts,cjs,cts,mjs,mts}"];
|
|
723
|
+
const GLOB_SET_TEST_FILES = ["**/*.test.{js,jsx,ts,tsx,cjs,cts,mjs,mts}", "**/*.test-d.{ts,cts,mts}"];
|
|
724
|
+
const GLOB_SET_TYPE_DEFINITIONS = ["**/*.d.{ts,cts,mts}", "**/*.test-d.{ts,cts,mts}"];
|
|
777
725
|
//#endregion
|
|
778
726
|
//#region ../utilities/src/clone/index.ts
|
|
779
727
|
function clone(value) {
|
|
@@ -816,10 +764,16 @@ function isObject(value) {
|
|
|
816
764
|
}
|
|
817
765
|
//#endregion
|
|
818
766
|
//#region src/config-test-files/index.ts
|
|
819
|
-
|
|
767
|
+
/**
|
|
768
|
+
* Optional config entry containing core rules that target test files. Intended
|
|
769
|
+
* for explicit overrides.
|
|
770
|
+
*/
|
|
771
|
+
const config$2 = { rules: {
|
|
772
|
+
"eslint/getter-return": "off",
|
|
820
773
|
"eslint/no-empty-function": "off",
|
|
821
774
|
"eslint/no-param-reassign": "off",
|
|
822
775
|
"eslint/no-promise-executor-return": "off",
|
|
776
|
+
"eslint/no-useless-assignment": "off",
|
|
823
777
|
"import/no-unassigned-import": "off",
|
|
824
778
|
"import/unambiguous": "off",
|
|
825
779
|
"jest/expect-expect": "warn",
|
|
@@ -898,22 +852,59 @@ const config$3 = mergeConfig(config$5, { rules: {
|
|
|
898
852
|
suite: "each"
|
|
899
853
|
}],
|
|
900
854
|
"vitest/consistent-vitest-vi": "error",
|
|
855
|
+
"vitest/expect-expect": "warn",
|
|
901
856
|
"vitest/hoisted-apis-on-top": "error",
|
|
857
|
+
"vitest/no-commented-out-tests": "warn",
|
|
858
|
+
"vitest/no-conditional-expect": "error",
|
|
859
|
+
"vitest/no-conditional-in-test": "error",
|
|
860
|
+
"vitest/no-disabled-tests": "warn",
|
|
861
|
+
"vitest/no-duplicate-hooks": "warn",
|
|
862
|
+
"vitest/no-focused-tests": "warn",
|
|
863
|
+
"vitest/no-identical-title": "warn",
|
|
902
864
|
"vitest/no-import-node-test": "error",
|
|
865
|
+
"vitest/no-interpolation-in-snapshots": "error",
|
|
866
|
+
"vitest/no-mocks-import": "error",
|
|
867
|
+
"vitest/no-standalone-expect": "error",
|
|
868
|
+
"vitest/no-test-return-statement": "error",
|
|
869
|
+
"vitest/no-unneeded-async-expect-function": "error",
|
|
870
|
+
"vitest/padding-around-after-all-blocks": "error",
|
|
903
871
|
"vitest/prefer-called-exactly-once-with": "warn",
|
|
904
872
|
"vitest/prefer-called-times": "error",
|
|
873
|
+
"vitest/prefer-comparison-matcher": "error",
|
|
905
874
|
"vitest/prefer-describe-function-title": "error",
|
|
875
|
+
"vitest/prefer-each": "error",
|
|
876
|
+
"vitest/prefer-equality-matcher": "error",
|
|
877
|
+
"vitest/prefer-expect-resolves": "error",
|
|
906
878
|
"vitest/prefer-expect-type-of": "error",
|
|
879
|
+
"vitest/prefer-hooks-in-order": "warn",
|
|
880
|
+
"vitest/prefer-hooks-on-top": "warn",
|
|
907
881
|
"vitest/prefer-importing-vitest-globals": "error",
|
|
882
|
+
"vitest/prefer-mock-promise-shorthand": "error",
|
|
883
|
+
"vitest/prefer-mock-return-shorthand": "error",
|
|
908
884
|
"vitest/prefer-strict-boolean-matchers": "error",
|
|
885
|
+
"vitest/prefer-strict-equal": "error",
|
|
886
|
+
"vitest/prefer-to-be": "error",
|
|
909
887
|
"vitest/prefer-to-be-object": "error",
|
|
888
|
+
"vitest/prefer-to-contain": "error",
|
|
889
|
+
"vitest/prefer-to-have-been-called-times": "error",
|
|
890
|
+
"vitest/prefer-to-have-length": "error",
|
|
891
|
+
"vitest/prefer-todo": "error",
|
|
910
892
|
"vitest/require-awaited-expect-poll": "error",
|
|
911
893
|
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
894
|
+
"vitest/require-to-throw-message": "error",
|
|
895
|
+
"vitest/valid-describe-callback": "error",
|
|
896
|
+
"vitest/valid-expect": "error",
|
|
897
|
+
"vitest/valid-expect-in-promise": "error",
|
|
898
|
+
"vitest/valid-title": "error",
|
|
912
899
|
"vitest/warn-todo": "warn"
|
|
913
|
-
} }
|
|
900
|
+
} };
|
|
914
901
|
//#endregion
|
|
915
902
|
//#region src/config-type-definitions/index.ts
|
|
916
|
-
|
|
903
|
+
/**
|
|
904
|
+
* Optional config entry containing core rules that target type definition
|
|
905
|
+
* files. Intended for explicit overrides.
|
|
906
|
+
*/
|
|
907
|
+
const config$3 = { rules: {
|
|
917
908
|
"import/no-empty-named-blocks": "off",
|
|
918
909
|
"import/no-unassigned-import": "off",
|
|
919
910
|
"import/unambiguous": "off",
|
|
@@ -924,32 +915,42 @@ const config$4 = { rules: {
|
|
|
924
915
|
"unicorn/require-module-specifiers": "off"
|
|
925
916
|
} };
|
|
926
917
|
//#endregion
|
|
918
|
+
//#region src/config-default/index.ts
|
|
919
|
+
/**
|
|
920
|
+
* Resolved Standard Config core entry.
|
|
921
|
+
*/
|
|
922
|
+
const config$4 = mergeConfig(config, { overrides: [
|
|
923
|
+
{
|
|
924
|
+
files: GLOB_SET_TYPE_DEFINITIONS,
|
|
925
|
+
...config$3
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
files: GLOB_SET_TEST_FILES,
|
|
929
|
+
...config$2
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
files: GLOB_SET_CONFIG_FILES,
|
|
933
|
+
...config$1
|
|
934
|
+
}
|
|
935
|
+
] });
|
|
936
|
+
//#endregion
|
|
927
937
|
//#region src/define-config/index.ts
|
|
938
|
+
const SUPPLEMENTAL_CONFIGS = [];
|
|
939
|
+
for (const config of ["@standard-config/oxlint-react", "@standard-config/oxlint-stylistic"]) {
|
|
940
|
+
let resolvedConfig;
|
|
941
|
+
try {
|
|
942
|
+
resolvedConfig = (await import(config)).default;
|
|
943
|
+
} catch {}
|
|
944
|
+
if (typeof resolvedConfig === "object") SUPPLEMENTAL_CONFIGS.push(resolvedConfig);
|
|
945
|
+
}
|
|
928
946
|
function defineConfig(...configs) {
|
|
929
|
-
let
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
return defineConfig$1(mergeConfig({
|
|
937
|
-
...includeReactConfig ? mergeConfig(config, config$2) : config,
|
|
938
|
-
overrides: [
|
|
939
|
-
{
|
|
940
|
-
files: ["**/*.d.{ts,cts,mts}", "**/*.test-d.{ts,cts,mts}"],
|
|
941
|
-
...config$4
|
|
942
|
-
},
|
|
943
|
-
{
|
|
944
|
-
files: ["**/*.test.{ts,tsx,cts,mts}", "**/*.test-d.{ts,cts,mts}"],
|
|
945
|
-
...config$3
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
files: ["**/*.config.{ts,cts,mts}", "**/*.setup.{ts,cts,mts}"],
|
|
949
|
-
...config$1
|
|
950
|
-
}
|
|
951
|
-
]
|
|
952
|
-
}, extensionConfig));
|
|
947
|
+
let mergedConfig = {};
|
|
948
|
+
for (const config of [
|
|
949
|
+
config$4,
|
|
950
|
+
...SUPPLEMENTAL_CONFIGS,
|
|
951
|
+
...configs
|
|
952
|
+
]) mergedConfig = mergeConfig(mergedConfig, config);
|
|
953
|
+
return defineConfig$1(mergedConfig);
|
|
953
954
|
}
|
|
954
955
|
//#endregion
|
|
955
956
|
//#region src/define-oxlint-config/index.ts
|
|
@@ -960,6 +961,39 @@ function defineOxlintConfig(...configs) {
|
|
|
960
961
|
return defineConfig(...configs);
|
|
961
962
|
}
|
|
962
963
|
//#endregion
|
|
963
|
-
|
|
964
|
+
//#region ../utilities/src/resolve-plugin/index.ts
|
|
965
|
+
/**
|
|
966
|
+
* Resolve an external plugin specifier to a file path.
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
*
|
|
970
|
+
* ```ts
|
|
971
|
+
* import { resolvePlugin } from '@standard-config/oxlint';
|
|
972
|
+
* import { defineConfig } from 'oxlint';
|
|
973
|
+
*
|
|
974
|
+
* const config = defineConfig({
|
|
975
|
+
* jsPlugins: [
|
|
976
|
+
* resolvePlugin(
|
|
977
|
+
* 'react-x',
|
|
978
|
+
* '@eslint-react/eslint-plugin',
|
|
979
|
+
* ),
|
|
980
|
+
* ],
|
|
981
|
+
* rules: {
|
|
982
|
+
* 'react-x/refs': 'error',
|
|
983
|
+
* },
|
|
984
|
+
* });
|
|
985
|
+
* ```
|
|
986
|
+
*/
|
|
987
|
+
function resolvePlugin(name, specifier) {
|
|
988
|
+
try {
|
|
989
|
+
specifier = fileURLToPath(import.meta.resolve(specifier));
|
|
990
|
+
} catch {}
|
|
991
|
+
return {
|
|
992
|
+
name,
|
|
993
|
+
specifier
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
//#endregion
|
|
997
|
+
export { config as configCoreBase, config$1 as configCoreConfigFiles, config$2 as configCoreTestFiles, config$3 as configCoreTypeDefinitions, config$4 as default, defineConfig, defineOxlintConfig, resolvePlugin };
|
|
964
998
|
|
|
965
999
|
//# sourceMappingURL=index.mjs.map
|