@icebreakers/eslint-config 4.0.10 → 4.0.12
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 +3 -3
- package/README.zh.md +3 -3
- package/dist/chunk-BrWF7lJc.cjs +64 -0
- package/dist/{chunk-o8xxKEmq.js → chunk-DwxmvJxx.js} +11 -2
- package/dist/dist-BLNr96Ot.js +123668 -0
- package/dist/dist-vhsLpsZM.cjs +123675 -0
- package/dist/index.cjs +28 -58
- package/dist/index.d.cts +463 -1764
- package/dist/index.d.ts +463 -1764
- package/dist/index.js +22 -21
- package/dist/jiti-DflBE4I9.js +5460 -0
- package/dist/jiti-rvW1Nngq.cjs +5460 -0
- package/dist/lib-nIW0bwj9.cjs +129073 -0
- package/dist/lib-wc9RjYLN.js +129069 -0
- package/dist/minimatch-1bbaDA5a.cjs +7168 -0
- package/dist/minimatch-Ba4IycII.js +7157 -0
- package/dist/modern-BlDFWU8k.cjs +1143 -0
- package/dist/modern-DnYnDvqZ.js +1141 -0
- package/dist/src-ByvzhpaY.js +1173 -0
- package/dist/src-seAD4Fwt.cjs +1175 -0
- package/dist/stylelint.cjs +1 -1
- package/package.json +16 -15
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as __reExport, o as __toESM, r as __exportAll } from "./chunk-DwxmvJxx.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
+
import e18e from "@e18e/eslint-plugin";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import process from "node:process";
|
|
5
6
|
import fs from "node:fs";
|
|
@@ -260,10 +261,10 @@ function resolveMdxPresets(isEnabled) {
|
|
|
260
261
|
function resolveAccessibilityPresets(isEnabled, vueOption, reactOption) {
|
|
261
262
|
if (!isEnabled) return [];
|
|
262
263
|
const presets = [];
|
|
263
|
-
if (vueOption && hasAllPackages(VUE_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(import("
|
|
264
|
+
if (vueOption && hasAllPackages(VUE_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(import("./dist-BLNr96Ot.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1))).then((pluginVueA11y) => {
|
|
264
265
|
return pluginVueA11y.configs["flat/recommended"];
|
|
265
266
|
}));
|
|
266
|
-
if (reactOption && hasAllPackages(REACT_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(import("
|
|
267
|
+
if (reactOption && hasAllPackages(REACT_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(import("./lib-wc9RjYLN.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1))).then((jsxA11y) => {
|
|
267
268
|
return jsxA11y.flatConfigs.recommended;
|
|
268
269
|
}));
|
|
269
270
|
return presets;
|
|
@@ -278,7 +279,7 @@ function resolveNestPresets(isEnabled) {
|
|
|
278
279
|
function resolveQueryPresets(isEnabled) {
|
|
279
280
|
if (!isEnabled) return [];
|
|
280
281
|
if (!hasAllPackages(QUERY_PACKAGES)) return [];
|
|
281
|
-
return [(0, antfu_exports.interopDefault)(import("
|
|
282
|
+
return [(0, antfu_exports.interopDefault)(import("./modern-DnYnDvqZ.js")).then((pluginQuery) => pluginQuery.configs["flat/recommended"])];
|
|
282
283
|
}
|
|
283
284
|
//#endregion
|
|
284
285
|
//#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
@@ -308,23 +309,12 @@ function createDefu(merger) {
|
|
|
308
309
|
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
309
310
|
}
|
|
310
311
|
const defu = createDefu();
|
|
311
|
-
createDefu((object, key, currentValue) => {
|
|
312
|
-
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
313
|
-
object[key] = currentValue(object[key]);
|
|
314
|
-
return true;
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
createDefu((object, key, currentValue) => {
|
|
318
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
319
|
-
object[key] = currentValue(object[key]);
|
|
320
|
-
return true;
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
312
|
//#endregion
|
|
324
313
|
//#region src/options.ts
|
|
325
314
|
const BASE_DEFAULTS = {
|
|
326
315
|
formatters: true,
|
|
327
316
|
pnpm: false,
|
|
317
|
+
react: false,
|
|
328
318
|
javascript: { overrides: {
|
|
329
319
|
"curly": ["error", "all"],
|
|
330
320
|
"no-console": ["warn"]
|
|
@@ -333,7 +323,7 @@ const BASE_DEFAULTS = {
|
|
|
333
323
|
};
|
|
334
324
|
const BASE_RULES = {
|
|
335
325
|
"dot-notation": "off",
|
|
336
|
-
"e18e/ban-dependencies":
|
|
326
|
+
"e18e/ban-dependencies": "off",
|
|
337
327
|
"e18e/prefer-array-to-sorted": "off",
|
|
338
328
|
"pnpm/json-enforce-catalog": "off",
|
|
339
329
|
"pnpm/json-prefer-workspace-settings": "off",
|
|
@@ -673,9 +663,10 @@ function isComposer(value) {
|
|
|
673
663
|
return !!value && typeof value === "object" && "toConfigs" in value && typeof value.toConfigs === "function";
|
|
674
664
|
}
|
|
675
665
|
function normalizeUserConfig(userConfig) {
|
|
676
|
-
if (typeof userConfig?.then === "function") return
|
|
666
|
+
if (typeof userConfig?.then === "function") return (async () => {
|
|
667
|
+
const resolved = await userConfig;
|
|
677
668
|
return isComposer(resolved) ? resolved : normalizeResolvedUserConfig(resolved);
|
|
678
|
-
});
|
|
669
|
+
})();
|
|
679
670
|
const resolvedUserConfig = userConfig;
|
|
680
671
|
return isComposer(resolvedUserConfig) ? resolvedUserConfig : normalizeResolvedUserConfig(resolvedUserConfig);
|
|
681
672
|
}
|
|
@@ -734,15 +725,25 @@ function applyOxfmtFormatterOverrides(composer, formatters) {
|
|
|
734
725
|
} });
|
|
735
726
|
return nextComposer;
|
|
736
727
|
}
|
|
728
|
+
function applyAntfuV7PluginCompatibility(composer) {
|
|
729
|
+
if (typeof composer.prepend !== "function") return composer;
|
|
730
|
+
return composer.prepend({
|
|
731
|
+
name: "icebreaker/antfu-v7-plugin-compat",
|
|
732
|
+
plugins: { e18e }
|
|
733
|
+
}).append({
|
|
734
|
+
name: "icebreaker/react-type-info-compat",
|
|
735
|
+
rules: { "react/no-implicit-key": "off" }
|
|
736
|
+
});
|
|
737
|
+
}
|
|
737
738
|
function icebreaker(options = {}, ...userConfigs) {
|
|
738
739
|
const [resolved, ...presets] = getPresets(options);
|
|
739
740
|
const normalized = normalizeUnoCssOptions(normalizeOptionalAntfuFeatures(resolved));
|
|
740
|
-
return applyOxfmtFormatterOverrides((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig)), normalized.formatters);
|
|
741
|
+
return applyOxfmtFormatterOverrides(applyAntfuV7PluginCompatibility((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig))), normalized.formatters);
|
|
741
742
|
}
|
|
742
743
|
function icebreakerLegacy(options = {}, ...userConfigs) {
|
|
743
744
|
const [resolved, ...presets] = getPresets(options, "legacy");
|
|
744
745
|
const normalized = normalizeUnoCssOptions(normalizeOptionalAntfuFeatures(resolved));
|
|
745
|
-
return applyOxfmtFormatterOverrides((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig)), normalized.formatters);
|
|
746
|
+
return applyOxfmtFormatterOverrides(applyAntfuV7PluginCompatibility((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig))), normalized.formatters);
|
|
746
747
|
}
|
|
747
748
|
//#endregion
|
|
748
749
|
var parserPlain = antfu_exports.parserPlain;
|