@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.cjs
CHANGED
|
@@ -1,47 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __exportAll = (all, no_symbols) => {
|
|
10
|
-
let target = {};
|
|
11
|
-
for (var name in all) __defProp(target, name, {
|
|
12
|
-
get: all[name],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
-
return target;
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
-
key = keys[i];
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
-
get: ((k) => from[k]).bind(null, key),
|
|
23
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
//#endregion
|
|
2
|
+
const require_chunk = require("./chunk-BrWF7lJc.cjs");
|
|
3
|
+
let _e18e_eslint_plugin = require("@e18e/eslint-plugin");
|
|
4
|
+
_e18e_eslint_plugin = require_chunk.__toESM(_e18e_eslint_plugin, 1);
|
|
34
5
|
let node_path = require("node:path");
|
|
35
|
-
node_path = __toESM(node_path, 1);
|
|
6
|
+
node_path = require_chunk.__toESM(node_path, 1);
|
|
36
7
|
let node_process = require("node:process");
|
|
37
|
-
node_process = __toESM(node_process, 1);
|
|
8
|
+
node_process = require_chunk.__toESM(node_process, 1);
|
|
38
9
|
let node_fs = require("node:fs");
|
|
39
|
-
node_fs = __toESM(node_fs, 1);
|
|
10
|
+
node_fs = require_chunk.__toESM(node_fs, 1);
|
|
40
11
|
let node_module = require("node:module");
|
|
41
12
|
let node_url = require("node:url");
|
|
42
13
|
//#region src/antfu.ts
|
|
43
|
-
var antfu_exports = /* @__PURE__ */ __exportAll({});
|
|
44
|
-
__reExport(antfu_exports, require("@antfu/eslint-config"));
|
|
14
|
+
var antfu_exports = /* @__PURE__ */ require_chunk.__exportAll({});
|
|
15
|
+
require_chunk.__reExport(antfu_exports, require("@antfu/eslint-config"));
|
|
45
16
|
//#endregion
|
|
46
17
|
//#region src/defaults.ts
|
|
47
18
|
const INLINE_ELEMENTS = [
|
|
@@ -294,10 +265,10 @@ function resolveMdxPresets(isEnabled) {
|
|
|
294
265
|
function resolveAccessibilityPresets(isEnabled, vueOption, reactOption) {
|
|
295
266
|
if (!isEnabled) return [];
|
|
296
267
|
const presets = [];
|
|
297
|
-
if (vueOption && hasAllPackages(VUE_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(
|
|
268
|
+
if (vueOption && hasAllPackages(VUE_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./dist-vhsLpsZM.cjs").default, 1))).then((pluginVueA11y) => {
|
|
298
269
|
return pluginVueA11y.configs["flat/recommended"];
|
|
299
270
|
}));
|
|
300
|
-
if (reactOption && hasAllPackages(REACT_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(
|
|
271
|
+
if (reactOption && hasAllPackages(REACT_A11Y_PACKAGES)) presets.push((0, antfu_exports.interopDefault)(Promise.resolve().then(() => /* @__PURE__ */ require_chunk.__toESM(require("./lib-nIW0bwj9.cjs").default, 1))).then((jsxA11y) => {
|
|
301
272
|
return jsxA11y.flatConfigs.recommended;
|
|
302
273
|
}));
|
|
303
274
|
return presets;
|
|
@@ -312,7 +283,7 @@ function resolveNestPresets(isEnabled) {
|
|
|
312
283
|
function resolveQueryPresets(isEnabled) {
|
|
313
284
|
if (!isEnabled) return [];
|
|
314
285
|
if (!hasAllPackages(QUERY_PACKAGES)) return [];
|
|
315
|
-
return [(0, antfu_exports.interopDefault)(
|
|
286
|
+
return [(0, antfu_exports.interopDefault)(Promise.resolve().then(() => require("./modern-BlDFWU8k.cjs"))).then((pluginQuery) => pluginQuery.configs["flat/recommended"])];
|
|
316
287
|
}
|
|
317
288
|
//#endregion
|
|
318
289
|
//#region ../../node_modules/.pnpm/defu@6.1.7/node_modules/defu/dist/defu.mjs
|
|
@@ -342,23 +313,12 @@ function createDefu(merger) {
|
|
|
342
313
|
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
343
314
|
}
|
|
344
315
|
const defu = createDefu();
|
|
345
|
-
createDefu((object, key, currentValue) => {
|
|
346
|
-
if (object[key] !== void 0 && typeof currentValue === "function") {
|
|
347
|
-
object[key] = currentValue(object[key]);
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
createDefu((object, key, currentValue) => {
|
|
352
|
-
if (Array.isArray(object[key]) && typeof currentValue === "function") {
|
|
353
|
-
object[key] = currentValue(object[key]);
|
|
354
|
-
return true;
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
316
|
//#endregion
|
|
358
317
|
//#region src/options.ts
|
|
359
318
|
const BASE_DEFAULTS = {
|
|
360
319
|
formatters: true,
|
|
361
320
|
pnpm: false,
|
|
321
|
+
react: false,
|
|
362
322
|
javascript: { overrides: {
|
|
363
323
|
"curly": ["error", "all"],
|
|
364
324
|
"no-console": ["warn"]
|
|
@@ -367,7 +327,7 @@ const BASE_DEFAULTS = {
|
|
|
367
327
|
};
|
|
368
328
|
const BASE_RULES = {
|
|
369
329
|
"dot-notation": "off",
|
|
370
|
-
"e18e/ban-dependencies":
|
|
330
|
+
"e18e/ban-dependencies": "off",
|
|
371
331
|
"e18e/prefer-array-to-sorted": "off",
|
|
372
332
|
"pnpm/json-enforce-catalog": "off",
|
|
373
333
|
"pnpm/json-prefer-workspace-settings": "off",
|
|
@@ -707,9 +667,10 @@ function isComposer(value) {
|
|
|
707
667
|
return !!value && typeof value === "object" && "toConfigs" in value && typeof value.toConfigs === "function";
|
|
708
668
|
}
|
|
709
669
|
function normalizeUserConfig(userConfig) {
|
|
710
|
-
if (typeof userConfig?.then === "function") return
|
|
670
|
+
if (typeof userConfig?.then === "function") return (async () => {
|
|
671
|
+
const resolved = await userConfig;
|
|
711
672
|
return isComposer(resolved) ? resolved : normalizeResolvedUserConfig(resolved);
|
|
712
|
-
});
|
|
673
|
+
})();
|
|
713
674
|
const resolvedUserConfig = userConfig;
|
|
714
675
|
return isComposer(resolvedUserConfig) ? resolvedUserConfig : normalizeResolvedUserConfig(resolvedUserConfig);
|
|
715
676
|
}
|
|
@@ -768,18 +729,27 @@ function applyOxfmtFormatterOverrides(composer, formatters) {
|
|
|
768
729
|
} });
|
|
769
730
|
return nextComposer;
|
|
770
731
|
}
|
|
732
|
+
function applyAntfuV7PluginCompatibility(composer) {
|
|
733
|
+
if (typeof composer.prepend !== "function") return composer;
|
|
734
|
+
return composer.prepend({
|
|
735
|
+
name: "icebreaker/antfu-v7-plugin-compat",
|
|
736
|
+
plugins: { e18e: _e18e_eslint_plugin.default }
|
|
737
|
+
}).append({
|
|
738
|
+
name: "icebreaker/react-type-info-compat",
|
|
739
|
+
rules: { "react/no-implicit-key": "off" }
|
|
740
|
+
});
|
|
741
|
+
}
|
|
771
742
|
function icebreaker(options = {}, ...userConfigs) {
|
|
772
743
|
const [resolved, ...presets] = getPresets(options);
|
|
773
744
|
const normalized = normalizeUnoCssOptions(normalizeOptionalAntfuFeatures(resolved));
|
|
774
|
-
return applyOxfmtFormatterOverrides((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig)), normalized.formatters);
|
|
745
|
+
return applyOxfmtFormatterOverrides(applyAntfuV7PluginCompatibility((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig))), normalized.formatters);
|
|
775
746
|
}
|
|
776
747
|
function icebreakerLegacy(options = {}, ...userConfigs) {
|
|
777
748
|
const [resolved, ...presets] = getPresets(options, "legacy");
|
|
778
749
|
const normalized = normalizeUnoCssOptions(normalizeOptionalAntfuFeatures(resolved));
|
|
779
|
-
return applyOxfmtFormatterOverrides((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig)), normalized.formatters);
|
|
750
|
+
return applyOxfmtFormatterOverrides(applyAntfuV7PluginCompatibility((0, antfu_exports.antfu)(toAntfuOptions(normalized), ...presets, ...userConfigs.map(normalizeUserConfig))), normalized.formatters);
|
|
780
751
|
}
|
|
781
752
|
//#endregion
|
|
782
|
-
exports.__toESM = __toESM;
|
|
783
753
|
exports.getPresets = getPresets;
|
|
784
754
|
exports.icebreaker = icebreaker;
|
|
785
755
|
exports.icebreakerLegacy = icebreakerLegacy;
|