@isentinel/eslint-config 6.0.0-beta.27 → 6.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -0
- package/dist/lint-cli.mjs +1 -1
- package/dist/oxlint.d.mts +11 -0
- package/dist/oxlint.mjs +173 -54
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import path from "node:path";
|
|
|
9
9
|
import { existsSync, readFileSync } from "fs";
|
|
10
10
|
import { execSync } from "node:child_process";
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "6.0.0-beta.
|
|
12
|
+
var version = "6.0.0-beta.28";
|
|
13
13
|
var package_default = {
|
|
14
14
|
name: "@isentinel/eslint-config",
|
|
15
15
|
version,
|
package/dist/index.mjs
CHANGED
|
@@ -15662,6 +15662,7 @@ const oxlintRuleMapping = {
|
|
|
15662
15662
|
"vitest/no-hooks": "native",
|
|
15663
15663
|
"vitest/no-identical-title": "native",
|
|
15664
15664
|
"vitest/no-import-node-test": "native",
|
|
15665
|
+
"vitest/no-importing-vitest-globals": "native",
|
|
15665
15666
|
"vitest/no-interpolation-in-snapshots": "native",
|
|
15666
15667
|
"vitest/no-large-snapshots": "native",
|
|
15667
15668
|
"vitest/no-mocks-import": "native",
|
package/dist/lint-cli.mjs
CHANGED
|
@@ -36,7 +36,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
}) : target, mod));
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region package.json
|
|
39
|
-
var version = "6.0.0-beta.
|
|
39
|
+
var version = "6.0.0-beta.28";
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/lint-cli/lib/cli/types.ts
|
|
42
42
|
/**
|
package/dist/oxlint.d.mts
CHANGED
|
@@ -32538,6 +32538,17 @@ type OxlintFactoryOptions = {
|
|
|
32538
32538
|
* see no effect from this option.
|
|
32539
32539
|
*/
|
|
32540
32540
|
oxc?: boolean;
|
|
32541
|
+
/**
|
|
32542
|
+
* Warn about `overrides` entries oxlint cannot apply. Defaults to `true`.
|
|
32543
|
+
*
|
|
32544
|
+
* An override is authoritative: it applies at the scope its config option
|
|
32545
|
+
* covers whether or not the preset enables the rule. A few cannot be
|
|
32546
|
+
* honoured — a rule that needs type information oxlint has no jsPlugin
|
|
32547
|
+
* route for, a plugin that is not installed, or one dropped by
|
|
32548
|
+
* `jsPlugins: false` — and those are reported rather than discarded in
|
|
32549
|
+
* silence.
|
|
32550
|
+
*/
|
|
32551
|
+
warnDroppedOverrides?: boolean;
|
|
32541
32552
|
} & Omit<TypedOxlintConfigItem, "files" | "jsPlugins"> & OxlintOptionsConfig;
|
|
32542
32553
|
//#endregion
|
|
32543
32554
|
//#region src/oxlint/factory.d.ts
|
package/dist/oxlint.mjs
CHANGED
|
@@ -1523,6 +1523,7 @@ const oxlintRuleMapping = {
|
|
|
1523
1523
|
"vitest/no-hooks": "native",
|
|
1524
1524
|
"vitest/no-identical-title": "native",
|
|
1525
1525
|
"vitest/no-import-node-test": "native",
|
|
1526
|
+
"vitest/no-importing-vitest-globals": "native",
|
|
1526
1527
|
"vitest/no-interpolation-in-snapshots": "native",
|
|
1527
1528
|
"vitest/no-large-snapshots": "native",
|
|
1528
1529
|
"vitest/no-mocks-import": "native",
|
|
@@ -1772,6 +1773,18 @@ function isOxlintCovered(rule) {
|
|
|
1772
1773
|
return rule in oxlintRuleMapping || rule in oxcCoveredRules;
|
|
1773
1774
|
}
|
|
1774
1775
|
/**
|
|
1776
|
+
* Whether the rule's oxlint side is a differently-named native oxc rule, which
|
|
1777
|
+
* {@link translateRuleToOxlint} resolves. Such rules are in
|
|
1778
|
+
* {@link excludedFromOxlint} so the preset never emits both halves, but a user
|
|
1779
|
+
* override naming one still has somewhere to go.
|
|
1780
|
+
*
|
|
1781
|
+
* @param rule - The canonical ESLint rule name.
|
|
1782
|
+
* @returns Whether an oxc rule covers the rule under another name.
|
|
1783
|
+
*/
|
|
1784
|
+
function isOxcCoveredRule(rule) {
|
|
1785
|
+
return rule in oxcCoveredRules;
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1775
1788
|
* Whether the rule runs via oxlint-tsgolint (`oxlint --type-aware`); such rules
|
|
1776
1789
|
* are noise without type information, so they are gated on `typeAware`.
|
|
1777
1790
|
*
|
|
@@ -2660,6 +2673,76 @@ function commentLengthRules({ maxLength, multiLineMaxLength, semanticComments, t
|
|
|
2660
2673
|
};
|
|
2661
2674
|
}
|
|
2662
2675
|
//#endregion
|
|
2676
|
+
//#region src/oxlint/override-diagnostics.ts
|
|
2677
|
+
const REASON_TEXT = {
|
|
2678
|
+
"eslint-only": "oxlint cannot run this rule; it stays in ESLint",
|
|
2679
|
+
"missing-plugin": "the plugin that owns it is not installed",
|
|
2680
|
+
"native-only": "it needs a jsPlugin, and `jsPlugins: false` is set"
|
|
2681
|
+
};
|
|
2682
|
+
/**
|
|
2683
|
+
* Override diagnostics for the config build in progress: the entries that never
|
|
2684
|
+
* reached the generated config, and the oxlint names of the ones that did.
|
|
2685
|
+
*
|
|
2686
|
+
* The splitter runs deep inside the config modules, which return config
|
|
2687
|
+
* fragments and have no channel for diagnostics — and an override can be
|
|
2688
|
+
* dropped without leaving a fragment behind at all. The factory drains both
|
|
2689
|
+
* buffers per build, which is safe because it builds synchronously from start
|
|
2690
|
+
* to finish.
|
|
2691
|
+
*/
|
|
2692
|
+
const droppedOverrides = [];
|
|
2693
|
+
const overrideRules = /* @__PURE__ */ new Set();
|
|
2694
|
+
/**
|
|
2695
|
+
* Record an override that never reached the generated config.
|
|
2696
|
+
*
|
|
2697
|
+
* @param entry - The dropped override and the reason it was dropped.
|
|
2698
|
+
*/
|
|
2699
|
+
function recordDroppedOverride(entry) {
|
|
2700
|
+
droppedOverrides.push(entry);
|
|
2701
|
+
}
|
|
2702
|
+
/**
|
|
2703
|
+
* Record the oxlint names of overrides that made it into a fragment, so a later
|
|
2704
|
+
* pass that deletes rules (native-only mode) can tell a user's entry from the
|
|
2705
|
+
* preset's.
|
|
2706
|
+
*
|
|
2707
|
+
* @param rules - The oxlint rule names.
|
|
2708
|
+
*/
|
|
2709
|
+
function recordOverrideRules(rules) {
|
|
2710
|
+
for (const rule of rules) overrideRules.add(rule);
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* Take everything recorded since the last call, emptying both buffers.
|
|
2714
|
+
*
|
|
2715
|
+
* @returns The dropped overrides (deduplicated by rule and reason) and the
|
|
2716
|
+
* oxlint names of the overrides that were emitted.
|
|
2717
|
+
*/
|
|
2718
|
+
function takeOverrideDiagnostics() {
|
|
2719
|
+
const taken = droppedOverrides.splice(0);
|
|
2720
|
+
const emitted = new Set(overrideRules);
|
|
2721
|
+
overrideRules.clear();
|
|
2722
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2723
|
+
return {
|
|
2724
|
+
dropped: taken.filter(({ reason, rule }) => {
|
|
2725
|
+
const key = `${rule} ${reason}`;
|
|
2726
|
+
if (seen.has(key)) return false;
|
|
2727
|
+
seen.add(key);
|
|
2728
|
+
return true;
|
|
2729
|
+
}),
|
|
2730
|
+
emitted
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* Warn about `overrides` entries that could not be applied. An override is a
|
|
2735
|
+
* deliberate instruction, so a silently discarded one leaves a rule reporting
|
|
2736
|
+
* (or not reporting) with no way to tell why.
|
|
2737
|
+
*
|
|
2738
|
+
* @param entries - What was dropped, and why; an empty list warns nothing.
|
|
2739
|
+
*/
|
|
2740
|
+
function warnDroppedOverrides(entries) {
|
|
2741
|
+
if (entries.length === 0) return;
|
|
2742
|
+
const lines = entries.map(({ reason, rule }) => ` - "${rule}": ${REASON_TEXT[reason]}`);
|
|
2743
|
+
console.warn(`[@isentinel/eslint-config] These \`overrides\` entries could not be applied to oxlint:\n${lines.join("\n")}`);
|
|
2744
|
+
}
|
|
2745
|
+
//#endregion
|
|
2663
2746
|
//#region src/oxlint/utils.ts
|
|
2664
2747
|
/**
|
|
2665
2748
|
* Every plugin oxlint implements natively, derived from the generated rule
|
|
@@ -2681,6 +2764,7 @@ function isNativePlugin(prefix) {
|
|
|
2681
2764
|
*/
|
|
2682
2765
|
const consumerAnchor = pathToFileURL(`${process.cwd()}/`).href;
|
|
2683
2766
|
const specifierCache = /* @__PURE__ */ new Map();
|
|
2767
|
+
const NO_OVERRIDES = /* @__PURE__ */ new Set();
|
|
2684
2768
|
/**
|
|
2685
2769
|
* Resolve a jsPlugin specifier, throwing when the package is not installed.
|
|
2686
2770
|
*
|
|
@@ -2785,16 +2869,22 @@ function scopeOverridePlugins(overrides, globalPlugins) {
|
|
|
2785
2869
|
*
|
|
2786
2870
|
* @param overrides - The merged overrides (mutated).
|
|
2787
2871
|
* @param registeredPlugins - Every native plugin and jsPlugin name registered.
|
|
2872
|
+
* @returns The oxlint names of the rules that were deleted.
|
|
2788
2873
|
*/
|
|
2789
2874
|
function stripUnregisteredPluginRules(overrides, registeredPlugins) {
|
|
2875
|
+
const stripped = /* @__PURE__ */ new Set();
|
|
2790
2876
|
for (const override of overrides) {
|
|
2791
2877
|
const { rules } = override;
|
|
2792
2878
|
if (rules === void 0) continue;
|
|
2793
2879
|
for (const rule of Object.keys(rules)) {
|
|
2794
2880
|
const slashIndex = rule.indexOf("/");
|
|
2795
|
-
if (slashIndex !== -1 && !registeredPlugins.has(rule.slice(0, slashIndex)))
|
|
2881
|
+
if (slashIndex !== -1 && !registeredPlugins.has(rule.slice(0, slashIndex))) {
|
|
2882
|
+
delete rules[rule];
|
|
2883
|
+
stripped.add(rule);
|
|
2884
|
+
}
|
|
2796
2885
|
}
|
|
2797
2886
|
}
|
|
2887
|
+
return stripped;
|
|
2798
2888
|
}
|
|
2799
2889
|
/**
|
|
2800
2890
|
* Split a canonical (ESLint-named) rule map into oxlint-native rules and
|
|
@@ -2804,22 +2894,32 @@ function stripUnregisteredPluginRules(overrides, registeredPlugins) {
|
|
|
2804
2894
|
* rules, which only run in standalone mode) are treated as jsPlugin rules.
|
|
2805
2895
|
* Disabled unmapped rules are skipped so that no jsPlugin is loaded solely for
|
|
2806
2896
|
* an "off" entry, unless `keepUnmappedOff` is set (user options.rules must not
|
|
2807
|
-
* silently discard an explicit disable)
|
|
2897
|
+
* silently discard an explicit disable) or the entry is a user override, which
|
|
2898
|
+
* is authoritative.
|
|
2808
2899
|
*
|
|
2809
2900
|
* @param rules - The canonical rule map.
|
|
2810
|
-
* @param
|
|
2811
|
-
*
|
|
2901
|
+
* @param options - Which entries survive the filters, and which came from the
|
|
2902
|
+
* user.
|
|
2812
2903
|
* @returns The split rules with the plugins each side requires.
|
|
2813
2904
|
*/
|
|
2814
|
-
function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
2905
|
+
function splitOxlintRules(rules, { keepUnmappedOff = false, overrides = NO_OVERRIDES } = {}) {
|
|
2815
2906
|
const nativeRules = {};
|
|
2816
2907
|
const jsPluginRules = {};
|
|
2817
2908
|
const nativePlugins = /* @__PURE__ */ new Set();
|
|
2818
2909
|
const jsPluginPrefixes = /* @__PURE__ */ new Set();
|
|
2819
2910
|
const tsCollapsed = /* @__PURE__ */ new Set();
|
|
2911
|
+
const overrideRules = /* @__PURE__ */ new Set();
|
|
2820
2912
|
const entries = Object.entries(rules ?? {});
|
|
2821
2913
|
for (const [rule, value] of entries) {
|
|
2822
|
-
if (value === void 0
|
|
2914
|
+
if (value === void 0) continue;
|
|
2915
|
+
const isOverride = overrides.has(rule);
|
|
2916
|
+
if (excludedFromOxlint.has(rule) && (!isOverride || !isOxcCoveredRule(rule))) {
|
|
2917
|
+
if (isOverride) recordDroppedOverride({
|
|
2918
|
+
reason: "eslint-only",
|
|
2919
|
+
rule
|
|
2920
|
+
});
|
|
2921
|
+
continue;
|
|
2922
|
+
}
|
|
2823
2923
|
const covered = isOxlintCovered(rule);
|
|
2824
2924
|
const severity = Array.isArray(value) ? value[0] : value;
|
|
2825
2925
|
const isOff = severity === "off" || severity === 0;
|
|
@@ -2827,7 +2927,8 @@ function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
|
2827
2927
|
const slashIndex = translated.indexOf("/");
|
|
2828
2928
|
const prefix = slashIndex === -1 ? "eslint" : translated.slice(0, slashIndex);
|
|
2829
2929
|
const nativePrefix = isNativePlugin(prefix) ? prefix : void 0;
|
|
2830
|
-
if (
|
|
2930
|
+
if (isOverride) overrideRules.add(translated);
|
|
2931
|
+
if (!covered && isOff && (keepUnmappedOff || isOverride)) {
|
|
2831
2932
|
if (nativePrefix !== void 0) {
|
|
2832
2933
|
nativeRules[translated] = value;
|
|
2833
2934
|
nativePlugins.add(nativePrefix);
|
|
@@ -2836,7 +2937,10 @@ function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
|
2836
2937
|
if (specifier !== void 0 && canResolveJsPlugin(specifier)) {
|
|
2837
2938
|
jsPluginRules[translated] = value;
|
|
2838
2939
|
jsPluginPrefixes.add(prefix);
|
|
2839
|
-
}
|
|
2940
|
+
} else if (isOverride) recordDroppedOverride({
|
|
2941
|
+
reason: "missing-plugin",
|
|
2942
|
+
rule
|
|
2943
|
+
});
|
|
2840
2944
|
}
|
|
2841
2945
|
continue;
|
|
2842
2946
|
}
|
|
@@ -2846,10 +2950,11 @@ function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
|
2846
2950
|
jsPluginPrefixes.add(prefix);
|
|
2847
2951
|
continue;
|
|
2848
2952
|
}
|
|
2953
|
+
if (!isOverride && overrideRules.has(translated) && (collapsesToTsCoreRule(rule) || isTsCoreCounterpartRule(rule))) continue;
|
|
2849
2954
|
if (collapsesToTsCoreRule(rule)) {
|
|
2850
2955
|
tsCollapsed.add(translated);
|
|
2851
2956
|
nativeRules[translated] = value;
|
|
2852
|
-
} else if (!isTsCoreCounterpartRule(rule) || !tsCollapsed.has(translated)) nativeRules[translated] = value;
|
|
2957
|
+
} else if (isOverride || !isTsCoreCounterpartRule(rule) || !tsCollapsed.has(translated)) nativeRules[translated] = value;
|
|
2853
2958
|
if (nativePrefix !== void 0) nativePlugins.add(nativePrefix);
|
|
2854
2959
|
}
|
|
2855
2960
|
const jsPlugins = [];
|
|
@@ -2865,7 +2970,8 @@ function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
|
2865
2970
|
jsPluginRules,
|
|
2866
2971
|
jsPlugins,
|
|
2867
2972
|
nativePlugins: [...nativePlugins],
|
|
2868
|
-
nativeRules
|
|
2973
|
+
nativeRules,
|
|
2974
|
+
overrideRules: [...overrideRules]
|
|
2869
2975
|
};
|
|
2870
2976
|
}
|
|
2871
2977
|
/**
|
|
@@ -2875,8 +2981,15 @@ function splitOxlintRules(rules, keepUnmappedOff = false) {
|
|
|
2875
2981
|
* @param options - The fragment options.
|
|
2876
2982
|
* @returns The generated config fragments.
|
|
2877
2983
|
*/
|
|
2878
|
-
function createOxlintConfigs({ name, excludeFiles, files, globals, keepUnmappedOff = false, rules, settings }) {
|
|
2879
|
-
const { jsPluginRules, jsPlugins, nativePlugins, nativeRules } = splitOxlintRules(rules
|
|
2984
|
+
function createOxlintConfigs({ name, excludeFiles, files, globals, keepUnmappedOff = false, overrides, rules, settings }) {
|
|
2985
|
+
const { jsPluginRules, jsPlugins, nativePlugins, nativeRules, overrideRules } = splitOxlintRules(overrides === void 0 ? rules : {
|
|
2986
|
+
...rules,
|
|
2987
|
+
...overrides
|
|
2988
|
+
}, {
|
|
2989
|
+
keepUnmappedOff,
|
|
2990
|
+
overrides: new Set(Object.keys(overrides ?? {}))
|
|
2991
|
+
});
|
|
2992
|
+
recordOverrideRules(overrideRules);
|
|
2880
2993
|
const fragments = [];
|
|
2881
2994
|
if (Object.keys(nativeRules).length > 0) fragments.push({
|
|
2882
2995
|
name,
|
|
@@ -3295,14 +3408,12 @@ function oxlintE18e({ excludeFiles, files = [GLOB_SRC], modernization = true, no
|
|
|
3295
3408
|
name: "isentinel/e18e",
|
|
3296
3409
|
...excludeFiles ? { excludeFiles } : {},
|
|
3297
3410
|
files: files.flat(),
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
...overrides
|
|
3305
|
-
}
|
|
3411
|
+
overrides,
|
|
3412
|
+
rules: e18eRules({
|
|
3413
|
+
modernization,
|
|
3414
|
+
nodeMajor,
|
|
3415
|
+
performanceImprovements
|
|
3416
|
+
})
|
|
3306
3417
|
}), ...createOxlintConfigs({
|
|
3307
3418
|
name: "isentinel/e18e/disables/test",
|
|
3308
3419
|
files: [...GLOB_TESTS],
|
|
@@ -3365,10 +3476,8 @@ function oxlintEslintPlugin(options = {}) {
|
|
|
3365
3476
|
return createOxlintConfigs({
|
|
3366
3477
|
name: "isentinel/eslint-plugin",
|
|
3367
3478
|
files: options.files?.flat() ?? ["**/*.{,c,m}[jt]s{,x}"],
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
...overrides
|
|
3371
|
-
}
|
|
3479
|
+
overrides,
|
|
3480
|
+
rules: eslintPluginRules()
|
|
3372
3481
|
});
|
|
3373
3482
|
}
|
|
3374
3483
|
//#endregion
|
|
@@ -3817,14 +3926,12 @@ function oxlintJavascript(options = {}) {
|
|
|
3817
3926
|
navigator: "readonly",
|
|
3818
3927
|
window: "readonly"
|
|
3819
3928
|
},
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
...overrides
|
|
3827
|
-
}
|
|
3929
|
+
overrides,
|
|
3930
|
+
rules: javascriptRules({
|
|
3931
|
+
isInEditor,
|
|
3932
|
+
roblox,
|
|
3933
|
+
stylistic
|
|
3934
|
+
})
|
|
3828
3935
|
});
|
|
3829
3936
|
}
|
|
3830
3937
|
function toGlobals(source, override) {
|
|
@@ -4608,14 +4715,12 @@ function oxlintReact(options = {}) {
|
|
|
4608
4715
|
return [...createOxlintConfigs({
|
|
4609
4716
|
name: "isentinel/react",
|
|
4610
4717
|
files,
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
...overrides
|
|
4618
|
-
},
|
|
4718
|
+
overrides,
|
|
4719
|
+
rules: reactRules({
|
|
4720
|
+
filenameCase,
|
|
4721
|
+
reactCompiler,
|
|
4722
|
+
stylistic
|
|
4723
|
+
}),
|
|
4619
4724
|
settings: { "react-x": {
|
|
4620
4725
|
importSource: importSource ?? "@rbxts",
|
|
4621
4726
|
version: "17.0.2"
|
|
@@ -4681,10 +4786,8 @@ function oxlintRoblox(options = {}) {
|
|
|
4681
4786
|
"**/*/*.{,c,m}tsx",
|
|
4682
4787
|
...componentExtensions.map((extension) => `**/*/*.${extension}`)
|
|
4683
4788
|
],
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
...overrides
|
|
4687
|
-
}
|
|
4789
|
+
overrides,
|
|
4790
|
+
rules: robloxRules({ stylistic })
|
|
4688
4791
|
});
|
|
4689
4792
|
}
|
|
4690
4793
|
//#endregion
|
|
@@ -5189,6 +5292,10 @@ function oxlintTest({ files = GLOB_TESTS, isInEditor = false, jest = false, over
|
|
|
5189
5292
|
if (enableJest) configs.push(...createOxlintConfigs({
|
|
5190
5293
|
name: "isentinel/test/jest",
|
|
5191
5294
|
files: jestOptions.files?.flat() ?? files.flat(),
|
|
5295
|
+
overrides: {
|
|
5296
|
+
...overrides,
|
|
5297
|
+
...jestOptions.overrides
|
|
5298
|
+
},
|
|
5192
5299
|
rules: {
|
|
5193
5300
|
...jestRules({
|
|
5194
5301
|
extended: jestOptions.extended === true,
|
|
@@ -5199,9 +5306,7 @@ function oxlintTest({ files = GLOB_TESTS, isInEditor = false, jest = false, over
|
|
|
5199
5306
|
...sonarjsTestRules({
|
|
5200
5307
|
jest: true,
|
|
5201
5308
|
roblox: isRoblox
|
|
5202
|
-
})
|
|
5203
|
-
...overrides,
|
|
5204
|
-
...jestOptions.overrides
|
|
5309
|
+
})
|
|
5205
5310
|
},
|
|
5206
5311
|
settings: { jest: {
|
|
5207
5312
|
globalPackage: "@rbxts/jest-globals",
|
|
@@ -5216,15 +5321,17 @@ function oxlintTest({ files = GLOB_TESTS, isInEditor = false, jest = false, over
|
|
|
5216
5321
|
if (enableVitest) configs.push(...createOxlintConfigs({
|
|
5217
5322
|
name: "isentinel/test/vitest",
|
|
5218
5323
|
files: vitestOptions.files?.flat() ?? files.flat(),
|
|
5324
|
+
overrides: {
|
|
5325
|
+
...overrides,
|
|
5326
|
+
...vitestOptions.overrides
|
|
5327
|
+
},
|
|
5219
5328
|
rules: {
|
|
5220
5329
|
...vitestRules({
|
|
5221
5330
|
extended: vitestOptions.extended === true,
|
|
5222
5331
|
isInEditor,
|
|
5223
5332
|
stylistic
|
|
5224
5333
|
}),
|
|
5225
|
-
...sonarjsTestRules({ roblox: isRoblox })
|
|
5226
|
-
...overrides,
|
|
5227
|
-
...vitestOptions.overrides
|
|
5334
|
+
...sonarjsTestRules({ roblox: isRoblox })
|
|
5228
5335
|
},
|
|
5229
5336
|
settings: { vitest: { typecheck: vitestOptions.typecheck ?? false } }
|
|
5230
5337
|
}), ...createOxlintConfigs({
|
|
@@ -5495,13 +5602,13 @@ function oxlintTypescript(options = {}) {
|
|
|
5495
5602
|
name: "isentinel/typescript",
|
|
5496
5603
|
...excludeFiles ? { excludeFiles } : {},
|
|
5497
5604
|
files,
|
|
5605
|
+
overrides,
|
|
5498
5606
|
rules: {
|
|
5499
5607
|
...typescriptRecommendedOverrides(),
|
|
5500
5608
|
...typescriptStrictPresetRules(),
|
|
5501
5609
|
...typescriptRules({ stylistic }),
|
|
5502
5610
|
...gatedTypeAwareRules,
|
|
5503
|
-
...erasableOnly ? erasableSyntaxOnlyRules() : {}
|
|
5504
|
-
...overrides
|
|
5611
|
+
...erasableOnly ? erasableSyntaxOnlyRules() : {}
|
|
5505
5612
|
}
|
|
5506
5613
|
});
|
|
5507
5614
|
}
|
|
@@ -5753,7 +5860,7 @@ const NATIVE_ONLY_JS_PLUGINS = /* @__PURE__ */ new Set(["oxlint-comments"]);
|
|
|
5753
5860
|
*/
|
|
5754
5861
|
function isentinel(factoryOptions, ...userConfigs) {
|
|
5755
5862
|
const options = factoryOptions ?? { name: "isentinel" };
|
|
5756
|
-
const { categories, componentExts: componentExtensions = [], e18e: enableE18e = true, env, eslintPlugin: enableEslintPlugin = false, formatters, gitignore: enableGitignore = true, globals, ignores, jsdoc: enableJsdoc = true, jsPlugins: userJsPlugins, jsx: enableJsx = true, options: linterOptions, oxc: enableOxc = true, react: enableReact = false, root: customRootGlobs, rules = {}, spellCheck: enableSpellCheck, test: enableTest = false } = options;
|
|
5863
|
+
const { categories, componentExts: componentExtensions = [], e18e: enableE18e = true, env, eslintPlugin: enableEslintPlugin = false, formatters, gitignore: enableGitignore = true, globals, ignores, jsdoc: enableJsdoc = true, jsPlugins: userJsPlugins, jsx: enableJsx = true, options: linterOptions, oxc: enableOxc = true, react: enableReact = false, root: customRootGlobs, rules = {}, spellCheck: enableSpellCheck, test: enableTest = false, warnDroppedOverrides: enableDroppedOverrideWarning = true } = options;
|
|
5757
5864
|
const rootGlobs = mergeGlobs(GLOB_ROOT, customRootGlobs);
|
|
5758
5865
|
const enableRoblox = options.roblox !== false;
|
|
5759
5866
|
const nativeOnly = userJsPlugins === false;
|
|
@@ -5938,9 +6045,12 @@ function isentinel(factoryOptions, ...userConfigs) {
|
|
|
5938
6045
|
if (override.excludeFiles !== void 0) override.excludeFiles = override.excludeFiles.map(anchorOxlintGlob);
|
|
5939
6046
|
overrides.push(override);
|
|
5940
6047
|
}
|
|
6048
|
+
const removedRules = /* @__PURE__ */ new Set();
|
|
5941
6049
|
for (const fragment of configs.flat()) {
|
|
5942
6050
|
if (nativeOnly && droppedByNativeOnly(fragment)) {
|
|
5943
6051
|
if (fragment.settings) Object.assign(mergedSettings, fragment.settings);
|
|
6052
|
+
const fragmentRules = Object.keys(fragment.rules ?? {});
|
|
6053
|
+
for (const rule of fragmentRules) removedRules.add(rule);
|
|
5944
6054
|
continue;
|
|
5945
6055
|
}
|
|
5946
6056
|
mergeFragment(fragment);
|
|
@@ -5964,12 +6074,21 @@ function isentinel(factoryOptions, ...userConfigs) {
|
|
|
5964
6074
|
});
|
|
5965
6075
|
for (const userConfig of userConfigs) mergeFragment(userConfig);
|
|
5966
6076
|
if (Array.isArray(userJsPlugins)) for (const jsPlugin of userJsPlugins) jsPlugins.set(jsPluginKey(jsPlugin), jsPlugin);
|
|
5967
|
-
if (nativeOnly)
|
|
6077
|
+
if (nativeOnly) {
|
|
6078
|
+
const stripped = stripUnregisteredPluginRules(overrides, /* @__PURE__ */ new Set([...nativePlugins, ...jsPlugins.keys()]));
|
|
6079
|
+
for (const rule of stripped) removedRules.add(rule);
|
|
6080
|
+
}
|
|
5968
6081
|
scopeOverridePlugins(overrides, globalPlugins);
|
|
5969
6082
|
if (defaultSeverity) {
|
|
5970
6083
|
const severityExcludeRules = /* @__PURE__ */ new Set(["sonar/todo-tag"]);
|
|
5971
6084
|
for (const override of overrides) if (override.rules) override.rules = overrideRuleSeverity(override.rules, defaultSeverity, severityExcludeRules);
|
|
5972
6085
|
}
|
|
6086
|
+
const { dropped, emitted } = takeOverrideDiagnostics();
|
|
6087
|
+
for (const rule of removedRules) if (emitted.has(rule)) dropped.push({
|
|
6088
|
+
reason: "native-only",
|
|
6089
|
+
rule
|
|
6090
|
+
});
|
|
6091
|
+
if (enableDroppedOverrideWarning) warnDroppedOverrides(dropped);
|
|
5973
6092
|
return defineConfig({
|
|
5974
6093
|
categories: {
|
|
5975
6094
|
...DEFAULT_CATEGORIES,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isentinel/eslint-config",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.28",
|
|
4
4
|
"description": "iSentinel's ESLint config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint-config",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"typescript": "6.0.3",
|
|
143
143
|
"unplugin-unused": "0.5.7",
|
|
144
144
|
"vitest": "4.1.10",
|
|
145
|
-
"@isentinel/eslint-config": "6.0.0-beta.
|
|
145
|
+
"@isentinel/eslint-config": "6.0.0-beta.28"
|
|
146
146
|
},
|
|
147
147
|
"peerDependencies": {
|
|
148
148
|
"@vitest/eslint-plugin": "^1.6.4",
|