@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/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
- import { n as __reExport, t as __exportAll } from "./chunk-o8xxKEmq.js";
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("eslint-plugin-vuejs-accessibility")).then((pluginVueA11y) => {
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("eslint-plugin-jsx-a11y")).then((jsxA11y) => {
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("@tanstack/eslint-plugin-query")).then((pluginQuery) => pluginQuery.configs["flat/recommended"])];
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": ["warn", { allowed: ["axios", "lint-staged"] }],
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 Promise.resolve(userConfig).then((resolved) => {
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;