@isentinel/eslint-config 6.2.0 → 6.4.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 +29 -19
- package/dist/cli.mjs +6 -6
- package/dist/index.d.mts +946 -162
- package/dist/index.mjs +784 -490
- package/dist/lint-cli.mjs +64 -54
- package/dist/oxfmt.mjs +61 -22
- package/dist/oxlint.d.mts +1007 -97
- package/dist/oxlint.mjs +236 -136
- package/package.json +16 -16
package/dist/oxlint.mjs
CHANGED
|
@@ -132,14 +132,19 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
132
132
|
"eslint-plugin/test-case-shorthand-strings",
|
|
133
133
|
"eslint-plugin/unique-test-case-names",
|
|
134
134
|
"flawless/arrow-return-style",
|
|
135
|
+
"flawless/cognitive-complexity",
|
|
135
136
|
"flawless/jsx-shorthand-boolean",
|
|
136
137
|
"flawless/jsx-shorthand-fragment",
|
|
138
|
+
"flawless/max-comment-length",
|
|
137
139
|
"flawless/max-lines-per-function",
|
|
138
140
|
"flawless/naming-convention",
|
|
139
141
|
"flawless/no-conditional-empty-object-spread",
|
|
140
142
|
"flawless/no-conditional-in-test",
|
|
143
|
+
"flawless/no-em-dash",
|
|
141
144
|
"flawless/no-export-default-arrow",
|
|
142
145
|
"flawless/no-floating-point-equality",
|
|
146
|
+
"flawless/no-ignored-return",
|
|
147
|
+
"flawless/no-incompatible-assertion-types",
|
|
143
148
|
"flawless/no-known-value-widening",
|
|
144
149
|
"flawless/no-materialized-filter-map",
|
|
145
150
|
"flawless/no-object-parameters",
|
|
@@ -150,8 +155,10 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
150
155
|
"flawless/no-shape-in-symbol-names",
|
|
151
156
|
"flawless/no-shared-mocks",
|
|
152
157
|
"flawless/no-shared-test-state",
|
|
158
|
+
"flawless/no-trivial-functions",
|
|
153
159
|
"flawless/no-unknown-parameters",
|
|
154
160
|
"flawless/no-unknown-returns",
|
|
161
|
+
"flawless/no-unnecessary-prop-alias",
|
|
155
162
|
"flawless/no-unnecessary-use-callback",
|
|
156
163
|
"flawless/no-unnecessary-use-memo",
|
|
157
164
|
"flawless/no-unsafe-dictionary-type",
|
|
@@ -167,6 +174,7 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
167
174
|
"flawless/react-namespace",
|
|
168
175
|
"flawless/toml-sort-keys",
|
|
169
176
|
"flawless/yaml-block-key-blank-lines",
|
|
177
|
+
"flawless/yaml-sort-sequence-by-key",
|
|
170
178
|
"for-direction",
|
|
171
179
|
"func-call-spacing",
|
|
172
180
|
"func-name-matching",
|
|
@@ -304,6 +312,7 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
304
312
|
"jsdoc/no-restricted-syntax",
|
|
305
313
|
"jsdoc/no-types",
|
|
306
314
|
"jsdoc/no-undefined-types",
|
|
315
|
+
"jsdoc/no-unnecessary-type-assertion",
|
|
307
316
|
"jsdoc/normalize-see-links",
|
|
308
317
|
"jsdoc/prefer-import-tag",
|
|
309
318
|
"jsdoc/reject-any-type",
|
|
@@ -343,6 +352,7 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
343
352
|
"jsdoc/sort-tags",
|
|
344
353
|
"jsdoc/tag-lines",
|
|
345
354
|
"jsdoc/text-escaping",
|
|
355
|
+
"jsdoc/ts-ban-ts-comment",
|
|
346
356
|
"jsdoc/ts-method-signature-style",
|
|
347
357
|
"jsdoc/ts-no-empty-object-type",
|
|
348
358
|
"jsdoc/ts-no-unnecessary-template-expression",
|
|
@@ -596,6 +606,7 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
596
606
|
"perfectionist/sort-array-includes",
|
|
597
607
|
"perfectionist/sort-arrays",
|
|
598
608
|
"perfectionist/sort-classes",
|
|
609
|
+
"perfectionist/sort-constructor-parameters",
|
|
599
610
|
"perfectionist/sort-decorators",
|
|
600
611
|
"perfectionist/sort-enums",
|
|
601
612
|
"perfectionist/sort-export-attributes",
|
|
@@ -757,6 +768,7 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
757
768
|
"small-rules/ban-react-fc",
|
|
758
769
|
"small-rules/ban-types",
|
|
759
770
|
"small-rules/consistent-compound-words",
|
|
771
|
+
"small-rules/curly",
|
|
760
772
|
"small-rules/directive-disable-enable-pair",
|
|
761
773
|
"small-rules/directive-no-aggregating-enable",
|
|
762
774
|
"small-rules/directive-no-duplicate-disable",
|
|
@@ -768,53 +780,89 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
768
780
|
"small-rules/enforce-ianitor-check-type",
|
|
769
781
|
"small-rules/isolated-functions",
|
|
770
782
|
"small-rules/memoized-effect-dependencies",
|
|
783
|
+
"small-rules/no-adjust-state-on-prop-change",
|
|
771
784
|
"small-rules/no-array-constructor-elements",
|
|
772
785
|
"small-rules/no-array-constructor-index-assignment",
|
|
773
786
|
"small-rules/no-array-size-assignment",
|
|
774
787
|
"small-rules/no-async-constructor",
|
|
775
788
|
"small-rules/no-async-in-system",
|
|
776
789
|
"small-rules/no-cascading-set-state",
|
|
790
|
+
"small-rules/no-chain-state-updates",
|
|
791
|
+
"small-rules/no-chained-type-assertions",
|
|
792
|
+
"small-rules/no-cliffy-action-wrapper",
|
|
777
793
|
"small-rules/no-color3-constructor",
|
|
778
794
|
"small-rules/no-commented-code",
|
|
795
|
+
"small-rules/no-conditional-empty-object-spread",
|
|
779
796
|
"small-rules/no-constant-condition-with-break",
|
|
780
797
|
"small-rules/no-dead-store",
|
|
798
|
+
"small-rules/no-derived-state",
|
|
799
|
+
"small-rules/no-discarded-rejection",
|
|
781
800
|
"small-rules/no-error",
|
|
801
|
+
"small-rules/no-event-handler",
|
|
782
802
|
"small-rules/no-events-in-events-callback",
|
|
803
|
+
"small-rules/no-external-store-subscription",
|
|
783
804
|
"small-rules/no-filter-map-chain",
|
|
784
805
|
"small-rules/no-floating-point-equality",
|
|
785
806
|
"small-rules/no-giant-component",
|
|
786
807
|
"small-rules/no-god-components",
|
|
808
|
+
"small-rules/no-has-before-remove-in-jecs",
|
|
787
809
|
"small-rules/no-ianitor-in-function-body",
|
|
788
810
|
"small-rules/no-ianitor-success-access",
|
|
789
811
|
"small-rules/no-identity-map",
|
|
790
812
|
"small-rules/no-increment-decrement",
|
|
813
|
+
"small-rules/no-initialize-state",
|
|
791
814
|
"small-rules/no-inline-property-on-memo-component",
|
|
815
|
+
"small-rules/no-inline-signature-types",
|
|
792
816
|
"small-rules/no-instance-methods-without-this",
|
|
817
|
+
"small-rules/no-jsx-spread-child",
|
|
818
|
+
"small-rules/no-known-value-widening",
|
|
793
819
|
"small-rules/no-loop-iterable-mutation",
|
|
820
|
+
"small-rules/no-module-mocking",
|
|
821
|
+
"small-rules/no-multiple-cliffy-commands",
|
|
794
822
|
"small-rules/no-native-properties-spread",
|
|
823
|
+
"small-rules/no-nested-hook-calls",
|
|
795
824
|
"small-rules/no-new-instance-in-use-memo",
|
|
825
|
+
"small-rules/no-object-parameters",
|
|
826
|
+
"small-rules/no-pass-data-to-parent",
|
|
827
|
+
"small-rules/no-pass-live-state-to-parent",
|
|
796
828
|
"small-rules/no-print",
|
|
829
|
+
"small-rules/no-real-temporary-directory",
|
|
797
830
|
"small-rules/no-recursive",
|
|
831
|
+
"small-rules/no-reduce-accumulator-copy",
|
|
798
832
|
"small-rules/no-redundant-aspect-ratio-constraint",
|
|
833
|
+
"small-rules/no-reflect-apply",
|
|
834
|
+
"small-rules/no-reflect-get",
|
|
799
835
|
"small-rules/no-render-helper-functions",
|
|
836
|
+
"small-rules/no-reset-all-state-on-prop-change",
|
|
800
837
|
"small-rules/no-restricted-property-assignment",
|
|
838
|
+
"small-rules/no-runtime-in-type-files",
|
|
839
|
+
"small-rules/no-runtime-typeof",
|
|
840
|
+
"small-rules/no-shape-in-symbol-names",
|
|
801
841
|
"small-rules/no-spec-file-extension",
|
|
802
842
|
"small-rules/no-static-react-create-element",
|
|
803
843
|
"small-rules/no-table-create-map",
|
|
804
844
|
"small-rules/no-task-wait",
|
|
845
|
+
"small-rules/no-test-timeout",
|
|
805
846
|
"small-rules/no-trivial-assertions",
|
|
806
847
|
"small-rules/no-underscore-react-props",
|
|
848
|
+
"small-rules/no-unknown-parameters",
|
|
849
|
+
"small-rules/no-unknown-returns",
|
|
850
|
+
"small-rules/no-unknown-type-aliases",
|
|
851
|
+
"small-rules/no-unsafe-dictionary-type",
|
|
852
|
+
"small-rules/no-unsupported-syntax",
|
|
807
853
|
"small-rules/no-unused-imports",
|
|
808
854
|
"small-rules/no-unused-use-memo",
|
|
809
855
|
"small-rules/no-use-memo-simple-expression",
|
|
810
856
|
"small-rules/no-use-of-empty-return-value",
|
|
811
857
|
"small-rules/no-useless-constants",
|
|
812
858
|
"small-rules/no-useless-default",
|
|
859
|
+
"small-rules/no-useless-empty-string-comparison",
|
|
813
860
|
"small-rules/no-useless-use-effect",
|
|
814
861
|
"small-rules/no-useless-use-memo",
|
|
815
862
|
"small-rules/no-useless-use-spring",
|
|
816
863
|
"small-rules/no-variadic-spread",
|
|
817
864
|
"small-rules/no-warn",
|
|
865
|
+
"small-rules/no-widen-then-assert",
|
|
818
866
|
"small-rules/only-type-imports",
|
|
819
867
|
"small-rules/prefer-class-properties",
|
|
820
868
|
"small-rules/prefer-constant-dispatch",
|
|
@@ -827,12 +875,15 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
827
875
|
"small-rules/prefer-idiv",
|
|
828
876
|
"small-rules/prefer-local-portal-component",
|
|
829
877
|
"small-rules/prefer-math-min-max",
|
|
878
|
+
"small-rules/prefer-membership-filter-in-jecs",
|
|
830
879
|
"small-rules/prefer-modding-inspect",
|
|
831
880
|
"small-rules/prefer-module-scope-constants",
|
|
881
|
+
"small-rules/prefer-native-collection-copy",
|
|
882
|
+
"small-rules/prefer-optional-parameter",
|
|
832
883
|
"small-rules/prefer-padding-components",
|
|
833
884
|
"small-rules/prefer-pascal-case-enums",
|
|
834
885
|
"small-rules/prefer-sequence-overloads",
|
|
835
|
-
"small-rules/prefer-single-world-query",
|
|
886
|
+
"small-rules/prefer-single-world-query-in-jecs",
|
|
836
887
|
"small-rules/prefer-singular-enums",
|
|
837
888
|
"small-rules/prefer-ternary-conditional-rendering",
|
|
838
889
|
"small-rules/prefer-udim2-shorthand",
|
|
@@ -845,10 +896,14 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
845
896
|
"small-rules/require-paired-calls",
|
|
846
897
|
"small-rules/require-react-component-keys",
|
|
847
898
|
"small-rules/require-react-display-names",
|
|
899
|
+
"small-rules/require-readable-spacing",
|
|
900
|
+
"small-rules/require-safety-comment-for-type-assertion",
|
|
848
901
|
"small-rules/require-switch-case-braces",
|
|
849
902
|
"small-rules/require-throw-error-capture",
|
|
903
|
+
"small-rules/require-tsx-for-hooks",
|
|
850
904
|
"small-rules/require-unicode-regex",
|
|
851
905
|
"small-rules/rerender-memo-with-default-value",
|
|
906
|
+
"small-rules/starts-with-verb",
|
|
852
907
|
"small-rules/strict-component-boundaries",
|
|
853
908
|
"small-rules/use-exhaustive-dependencies",
|
|
854
909
|
"small-rules/use-hook-at-top-level",
|
|
@@ -1847,6 +1902,8 @@ const jsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
|
1847
1902
|
const typeAwareJsPluginRuleNames = /* @__PURE__ */ new Set([
|
|
1848
1903
|
"eslint-plugin/no-property-in-node",
|
|
1849
1904
|
"flawless/naming-convention",
|
|
1905
|
+
"flawless/no-ignored-return",
|
|
1906
|
+
"flawless/no-incompatible-assertion-types",
|
|
1850
1907
|
"flawless/no-materialized-filter-map",
|
|
1851
1908
|
"flawless/no-redundant-type-annotation",
|
|
1852
1909
|
"flawless/no-reflect-set",
|
|
@@ -2091,13 +2148,18 @@ const effectivePresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2091
2148
|
"eslint-plugin/test-case-shorthand-strings",
|
|
2092
2149
|
"eslint-plugin/unique-test-case-names",
|
|
2093
2150
|
"flawless/arrow-return-style",
|
|
2151
|
+
"flawless/cognitive-complexity",
|
|
2094
2152
|
"flawless/jsx-shorthand-boolean",
|
|
2095
2153
|
"flawless/jsx-shorthand-fragment",
|
|
2154
|
+
"flawless/max-comment-length",
|
|
2096
2155
|
"flawless/max-lines-per-function",
|
|
2097
2156
|
"flawless/no-conditional-empty-object-spread",
|
|
2098
2157
|
"flawless/no-conditional-in-test",
|
|
2158
|
+
"flawless/no-em-dash",
|
|
2099
2159
|
"flawless/no-export-default-arrow",
|
|
2100
2160
|
"flawless/no-floating-point-equality",
|
|
2161
|
+
"flawless/no-ignored-return",
|
|
2162
|
+
"flawless/no-incompatible-assertion-types",
|
|
2101
2163
|
"flawless/no-known-value-widening",
|
|
2102
2164
|
"flawless/no-materialized-filter-map",
|
|
2103
2165
|
"flawless/no-object-parameters",
|
|
@@ -2106,7 +2168,10 @@ const effectivePresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2106
2168
|
"flawless/no-reflect-set",
|
|
2107
2169
|
"flawless/no-shape-in-symbol-names",
|
|
2108
2170
|
"flawless/no-shared-mocks",
|
|
2171
|
+
"flawless/no-trivial-functions",
|
|
2172
|
+
"flawless/no-unknown-parameters",
|
|
2109
2173
|
"flawless/no-unknown-returns",
|
|
2174
|
+
"flawless/no-unnecessary-prop-alias",
|
|
2110
2175
|
"flawless/no-unnecessary-use-callback",
|
|
2111
2176
|
"flawless/no-unnecessary-use-memo",
|
|
2112
2177
|
"flawless/no-unsafe-dictionary-type",
|
|
@@ -2476,7 +2541,6 @@ const effectivePresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2476
2541
|
"small-rules/require-async-suffix",
|
|
2477
2542
|
"small-rules/strict-component-boundaries",
|
|
2478
2543
|
"sonar/bool-param-default",
|
|
2479
|
-
"sonar/cognitive-complexity",
|
|
2480
2544
|
"sonar/constructor-for-side-effects",
|
|
2481
2545
|
"sonar/destructuring-assignment-syntax",
|
|
2482
2546
|
"sonar/elseif-without-else",
|
|
@@ -2493,13 +2557,10 @@ const effectivePresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2493
2557
|
"sonar/no-duplicated-branches",
|
|
2494
2558
|
"sonar/no-element-overwrite",
|
|
2495
2559
|
"sonar/no-empty-collection",
|
|
2496
|
-
"sonar/no-floating-point-equality",
|
|
2497
2560
|
"sonar/no-gratuitous-expressions",
|
|
2498
2561
|
"sonar/no-identical-conditions",
|
|
2499
2562
|
"sonar/no-identical-expressions",
|
|
2500
2563
|
"sonar/no-identical-functions",
|
|
2501
|
-
"sonar/no-ignored-return",
|
|
2502
|
-
"sonar/no-incompatible-assertion-types",
|
|
2503
2564
|
"sonar/no-inverted-boolean-check",
|
|
2504
2565
|
"sonar/no-mixed-completion-style",
|
|
2505
2566
|
"sonar/no-nested-conditional",
|
|
@@ -2914,14 +2975,19 @@ const enabledPresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2914
2975
|
"eslint-plugin/test-case-shorthand-strings",
|
|
2915
2976
|
"eslint-plugin/unique-test-case-names",
|
|
2916
2977
|
"flawless/arrow-return-style",
|
|
2978
|
+
"flawless/cognitive-complexity",
|
|
2917
2979
|
"flawless/jsx-shorthand-boolean",
|
|
2918
2980
|
"flawless/jsx-shorthand-fragment",
|
|
2981
|
+
"flawless/max-comment-length",
|
|
2919
2982
|
"flawless/max-lines-per-function",
|
|
2920
2983
|
"flawless/naming-convention",
|
|
2921
2984
|
"flawless/no-conditional-empty-object-spread",
|
|
2922
2985
|
"flawless/no-conditional-in-test",
|
|
2986
|
+
"flawless/no-em-dash",
|
|
2923
2987
|
"flawless/no-export-default-arrow",
|
|
2924
2988
|
"flawless/no-floating-point-equality",
|
|
2989
|
+
"flawless/no-ignored-return",
|
|
2990
|
+
"flawless/no-incompatible-assertion-types",
|
|
2925
2991
|
"flawless/no-known-value-widening",
|
|
2926
2992
|
"flawless/no-materialized-filter-map",
|
|
2927
2993
|
"flawless/no-object-parameters",
|
|
@@ -2931,7 +2997,10 @@ const enabledPresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
2931
2997
|
"flawless/no-reflect-set",
|
|
2932
2998
|
"flawless/no-shape-in-symbol-names",
|
|
2933
2999
|
"flawless/no-shared-mocks",
|
|
3000
|
+
"flawless/no-trivial-functions",
|
|
3001
|
+
"flawless/no-unknown-parameters",
|
|
2934
3002
|
"flawless/no-unknown-returns",
|
|
3003
|
+
"flawless/no-unnecessary-prop-alias",
|
|
2935
3004
|
"flawless/no-unnecessary-use-callback",
|
|
2936
3005
|
"flawless/no-unnecessary-use-memo",
|
|
2937
3006
|
"flawless/no-unsafe-dictionary-type",
|
|
@@ -3393,7 +3462,6 @@ const enabledPresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
3393
3462
|
"small-rules/require-async-suffix",
|
|
3394
3463
|
"small-rules/strict-component-boundaries",
|
|
3395
3464
|
"sonar/bool-param-default",
|
|
3396
|
-
"sonar/cognitive-complexity",
|
|
3397
3465
|
"sonar/constructor-for-side-effects",
|
|
3398
3466
|
"sonar/destructuring-assignment-syntax",
|
|
3399
3467
|
"sonar/file-name-differ-from-class",
|
|
@@ -3406,12 +3474,9 @@ const enabledPresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
3406
3474
|
"sonar/no-duplicated-branches",
|
|
3407
3475
|
"sonar/no-element-overwrite",
|
|
3408
3476
|
"sonar/no-empty-collection",
|
|
3409
|
-
"sonar/no-floating-point-equality",
|
|
3410
3477
|
"sonar/no-identical-conditions",
|
|
3411
3478
|
"sonar/no-identical-expressions",
|
|
3412
3479
|
"sonar/no-identical-functions",
|
|
3413
|
-
"sonar/no-ignored-return",
|
|
3414
|
-
"sonar/no-incompatible-assertion-types",
|
|
3415
3480
|
"sonar/no-inverted-boolean-check",
|
|
3416
3481
|
"sonar/no-mixed-completion-style",
|
|
3417
3482
|
"sonar/no-nested-conditional",
|
|
@@ -3469,6 +3534,7 @@ const enabledPresetRuleNames = /* @__PURE__ */ new Set([
|
|
|
3469
3534
|
"style/key-spacing",
|
|
3470
3535
|
"style/keyword-spacing",
|
|
3471
3536
|
"style/lines-between-class-members",
|
|
3537
|
+
"style/max-len",
|
|
3472
3538
|
"style/max-statements-per-line",
|
|
3473
3539
|
"style/member-delimiter-style",
|
|
3474
3540
|
"style/multiline-comment-style",
|
|
@@ -4248,16 +4314,24 @@ const oxlintNativeRuleNames = /* @__PURE__ */ new Set([
|
|
|
4248
4314
|
"react-perf/jsx-no-new-function-as-prop",
|
|
4249
4315
|
"react-perf/jsx-no-new-object-as-prop",
|
|
4250
4316
|
"react/button-has-type",
|
|
4317
|
+
"react/capitalized-calls",
|
|
4251
4318
|
"react/checked-requires-onchange-or-readonly",
|
|
4252
4319
|
"react/display-name",
|
|
4320
|
+
"react/error-boundaries",
|
|
4253
4321
|
"react/exhaustive-deps",
|
|
4322
|
+
"react/exhaustive-effect-dependencies",
|
|
4254
4323
|
"react/forbid-component-props",
|
|
4255
4324
|
"react/forbid-dom-props",
|
|
4256
4325
|
"react/forbid-elements",
|
|
4257
4326
|
"react/forward-ref-uses-ref",
|
|
4258
4327
|
"react/function-component-definition",
|
|
4328
|
+
"react/globals",
|
|
4259
4329
|
"react/hook-use-state",
|
|
4330
|
+
"react/hooks",
|
|
4260
4331
|
"react/iframe-missing-sandbox",
|
|
4332
|
+
"react/immutability",
|
|
4333
|
+
"react/incompatible-library",
|
|
4334
|
+
"react/invariant",
|
|
4261
4335
|
"react/jsx-boolean-value",
|
|
4262
4336
|
"react/jsx-curly-brace-presence",
|
|
4263
4337
|
"react/jsx-filename-extension",
|
|
@@ -4276,11 +4350,13 @@ const oxlintNativeRuleNames = /* @__PURE__ */ new Set([
|
|
|
4276
4350
|
"react/jsx-pascal-case",
|
|
4277
4351
|
"react/jsx-props-no-spread-multi",
|
|
4278
4352
|
"react/jsx-props-no-spreading",
|
|
4353
|
+
"react/memo-dependencies",
|
|
4279
4354
|
"react/no-array-index-key",
|
|
4280
4355
|
"react/no-children-prop",
|
|
4281
4356
|
"react/no-clone-element",
|
|
4282
4357
|
"react/no-danger",
|
|
4283
4358
|
"react/no-danger-with-children",
|
|
4359
|
+
"react/no-deriving-state-in-effects",
|
|
4284
4360
|
"react/no-did-mount-set-state",
|
|
4285
4361
|
"react/no-did-update-set-state",
|
|
4286
4362
|
"react/no-direct-mutation-state",
|
|
@@ -4303,14 +4379,25 @@ const oxlintNativeRuleNames = /* @__PURE__ */ new Set([
|
|
|
4303
4379
|
"react/only-export-components",
|
|
4304
4380
|
"react/prefer-es6-class",
|
|
4305
4381
|
"react/prefer-function-component",
|
|
4306
|
-
"react/
|
|
4382
|
+
"react/preserve-manual-memoization",
|
|
4383
|
+
"react/purity",
|
|
4307
4384
|
"react/react-in-jsx-scope",
|
|
4385
|
+
"react/refs",
|
|
4308
4386
|
"react/require-render-return",
|
|
4387
|
+
"react/rule-suppression",
|
|
4309
4388
|
"react/rules-of-hooks",
|
|
4310
4389
|
"react/self-closing-comp",
|
|
4390
|
+
"react/set-state-in-effect",
|
|
4391
|
+
"react/set-state-in-render",
|
|
4311
4392
|
"react/state-in-constructor",
|
|
4393
|
+
"react/static-components",
|
|
4312
4394
|
"react/style-prop-object",
|
|
4395
|
+
"react/syntax",
|
|
4396
|
+
"react/todo",
|
|
4397
|
+
"react/unsupported-syntax",
|
|
4398
|
+
"react/use-memo",
|
|
4313
4399
|
"react/void-dom-elements-no-children",
|
|
4400
|
+
"react/void-use-memo",
|
|
4314
4401
|
"require-await",
|
|
4315
4402
|
"require-unicode-regexp",
|
|
4316
4403
|
"require-yield",
|
|
@@ -4352,6 +4439,7 @@ const oxlintNativeRuleNames = /* @__PURE__ */ new Set([
|
|
|
4352
4439
|
"typescript/no-extraneous-class",
|
|
4353
4440
|
"typescript/no-floating-promises",
|
|
4354
4441
|
"typescript/no-for-in-array",
|
|
4442
|
+
"typescript/no-generated-empty-object-type",
|
|
4355
4443
|
"typescript/no-implied-eval",
|
|
4356
4444
|
"typescript/no-import-type-side-effects",
|
|
4357
4445
|
"typescript/no-inferrable-types",
|
|
@@ -4383,6 +4471,7 @@ const oxlintNativeRuleNames = /* @__PURE__ */ new Set([
|
|
|
4383
4471
|
"typescript/no-unsafe-assignment",
|
|
4384
4472
|
"typescript/no-unsafe-call",
|
|
4385
4473
|
"typescript/no-unsafe-declaration-merging",
|
|
4474
|
+
"typescript/no-unsafe-enum-assignment",
|
|
4386
4475
|
"typescript/no-unsafe-enum-comparison",
|
|
4387
4476
|
"typescript/no-unsafe-function-type",
|
|
4388
4477
|
"typescript/no-unsafe-member-access",
|
|
@@ -4704,6 +4793,7 @@ const typeAwareNativeOxlintRuleNames = /* @__PURE__ */ new Set([
|
|
|
4704
4793
|
"typescript/no-duplicate-type-constituents",
|
|
4705
4794
|
"typescript/no-floating-promises",
|
|
4706
4795
|
"typescript/no-for-in-array",
|
|
4796
|
+
"typescript/no-generated-empty-object-type",
|
|
4707
4797
|
"typescript/no-implied-eval",
|
|
4708
4798
|
"typescript/no-meaningless-void-operator",
|
|
4709
4799
|
"typescript/no-misused-promises",
|
|
@@ -4721,6 +4811,7 @@ const typeAwareNativeOxlintRuleNames = /* @__PURE__ */ new Set([
|
|
|
4721
4811
|
"typescript/no-unsafe-argument",
|
|
4722
4812
|
"typescript/no-unsafe-assignment",
|
|
4723
4813
|
"typescript/no-unsafe-call",
|
|
4814
|
+
"typescript/no-unsafe-enum-assignment",
|
|
4724
4815
|
"typescript/no-unsafe-enum-comparison",
|
|
4725
4816
|
"typescript/no-unsafe-member-access",
|
|
4726
4817
|
"typescript/no-unsafe-return",
|
|
@@ -4832,6 +4923,8 @@ const optionallyTypeAwareRules = /* @__PURE__ */ new Set([
|
|
|
4832
4923
|
*/
|
|
4833
4924
|
const typeAwareJsPluginRules = /* @__PURE__ */ new Set([
|
|
4834
4925
|
"eslint-plugin/no-property-in-node",
|
|
4926
|
+
"flawless/no-ignored-return",
|
|
4927
|
+
"flawless/no-incompatible-assertion-types",
|
|
4835
4928
|
"jest/no-error-equal",
|
|
4836
4929
|
"jest/no-unnecessary-assertion",
|
|
4837
4930
|
"jest/unbound-method",
|
|
@@ -4841,12 +4934,9 @@ const typeAwareJsPluginRules = /* @__PURE__ */ new Set([
|
|
|
4841
4934
|
"react/no-implicit-ref",
|
|
4842
4935
|
"react/no-leaked-conditional-rendering",
|
|
4843
4936
|
"react/no-unused-props",
|
|
4844
|
-
"sonar/no-ignored-return",
|
|
4845
|
-
"sonar/no-incompatible-assertion-types",
|
|
4846
4937
|
"sonar/no-redundant-optional",
|
|
4847
4938
|
"sonar/no-try-promise",
|
|
4848
4939
|
"sonar/prefer-immediate-return",
|
|
4849
|
-
"ts/prefer-destructuring",
|
|
4850
4940
|
"unicorn/no-non-function-verb-prefix"
|
|
4851
4941
|
]);
|
|
4852
4942
|
const ESLINT_ONLY = "eslint-only";
|
|
@@ -4914,7 +5004,8 @@ const TS_EXTENSION_TO_CORE = /* @__PURE__ */ new Set([
|
|
|
4914
5004
|
"no-shadow",
|
|
4915
5005
|
"no-unused-expressions",
|
|
4916
5006
|
"no-unused-private-class-members",
|
|
4917
|
-
"no-useless-constructor"
|
|
5007
|
+
"no-useless-constructor",
|
|
5008
|
+
"prefer-destructuring"
|
|
4918
5009
|
]);
|
|
4919
5010
|
/**
|
|
4920
5011
|
* Unicorn rules renamed upstream but still exposed under the old Oxlint name.
|
|
@@ -4981,17 +5072,16 @@ function jsPluginAdapterFor(rule) {
|
|
|
4981
5072
|
const staysInEslint = {
|
|
4982
5073
|
"e18e/* (optionally type-aware)": "Four e18e rules (prefer-array-at, prefer-array-to-reversed, prefer-array-to-sorted, prefer-spread-syntax) run without type information but detect more with it, so they stay in ESLint (see optionallyTypeAwareRules); the rest run in oxlint as a jsPlugin",
|
|
4983
5074
|
"eslint-comments/*": "Lints eslint-disable directives, which only exist in ESLint-linted code; oxlint-comments covers oxlint directives",
|
|
4984
|
-
"flawless/naming-convention": "Type-aware custom rule; oxlint jsPlugins have no type information. The syntax-only flawless rules (arrow-return-style, max-lines-per-function, no-conditional-in-test, no-export-default-arrow, padding-after-expect-assertions, prefer-ending-with-an-expect, prefer-expect-assertions-count, prefer-parameter-destructuring, the react jsx-shorthand-*, purity, no-unnecessary-use-*, prefer-destructuring-assignment) run in oxlint. flawless/no-redundant-tsconfig-options and every flawless/toml-* and flawless/yaml-* rule lint non-JS files and stay in ESLint",
|
|
5075
|
+
"flawless/naming-convention": "Type-aware custom rule; oxlint jsPlugins have no type information. The syntax-only flawless rules (arrow-return-style, cognitive-complexity, max-comment-length, max-lines-per-function, no-em-dash, no-trivial-functions, no-unknown-parameters, no-unnecessary-prop-alias, no-conditional-in-test, no-export-default-arrow, padding-after-expect-assertions, prefer-ending-with-an-expect, prefer-expect-assertions-count, prefer-parameter-destructuring, the react jsx-shorthand-*, purity, no-unnecessary-use-*, prefer-destructuring-assignment) run in oxlint. flawless/no-redundant-tsconfig-options and every flawless/toml-* and flawless/yaml-* rule lint non-JS files and stay in ESLint",
|
|
4985
5076
|
"flawless/prefer-read-only-props": "Type-aware custom rule; oxlint jsPlugins have no type information",
|
|
4986
5077
|
"format-lua/*": "Oxlint cannot lint Lua files",
|
|
4987
5078
|
"jest/* (type-aware)": "Four type-aware jest rules stay in ESLint (see typeAwareJsPluginRules); the rest run in oxlint via eslint-plugin-jest as a jsPlugin (renamed jest-js, since oxlint reserves the native jest prefix), which honors settings.jest.globalPackage = @rbxts/jest-globals (the NATIVE oxlint jest plugin does not, https://github.com/oxc-project/oxc/issues/23290)",
|
|
4988
|
-
"jsdoc/require-param": "Oxlint's native port reports nested functions inside an unexported documented function (https://github.com/oxc-project/oxc/issues/27470)",
|
|
4989
5079
|
"jsonc/yaml/toml/markdown/package-json/pnpm/sort-*": "Oxlint only lints JS/TS files; JSON, YAML, TOML and Markdown stay in ESLint",
|
|
4990
5080
|
"react/* (type-aware)": "The @eslint-react type-aware rules (no-implicit-children/key/ref, no-leaked-conditional-rendering, no-unused-props) need type information but do NOT declare requiresTypeChecking, so the metadata-based parity test cannot catch them; they are excluded manually and stay in ESLint",
|
|
4991
5081
|
"roblox/* (type-aware)": "Type-aware custom rules (lua-truthiness etc.); oxlint jsPlugins have no type information",
|
|
4992
5082
|
"sentinel/explicit-size-check": "Type-aware custom rule; oxlint jsPlugins have no type information",
|
|
4993
5083
|
"ts/no-shadow": "Oxlint's native port does not check members of declare namespace / declare module blocks in .d.ts files (https://github.com/oxc-project/oxc/issues/27469)",
|
|
4994
|
-
"type-aware jsPlugin rules": "Rules whose meta.docs.requiresTypeChecking is true crash or silently no-op under oxlint's jsPlugin runtime (no type information):
|
|
5084
|
+
"type-aware jsPlugin rules": "Rules whose meta.docs.requiresTypeChecking is true crash or silently no-op under oxlint's jsPlugin runtime (no type information): flawless/no-ignored-return, flawless/no-incompatible-assertion-types, sonar/no-redundant-optional, sonar/no-try-promise, sonar/prefer-immediate-return, unicorn/no-non-function-verb-prefix, eslint-plugin/no-property-in-node, jest/no-error-equal, jest/no-unnecessary-assertion, jest/unbound-method, jest/valid-expect-with-promise",
|
|
4995
5085
|
"unicorn/no-unsafe-string-replacement": "False positives under oxlint's jsPlugin scope analysis (template-literal replacements are not resolved)",
|
|
4996
5086
|
"unicorn/no-useless-coercion": "Optionally type-aware: values whose type is only known through TypeScript (a `string`-typed parameter, say) are missed without parser services, so it stays in ESLint (see optionallyTypeAwareRules)",
|
|
4997
5087
|
"vitest/prefer-each": "Oxlint's native port ignores where test functions are imported from, so it reports loops over non-vitest helpers and misses aliased imports (https://github.com/oxc-project/oxc/issues/27471)"
|
|
@@ -5029,7 +5119,6 @@ function isNonJsFlawlessName(name) {
|
|
|
5029
5119
|
return name.startsWith("toml-") || name.startsWith("yaml-") || name === "no-redundant-tsconfig-options";
|
|
5030
5120
|
}
|
|
5031
5121
|
const KNOWN_INCOMPATIBLE_RULES = {
|
|
5032
|
-
"jsdoc/require-param": "Oxlint applies an unexported outer function's JSDoc to a nested function (https://github.com/oxc-project/oxc/issues/27470).",
|
|
5033
5122
|
"style/jsx-function-call-newline": "Formatting-rule ownership remains with ESLint and oxfmt.",
|
|
5034
5123
|
"ts/no-shadow": "Oxlint skips every member of a declare namespace or declare module in .d.ts files (https://github.com/oxc-project/oxc/issues/27469).",
|
|
5035
5124
|
"unicorn/no-missing-local-resource": "The preset only enables this rule for Markdown virtual files, which Oxlint cannot lint.",
|
|
@@ -5039,13 +5128,17 @@ const KNOWN_INCOMPATIBLE_RULES = {
|
|
|
5039
5128
|
/**
|
|
5040
5129
|
* Rules that take the ESLint plugin even though Oxlint ports them natively.
|
|
5041
5130
|
* `unicorn/no-lonely-if` is here because its JS implementation currently has
|
|
5042
|
-
* better autofix parity.
|
|
5043
|
-
*
|
|
5131
|
+
* better autofix parity. `unicorn/no-useless-undefined` is here because the
|
|
5132
|
+
* native autofix breaks syntax and drops types and comments
|
|
5133
|
+
* (https://github.com/oxc-project/oxc/issues/28978) and the native rule misses
|
|
5134
|
+
* reports (https://github.com/oxc-project/oxc/issues/28979,
|
|
5135
|
+
* https://github.com/oxc-project/oxc/issues/28988). A native preference needs
|
|
5136
|
+
* no entry — that is what every family gets by default.
|
|
5044
5137
|
*/
|
|
5045
5138
|
const JS_PLUGIN_PREFERRED_RULES = /* @__PURE__ */ new Set([
|
|
5046
|
-
"id-length",
|
|
5047
5139
|
"no-loop-func",
|
|
5048
|
-
"unicorn/no-lonely-if"
|
|
5140
|
+
"unicorn/no-lonely-if",
|
|
5141
|
+
"unicorn/no-useless-undefined"
|
|
5049
5142
|
]);
|
|
5050
5143
|
/**
|
|
5051
5144
|
* Resolve one canonical ESLint rule against generated Oxlint capabilities and
|
|
@@ -5333,6 +5426,15 @@ const GLOB_EXCLUDE = [
|
|
|
5333
5426
|
function isRecord$1(value) {
|
|
5334
5427
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5335
5428
|
}
|
|
5429
|
+
/**
|
|
5430
|
+
* Whether a value is an array whose every element is a string.
|
|
5431
|
+
*
|
|
5432
|
+
* @param value - The value to test.
|
|
5433
|
+
* @returns Whether the value is a `string` array.
|
|
5434
|
+
*/
|
|
5435
|
+
function isStringArray(value) {
|
|
5436
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
5437
|
+
}
|
|
5336
5438
|
//#endregion
|
|
5337
5439
|
//#region src/prettier-config.ts
|
|
5338
5440
|
/**
|
|
@@ -5677,6 +5779,17 @@ function resolveEditorConfigOptions(cwd) {
|
|
|
5677
5779
|
return editorConfigToPrettier(properties);
|
|
5678
5780
|
}
|
|
5679
5781
|
/**
|
|
5782
|
+
* Read a numeric `.editorconfig` value. An absent or empty value sets nothing.
|
|
5783
|
+
*
|
|
5784
|
+
* @param value - The raw property value.
|
|
5785
|
+
* @returns The finite number, or `undefined`.
|
|
5786
|
+
*/
|
|
5787
|
+
function editorConfigNumber(value) {
|
|
5788
|
+
if (value === void 0 || value === "") return;
|
|
5789
|
+
const parsed = Number(value);
|
|
5790
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
5791
|
+
}
|
|
5792
|
+
/**
|
|
5680
5793
|
* Map one `.editorconfig` section to oxfmt options, as the rule's config
|
|
5681
5794
|
* loader does.
|
|
5682
5795
|
*
|
|
@@ -5691,12 +5804,12 @@ function editorConfigToOxfmt(properties) {
|
|
|
5691
5804
|
if (indentStyle === "tab" || indentStyle === "space") options["useTabs"] = indentStyle === "tab";
|
|
5692
5805
|
const quoteType = properties["quote_type"];
|
|
5693
5806
|
if (quoteType === "single" || quoteType === "double") options["singleQuote"] = quoteType === "single";
|
|
5694
|
-
const indentSize =
|
|
5695
|
-
const tabWidth =
|
|
5696
|
-
if (
|
|
5697
|
-
else if (
|
|
5698
|
-
const printWidth =
|
|
5699
|
-
if (
|
|
5807
|
+
const indentSize = editorConfigNumber(properties["indent_size"]);
|
|
5808
|
+
const tabWidth = editorConfigNumber(properties["tab_width"]);
|
|
5809
|
+
if (indentSize !== void 0 && options["useTabs"] === false) options["tabWidth"] = indentSize;
|
|
5810
|
+
else if (tabWidth !== void 0) options["tabWidth"] = tabWidth;
|
|
5811
|
+
const printWidth = editorConfigNumber(properties["max_line_length"]);
|
|
5812
|
+
if (printWidth !== void 0) options["printWidth"] = printWidth;
|
|
5700
5813
|
const finalNewline = properties["insert_final_newline"];
|
|
5701
5814
|
if (finalNewline === "true" || finalNewline === "false") options["insertFinalNewline"] = finalNewline === "true";
|
|
5702
5815
|
return options;
|
|
@@ -5768,12 +5881,12 @@ function migratePrettierOptions(prettierOptions) {
|
|
|
5768
5881
|
function migratePrettierOverrides(overrides) {
|
|
5769
5882
|
if (!Array.isArray(overrides)) return [];
|
|
5770
5883
|
return overrides.flatMap((override) => {
|
|
5771
|
-
if (
|
|
5884
|
+
if (!isRecord$1(override)) return [];
|
|
5772
5885
|
const { excludeFiles, files, options } = override;
|
|
5773
5886
|
return [{
|
|
5774
5887
|
...excludeFiles === void 0 ? {} : { excludeFiles: stringsOf(excludeFiles) },
|
|
5775
5888
|
files: stringsOf(files),
|
|
5776
|
-
options:
|
|
5889
|
+
options: isRecord$1(options) ? migratePrettierOptions(options) : {}
|
|
5777
5890
|
}];
|
|
5778
5891
|
});
|
|
5779
5892
|
}
|
|
@@ -5853,6 +5966,7 @@ function mergeRestrictedDomImportRule(rule, domPackage) {
|
|
|
5853
5966
|
function reactRules({ domPackage, filenameCase = "kebabCase", reactCompiler = true, stylistic = true, testing = false } = {}) {
|
|
5854
5967
|
const restrictedDomImport = testing ? restrictedDomImportRule(domPackage) : void 0;
|
|
5855
5968
|
return {
|
|
5969
|
+
"flawless/no-unnecessary-prop-alias": ["error", { reportConflicts: true }],
|
|
5856
5970
|
"flawless/no-unnecessary-use-callback": "error",
|
|
5857
5971
|
"flawless/no-unnecessary-use-memo": "error",
|
|
5858
5972
|
"flawless/purity": "error",
|
|
@@ -6261,8 +6375,6 @@ const SCRIPT_EXTENSIONS = [
|
|
|
6261
6375
|
"ts",
|
|
6262
6376
|
"tsx"
|
|
6263
6377
|
];
|
|
6264
|
-
/** The extensions of the Markdown files ESLint lints code blocks in. */
|
|
6265
|
-
const MARKDOWN_EXTENSIONS = ["md"];
|
|
6266
6378
|
const LEADING_DOT_SLASH = /^\.\//;
|
|
6267
6379
|
/** Set once a process has warned about a JS/TS width override. */
|
|
6268
6380
|
const WARNED_SCRIPT_OVERRIDE = Symbol.for("@isentinel/eslint-config/oxfmt-override-warned");
|
|
@@ -6302,42 +6414,9 @@ function findOxfmtConfig(cwd = process.cwd()) {
|
|
|
6302
6414
|
}
|
|
6303
6415
|
}
|
|
6304
6416
|
/**
|
|
6305
|
-
* The overrides that set `printWidth` or `tabWidth` for Markdown files.
|
|
6306
|
-
*
|
|
6307
|
-
* @param overrides - The config's `overrides`.
|
|
6308
|
-
* @returns Each such override's scope and widths, in order.
|
|
6309
|
-
*/
|
|
6310
|
-
function markdownOverridesOf(overrides) {
|
|
6311
|
-
if (!Array.isArray(overrides)) return [];
|
|
6312
|
-
return overrides.flatMap((override) => {
|
|
6313
|
-
if (!isRecord$1(override) || !overrideMatches(override, MARKDOWN_EXTENSIONS)) return [];
|
|
6314
|
-
const widths = widthsOf(override["options"]);
|
|
6315
|
-
return Object.keys(widths).length > 0 ? [{
|
|
6316
|
-
...scopeOf(override),
|
|
6317
|
-
widths
|
|
6318
|
-
}] : [];
|
|
6319
|
-
});
|
|
6320
|
-
}
|
|
6321
|
-
/**
|
|
6322
|
-
* Where an override applies: its `files`, minus its `excludeFiles` and any
|
|
6323
|
-
* negated glob in `files`.
|
|
6324
|
-
*
|
|
6325
|
-
* @param override - One override.
|
|
6326
|
-
* @returns Its scope.
|
|
6327
|
-
*/
|
|
6328
|
-
function scopeOf(override) {
|
|
6329
|
-
const strings = (value) => {
|
|
6330
|
-
return [value].flat().filter((glob) => typeof glob === "string");
|
|
6331
|
-
};
|
|
6332
|
-
const globs = strings(override["files"]);
|
|
6333
|
-
return {
|
|
6334
|
-
excludeFiles: [...strings(override["excludeFiles"]), ...globs.filter((glob) => glob.startsWith("!")).map((glob) => glob.slice(1))],
|
|
6335
|
-
files: globs.filter((glob) => !glob.startsWith("!"))
|
|
6336
|
-
};
|
|
6337
|
-
}
|
|
6338
|
-
/**
|
|
6339
6417
|
* Warn, at most once per process, about factory options that do not reach
|
|
6340
|
-
* standalone oxfmt: it formats with `oxfmt.config.ts` alone.
|
|
6418
|
+
* standalone oxfmt: it formats with `oxfmt.config.ts` alone. They still choose
|
|
6419
|
+
* which Markdown code blocks ESLint formats.
|
|
6341
6420
|
*
|
|
6342
6421
|
* @param options - The factory options.
|
|
6343
6422
|
* @param options.componentExts - Oxfmt formats only the extensions
|
|
@@ -6358,7 +6437,7 @@ function warnStandaloneOptions({ componentExts, formatters, gitignore, ignores }
|
|
|
6358
6437
|
].filter((name) => name !== void 0);
|
|
6359
6438
|
if (names.length > 0) {
|
|
6360
6439
|
state[WARNED_STANDALONE] = true;
|
|
6361
|
-
console.warn(`[@isentinel/eslint-config] With formatter: "standalone", oxfmt formats with oxfmt.config.ts alone, so these options do not change
|
|
6440
|
+
console.warn(`[@isentinel/eslint-config] With formatter: "standalone", oxfmt formats with oxfmt.config.ts alone, so these options do not change what oxfmt formats: ${names.join(", ")}. They change only which Markdown code blocks ESLint formats. Set the equivalent in isentinelOxfmt() (formatters, componentExts, ignorePatterns, format options).`);
|
|
6362
6441
|
}
|
|
6363
6442
|
}
|
|
6364
6443
|
/**
|
|
@@ -6471,26 +6550,26 @@ function mirrorsSection(override, sections) {
|
|
|
6471
6550
|
});
|
|
6472
6551
|
}
|
|
6473
6552
|
/**
|
|
6474
|
-
* Turn a loaded oxfmt config into `oxfmt/oxfmt` rule options
|
|
6475
|
-
*
|
|
6476
|
-
* and `overrides` are dropped from the options.
|
|
6553
|
+
* Turn a loaded oxfmt config into `oxfmt/oxfmt` rule options, its ignore
|
|
6554
|
+
* patterns and its overrides. The rule takes format options only, so
|
|
6555
|
+
* `$schema`, `ignorePatterns` and `overrides` are dropped from the options.
|
|
6477
6556
|
*
|
|
6478
6557
|
* @param config - The loaded config.
|
|
6479
6558
|
* @param config.$schema - Dropped.
|
|
6480
|
-
* @param config.ignorePatterns - Dropped; oxfmt applies them
|
|
6481
|
-
*
|
|
6482
|
-
*
|
|
6559
|
+
* @param config.ignorePatterns - Dropped from the options; oxfmt applies them
|
|
6560
|
+
* itself, except in Markdown code blocks.
|
|
6561
|
+
* @param config.overrides - Dropped from the options, after the width check.
|
|
6483
6562
|
* @param configPath - The config file, for the warning.
|
|
6484
|
-
* @returns The format options and
|
|
6563
|
+
* @returns The format options, ignore patterns and overrides.
|
|
6485
6564
|
*/
|
|
6486
|
-
function toResolvedConfig({ $schema: _schema, ignorePatterns
|
|
6565
|
+
function toResolvedConfig({ $schema: _schema, ignorePatterns, overrides, ...options }, configPath) {
|
|
6487
6566
|
const sections = editorConfigOverrides(path.dirname(configPath));
|
|
6488
6567
|
const list = Array.isArray(overrides) ? overrides : [];
|
|
6489
6568
|
const copied = list.filter((override) => mirrorsSection(override, sections));
|
|
6490
6569
|
warnScriptWidthOverrides(copied, ".editorconfig");
|
|
6491
6570
|
warnScriptWidthOverrides(list.filter((override) => !copied.includes(override)), path.basename(configPath));
|
|
6492
6571
|
return {
|
|
6493
|
-
|
|
6572
|
+
ignorePatterns: isStringArray(ignorePatterns) ? ignorePatterns : [],
|
|
6494
6573
|
options,
|
|
6495
6574
|
overrides: Array.isArray(overrides) ? overrides : []
|
|
6496
6575
|
};
|
|
@@ -6510,20 +6589,6 @@ function rcConfig(configPath, content) {
|
|
|
6510
6589
|
return toResolvedConfig(parsed, configPath);
|
|
6511
6590
|
}
|
|
6512
6591
|
/**
|
|
6513
|
-
* Pick `printWidth` and `tabWidth` out of a set of format options.
|
|
6514
|
-
*
|
|
6515
|
-
* @param options - Format options, of unknown shape.
|
|
6516
|
-
* @returns The widths it sets.
|
|
6517
|
-
*/
|
|
6518
|
-
function widthsOf(options) {
|
|
6519
|
-
if (!isRecord$1(options)) return {};
|
|
6520
|
-
const { printWidth, tabWidth } = options;
|
|
6521
|
-
return {
|
|
6522
|
-
...typeof printWidth === "number" ? { printWidth } : {},
|
|
6523
|
-
...typeof tabWidth === "number" ? { tabWidth } : {}
|
|
6524
|
-
};
|
|
6525
|
-
}
|
|
6526
|
-
/**
|
|
6527
6592
|
* Resolves the lowest Node major version a semver range can match.
|
|
6528
6593
|
*
|
|
6529
6594
|
* @param range - A semver range such as `>=24.12.0` or `^24 || ^26`.
|
|
@@ -7420,27 +7485,10 @@ function oxlintEslintPlugin(options = {}) {
|
|
|
7420
7485
|
//#endregion
|
|
7421
7486
|
//#region src/rules/flawless.ts
|
|
7422
7487
|
/**
|
|
7423
|
-
* Arrow return style rule on its own, for the Markdown code block override
|
|
7424
|
-
* where only the line width differs.
|
|
7425
|
-
*
|
|
7426
|
-
* @param options - Shared rule options.
|
|
7427
|
-
* @returns The rule map.
|
|
7428
|
-
*/
|
|
7429
|
-
function arrowStyleRules({ maxLen, maxLength, printWidth, tabWidth } = {}) {
|
|
7430
|
-
return { "flawless/arrow-return-style": ["error", {
|
|
7431
|
-
jsxAlwaysUseExplicitReturn: true,
|
|
7432
|
-
maxLen: maxLength ?? maxLen ?? printWidth ?? 100,
|
|
7433
|
-
maxObjectProperties: 2,
|
|
7434
|
-
namedExportsAlwaysUseExplicitReturn: true,
|
|
7435
|
-
objectReturnStyle: "complex-explicit",
|
|
7436
|
-
...tabWidth !== void 0 ? { tabWidth } : {},
|
|
7437
|
-
...printWidth !== void 0 ? { useOxfmt: { printWidth } } : {}
|
|
7438
|
-
}] };
|
|
7439
|
-
}
|
|
7440
|
-
/**
|
|
7441
7488
|
* Base (non-React) flawless rules shared between the ESLint and oxlint
|
|
7442
7489
|
* factories. The React flawless rules live in the react rule map; the
|
|
7443
|
-
* type-aware rules live in {@link flawlessTypeAwareRules}
|
|
7490
|
+
* type-aware rules live in {@link flawlessTypeAwareRules} and
|
|
7491
|
+
* {@link flawlessTypeAwareJsxRules}, plus the type-aware
|
|
7444
7492
|
* `flawless/naming-convention` in its own config; the test-only rules, and the
|
|
7445
7493
|
* non-JS `flawless/no-redundant-tsconfig-options`, `flawless/toml-*` and
|
|
7446
7494
|
* `flawless/yaml-*` rules are configured by their own configs.
|
|
@@ -7450,6 +7498,7 @@ function arrowStyleRules({ maxLen, maxLength, printWidth, tabWidth } = {}) {
|
|
|
7450
7498
|
*/
|
|
7451
7499
|
function flawlessRules({ antiSlop = false, roblox = true, stylistic = true, ...arrowOptions } = {}) {
|
|
7452
7500
|
return {
|
|
7501
|
+
"flawless/cognitive-complexity": ["warn", { threshold: 15 }],
|
|
7453
7502
|
"flawless/no-export-default-arrow": "error",
|
|
7454
7503
|
"flawless/no-floating-point-equality": "error",
|
|
7455
7504
|
...stylistic === false ? {} : {
|
|
@@ -7475,14 +7524,35 @@ function flawlessRules({ antiSlop = false, roblox = true, stylistic = true, ...a
|
|
|
7475
7524
|
*/
|
|
7476
7525
|
function antiSlopRules({ roblox = true }) {
|
|
7477
7526
|
return {
|
|
7527
|
+
"flawless/max-comment-length": ["error", { maximumWords: 50 }],
|
|
7478
7528
|
"flawless/no-conditional-empty-object-spread": "error",
|
|
7529
|
+
"flawless/no-em-dash": "error",
|
|
7479
7530
|
"flawless/no-known-value-widening": "error",
|
|
7480
7531
|
"flawless/no-object-parameters": "error",
|
|
7481
7532
|
"flawless/no-shape-in-symbol-names": "error",
|
|
7533
|
+
"flawless/no-trivial-functions": "error",
|
|
7534
|
+
"flawless/no-unknown-parameters": "error",
|
|
7482
7535
|
"flawless/no-unsafe-dictionary-type": "error",
|
|
7483
7536
|
...roblox ? {} : { "flawless/no-reflect-get": "error" }
|
|
7484
7537
|
};
|
|
7485
7538
|
}
|
|
7539
|
+
/**
|
|
7540
|
+
* The arrow return style rule.
|
|
7541
|
+
*
|
|
7542
|
+
* @param options - Shared rule options.
|
|
7543
|
+
* @returns The rule map.
|
|
7544
|
+
*/
|
|
7545
|
+
function arrowStyleRules({ maxLen, printWidth, tabWidth } = {}) {
|
|
7546
|
+
return { "flawless/arrow-return-style": ["error", {
|
|
7547
|
+
jsxAlwaysUseExplicitReturn: true,
|
|
7548
|
+
maxLen: maxLen ?? printWidth ?? 100,
|
|
7549
|
+
maxObjectProperties: 2,
|
|
7550
|
+
namedExportsAlwaysUseExplicitReturn: true,
|
|
7551
|
+
objectReturnStyle: "complex-explicit",
|
|
7552
|
+
...tabWidth !== void 0 ? { tabWidth } : {},
|
|
7553
|
+
...printWidth !== void 0 ? { useOxfmt: { printWidth } } : {}
|
|
7554
|
+
}] };
|
|
7555
|
+
}
|
|
7486
7556
|
//#endregion
|
|
7487
7557
|
//#region src/oxlint/configs/flawless.ts
|
|
7488
7558
|
function oxlintFlawless({ antiSlop = false, excludeFiles, roblox = true, stylistic = true } = {}, prettierOptions = {}) {
|
|
@@ -7633,6 +7703,21 @@ function oxlintImports({ excludeFiles, roblox = true, stylistic = true } = {}) {
|
|
|
7633
7703
|
}
|
|
7634
7704
|
//#endregion
|
|
7635
7705
|
//#region src/rules/javascript.ts
|
|
7706
|
+
/** `id-length` options shared by the ESLint rule and the native oxlint rule. */
|
|
7707
|
+
const ID_LENGTH_OPTIONS = {
|
|
7708
|
+
exceptions: [
|
|
7709
|
+
"_",
|
|
7710
|
+
"x",
|
|
7711
|
+
"y",
|
|
7712
|
+
"z",
|
|
7713
|
+
"a",
|
|
7714
|
+
"b",
|
|
7715
|
+
"e"
|
|
7716
|
+
],
|
|
7717
|
+
max: 30,
|
|
7718
|
+
min: 2,
|
|
7719
|
+
properties: "never"
|
|
7720
|
+
};
|
|
7636
7721
|
/**
|
|
7637
7722
|
* Core JavaScript rules shared between the ESLint and oxlint factories.
|
|
7638
7723
|
*
|
|
@@ -7837,20 +7922,6 @@ function javascriptRules({ isInEditor = false, roblox = true, stylistic = true }
|
|
|
7837
7922
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
7838
7923
|
"vars-on-top": "error",
|
|
7839
7924
|
...stylistic !== false ? {
|
|
7840
|
-
"id-length": ["error", {
|
|
7841
|
-
exceptions: [
|
|
7842
|
-
"_",
|
|
7843
|
-
"x",
|
|
7844
|
-
"y",
|
|
7845
|
-
"z",
|
|
7846
|
-
"a",
|
|
7847
|
-
"b",
|
|
7848
|
-
"e"
|
|
7849
|
-
],
|
|
7850
|
-
max: 30,
|
|
7851
|
-
min: 2,
|
|
7852
|
-
properties: "never"
|
|
7853
|
-
}],
|
|
7854
7925
|
"max-lines": ["warn", {
|
|
7855
7926
|
max: 300,
|
|
7856
7927
|
skipBlankLines: true,
|
|
@@ -7877,7 +7948,15 @@ function javascriptRules({ isInEditor = false, roblox = true, stylistic = true }
|
|
|
7877
7948
|
function oxlintJavascript(options = {}) {
|
|
7878
7949
|
const { excludeFiles, isInEditor = false, overrides = {}, roblox = true, stylistic = true } = options;
|
|
7879
7950
|
const files = options.files?.flat() ?? ["**/*.{,c,m}[jt]s{,x}"];
|
|
7880
|
-
return
|
|
7951
|
+
return [...stylistic !== false ? [{
|
|
7952
|
+
name: "isentinel/javascript/oxlint",
|
|
7953
|
+
...excludeFiles ? { excludeFiles } : {},
|
|
7954
|
+
files,
|
|
7955
|
+
rules: { "id-length": ["error", {
|
|
7956
|
+
...ID_LENGTH_OPTIONS,
|
|
7957
|
+
checkGeneric: false
|
|
7958
|
+
}] }
|
|
7959
|
+
}] : [], ...createOxlintConfigs({
|
|
7881
7960
|
name: "isentinel/javascript",
|
|
7882
7961
|
...excludeFiles ? { excludeFiles } : {},
|
|
7883
7962
|
files,
|
|
@@ -7895,7 +7974,7 @@ function oxlintJavascript(options = {}) {
|
|
|
7895
7974
|
roblox,
|
|
7896
7975
|
stylistic
|
|
7897
7976
|
})
|
|
7898
|
-
});
|
|
7977
|
+
})];
|
|
7899
7978
|
}
|
|
7900
7979
|
function toGlobals(source, override) {
|
|
7901
7980
|
const result = {};
|
|
@@ -8795,7 +8874,6 @@ function oxlintSmallRules(options = {}) {
|
|
|
8795
8874
|
function sonarjsRules({ isInEditor, roblox = true }) {
|
|
8796
8875
|
return {
|
|
8797
8876
|
"sonar/bool-param-default": "error",
|
|
8798
|
-
"sonar/cognitive-complexity": "warn",
|
|
8799
8877
|
"sonar/constructor-for-side-effects": "error",
|
|
8800
8878
|
"sonar/destructuring-assignment-syntax": "error",
|
|
8801
8879
|
"sonar/elseif-without-else": "off",
|
|
@@ -8811,12 +8889,10 @@ function sonarjsRules({ isInEditor, roblox = true }) {
|
|
|
8811
8889
|
"sonar/no-duplicated-branches": "error",
|
|
8812
8890
|
"sonar/no-element-overwrite": "error",
|
|
8813
8891
|
"sonar/no-empty-collection": "error",
|
|
8814
|
-
"sonar/no-floating-point-equality": "error",
|
|
8815
8892
|
"sonar/no-gratuitous-expressions": "off",
|
|
8816
8893
|
"sonar/no-identical-conditions": "error",
|
|
8817
8894
|
"sonar/no-identical-expressions": "error",
|
|
8818
8895
|
"sonar/no-identical-functions": "error",
|
|
8819
|
-
"sonar/no-ignored-return": "error",
|
|
8820
8896
|
"sonar/no-inverted-boolean-check": "error",
|
|
8821
8897
|
"sonar/no-nested-conditional": "error",
|
|
8822
8898
|
"sonar/no-nested-incdec": "error",
|
|
@@ -8862,7 +8938,6 @@ function sonarjsRules({ isInEditor, roblox = true }) {
|
|
|
8862
8938
|
*/
|
|
8863
8939
|
function sonarjsTestRules({ jest = false, roblox = true } = {}) {
|
|
8864
8940
|
return {
|
|
8865
|
-
"sonar/no-incompatible-assertion-types": "error",
|
|
8866
8941
|
...jest ? {
|
|
8867
8942
|
"sonar/no-mixed-completion-style": "error",
|
|
8868
8943
|
"sonar/synchronous-suite-callback": "error"
|
|
@@ -8937,13 +9012,12 @@ function oxlintSpelling(options = {}) {
|
|
|
8937
9012
|
* @param options - Resolved stylistic options.
|
|
8938
9013
|
* @returns The rule map.
|
|
8939
9014
|
*/
|
|
8940
|
-
function stylisticRules({
|
|
9015
|
+
function stylisticRules({ quotes = "double" } = {}) {
|
|
8941
9016
|
return {
|
|
8942
9017
|
"antfu/consistent-list-newline": "off",
|
|
8943
9018
|
"antfu/if-newline": "off",
|
|
8944
9019
|
"antfu/top-level-function": "error",
|
|
8945
9020
|
"curly": ["error", "all"],
|
|
8946
|
-
...jsx ? { "style/jsx-curly-brace-presence": ["error", { propElementValues: "always" }] } : {},
|
|
8947
9021
|
"style/lines-between-class-members": ["error", { enforce: [{
|
|
8948
9022
|
blankLine: "always",
|
|
8949
9023
|
next: "method",
|
|
@@ -8994,14 +9068,29 @@ function stylisticRules({ jsx = true, quotes = "double" } = {}) {
|
|
|
8994
9068
|
]
|
|
8995
9069
|
};
|
|
8996
9070
|
}
|
|
9071
|
+
/**
|
|
9072
|
+
* JSX-specific stylistic rules shared between the ESLint and oxlint factories.
|
|
9073
|
+
* Scoped to JSX/TSX files: a `.ts` or `.js` file cannot contain JSX, so the
|
|
9074
|
+
* rules would only cost a traversal there.
|
|
9075
|
+
*
|
|
9076
|
+
* @param options - Resolved stylistic options.
|
|
9077
|
+
* @returns The rule map.
|
|
9078
|
+
*/
|
|
9079
|
+
function stylisticJsxRules({ jsx = true } = {}) {
|
|
9080
|
+
return jsx ? { "style/jsx-curly-brace-presence": ["error", { propElementValues: "always" }] } : {};
|
|
9081
|
+
}
|
|
8997
9082
|
//#endregion
|
|
8998
9083
|
//#region src/oxlint/configs/stylistic.ts
|
|
8999
9084
|
function oxlintStylistic(options = {}) {
|
|
9000
|
-
return createOxlintConfigs({
|
|
9085
|
+
return [...createOxlintConfigs({
|
|
9001
9086
|
name: "isentinel/stylistic",
|
|
9002
9087
|
files: [GLOB_SRC],
|
|
9003
9088
|
rules: stylisticRules(options)
|
|
9004
|
-
})
|
|
9089
|
+
}), ...createOxlintConfigs({
|
|
9090
|
+
name: "isentinel/stylistic/jsx",
|
|
9091
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
9092
|
+
rules: stylisticJsxRules(options)
|
|
9093
|
+
})];
|
|
9005
9094
|
}
|
|
9006
9095
|
//#endregion
|
|
9007
9096
|
//#region src/rules/test.ts
|
|
@@ -9054,6 +9143,7 @@ function jestExtendedRules() {
|
|
|
9054
9143
|
*/
|
|
9055
9144
|
function jestRules({ extended = false, isInEditor = false, roblox: isRoblox = true, stylistic = true } = {}) {
|
|
9056
9145
|
return {
|
|
9146
|
+
"flawless/no-incompatible-assertion-types": "error",
|
|
9057
9147
|
"flawless/no-shared-mocks": "error",
|
|
9058
9148
|
"flawless/prefer-expect-assertions-count": "error",
|
|
9059
9149
|
"jest/consistent-test-it": "error",
|
|
@@ -9133,6 +9223,7 @@ function jestRules({ extended = false, isInEditor = false, roblox: isRoblox = tr
|
|
|
9133
9223
|
function vitestRules({ extended = false, isInEditor = false, stylistic = true } = {}) {
|
|
9134
9224
|
return {
|
|
9135
9225
|
"flawless/no-conditional-in-test": ["error", { allowOptionalChaining: false }],
|
|
9226
|
+
"flawless/no-incompatible-assertion-types": "error",
|
|
9136
9227
|
"flawless/no-shared-mocks": "error",
|
|
9137
9228
|
"flawless/prefer-ending-with-an-expect": ["warn", { assertFunctionNames: [
|
|
9138
9229
|
"expect",
|
|
@@ -9554,7 +9645,7 @@ function oxlintTypescript(options = {}) {
|
|
|
9554
9645
|
];
|
|
9555
9646
|
const typeAwareRules = typescriptTypeAwareRules({ roblox }) ?? {};
|
|
9556
9647
|
const gatedTypeAwareRules = typeAware ? typeAwareRules : Object.fromEntries(Object.entries(typeAwareRules).filter(([rule]) => !runsInTsgolint(rule)));
|
|
9557
|
-
return createOxlintConfigs({
|
|
9648
|
+
return [...createOxlintConfigs({
|
|
9558
9649
|
name: "isentinel/typescript",
|
|
9559
9650
|
...excludeFiles ? { excludeFiles } : {},
|
|
9560
9651
|
files,
|
|
@@ -9566,7 +9657,16 @@ function oxlintTypescript(options = {}) {
|
|
|
9566
9657
|
...gatedTypeAwareRules,
|
|
9567
9658
|
...erasableOnly ? erasableSyntaxOnlyRules() : {}
|
|
9568
9659
|
}
|
|
9569
|
-
})
|
|
9660
|
+
}), ...typeAware ? [{
|
|
9661
|
+
name: "isentinel/typescript/oxlint",
|
|
9662
|
+
...excludeFiles ? { excludeFiles } : {},
|
|
9663
|
+
files,
|
|
9664
|
+
plugins: ["typescript"],
|
|
9665
|
+
rules: {
|
|
9666
|
+
"typescript/no-generated-empty-object-type": "error",
|
|
9667
|
+
"typescript/no-unsafe-enum-assignment": "error"
|
|
9668
|
+
}
|
|
9669
|
+
}] : []];
|
|
9570
9670
|
}
|
|
9571
9671
|
//#endregion
|
|
9572
9672
|
//#region src/rules/unicorn.ts
|