@icebreakers/eslint-config 3.0.1 → 4.0.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/dist/index.cjs CHANGED
@@ -293,7 +293,7 @@ function resolveQueryPresets(isEnabled) {
293
293
  return [(0, antfu_exports.interopDefault)(import("@tanstack/eslint-plugin-query")).then((pluginQuery) => pluginQuery.configs["flat/recommended"])];
294
294
  }
295
295
  //#endregion
296
- //#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
296
+ //#region ../../node_modules/.pnpm/defu@6.1.6/node_modules/defu/dist/defu.mjs
297
297
  function isPlainObject(value) {
298
298
  if (value === null || typeof value !== "object") return false;
299
299
  const prototype = Object.getPrototypeOf(value);
@@ -304,8 +304,8 @@ function isPlainObject(value) {
304
304
  }
305
305
  function _defu(baseObject, defaults, namespace = ".", merger) {
306
306
  if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
307
- const object = Object.assign({}, defaults);
308
- for (const key in baseObject) {
307
+ const object = { ...defaults };
308
+ for (const key of Object.keys(baseObject)) {
309
309
  if (key === "__proto__" || key === "constructor") continue;
310
310
  const value = baseObject[key];
311
311
  if (value === null || value === void 0) continue;
@@ -548,6 +548,29 @@ function getPresets(options, mode) {
548
548
  return [resolved, ...presets];
549
549
  }
550
550
  //#endregion
551
+ //#region src/polyfills.ts
552
+ function createObjectGroupBy() {
553
+ return function groupBy(items, callback) {
554
+ const groups = {};
555
+ let index = 0;
556
+ for (const item of items) {
557
+ const key = callback(item, index++);
558
+ groups[key] ??= [];
559
+ groups[key].push(item);
560
+ }
561
+ return groups;
562
+ };
563
+ }
564
+ function ensureObjectGroupBy() {
565
+ if (typeof Object.groupBy === "function") return;
566
+ Object.defineProperty(Object, "groupBy", {
567
+ value: createObjectGroupBy(),
568
+ configurable: true,
569
+ writable: true
570
+ });
571
+ }
572
+ ensureObjectGroupBy();
573
+ //#endregion
551
574
  //#region src/factory.ts
552
575
  const OPTIONAL_ANTFU_FEATURE_PACKAGES = {
553
576
  react: [
@@ -589,7 +612,8 @@ function normalizeUserConfig(userConfig) {
589
612
  if (typeof userConfig?.then === "function") return Promise.resolve(userConfig).then((resolved) => {
590
613
  return isComposer(resolved) ? resolved : normalizeResolvedUserConfig(resolved);
591
614
  });
592
- return isComposer(userConfig) ? userConfig : normalizeResolvedUserConfig(userConfig);
615
+ const resolvedUserConfig = userConfig;
616
+ return isComposer(resolvedUserConfig) ? resolvedUserConfig : normalizeResolvedUserConfig(resolvedUserConfig);
593
617
  }
594
618
  function icebreaker(options = {}, ...userConfigs) {
595
619
  const [resolved, ...presets] = getPresets(options);
package/dist/index.d.cts CHANGED
@@ -3008,6 +3008,7 @@ interface StylelintBridgeOption extends IcebreakerStylelintOptions {
3008
3008
  cwd?: string;
3009
3009
  }
3010
3010
  type StylelintBridgeConfig = boolean | StylelintBridgeOption;
3011
+ type ResolvableUserConfig = TypedFlatConfigItem$1 | TypedFlatConfigItem$1[] | FlatConfigComposer<any, any> | Linter.Config[];
3011
3012
  type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem$1 & {
3012
3013
  /**
3013
3014
  * Enable Mini Program support.
@@ -3056,7 +3057,7 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem$1 & {
3056
3057
  */
3057
3058
  weapp?: boolean;
3058
3059
  };
3059
- type UserConfigItem = Awaitable<TypedFlatConfigItem$1 | TypedFlatConfigItem$1[] | FlatConfigComposer<any, any> | Linter.Config[]>;
3060
+ type UserConfigItem = Awaitable<ResolvableUserConfig>;
3060
3061
  //#endregion
3061
3062
  //#region src/factory.d.ts
3062
3063
  declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
package/dist/index.d.ts CHANGED
@@ -3008,6 +3008,7 @@ interface StylelintBridgeOption extends IcebreakerStylelintOptions {
3008
3008
  cwd?: string;
3009
3009
  }
3010
3010
  type StylelintBridgeConfig = boolean | StylelintBridgeOption;
3011
+ type ResolvableUserConfig = TypedFlatConfigItem$1 | TypedFlatConfigItem$1[] | FlatConfigComposer<any, any> | Linter.Config[];
3011
3012
  type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem$1 & {
3012
3013
  /**
3013
3014
  * Enable Mini Program support.
@@ -3056,7 +3057,7 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem$1 & {
3056
3057
  */
3057
3058
  weapp?: boolean;
3058
3059
  };
3059
- type UserConfigItem = Awaitable<TypedFlatConfigItem$1 | TypedFlatConfigItem$1[] | FlatConfigComposer<any, any> | Linter.Config[]>;
3060
+ type UserConfigItem = Awaitable<ResolvableUserConfig>;
3060
3061
  //#endregion
3061
3062
  //#region src/factory.d.ts
3062
3063
  declare function icebreaker(options?: UserDefinedOptions, ...userConfigs: UserConfigItem[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
package/dist/index.js CHANGED
@@ -284,7 +284,7 @@ function resolveQueryPresets(isEnabled) {
284
284
  return [(0, antfu_exports.interopDefault)(import("@tanstack/eslint-plugin-query")).then((pluginQuery) => pluginQuery.configs["flat/recommended"])];
285
285
  }
286
286
  //#endregion
287
- //#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
287
+ //#region ../../node_modules/.pnpm/defu@6.1.6/node_modules/defu/dist/defu.mjs
288
288
  function isPlainObject(value) {
289
289
  if (value === null || typeof value !== "object") return false;
290
290
  const prototype = Object.getPrototypeOf(value);
@@ -295,8 +295,8 @@ function isPlainObject(value) {
295
295
  }
296
296
  function _defu(baseObject, defaults, namespace = ".", merger) {
297
297
  if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
298
- const object = Object.assign({}, defaults);
299
- for (const key in baseObject) {
298
+ const object = { ...defaults };
299
+ for (const key of Object.keys(baseObject)) {
300
300
  if (key === "__proto__" || key === "constructor") continue;
301
301
  const value = baseObject[key];
302
302
  if (value === null || value === void 0) continue;
@@ -539,6 +539,29 @@ function getPresets(options, mode) {
539
539
  return [resolved, ...presets];
540
540
  }
541
541
  //#endregion
542
+ //#region src/polyfills.ts
543
+ function createObjectGroupBy() {
544
+ return function groupBy(items, callback) {
545
+ const groups = {};
546
+ let index = 0;
547
+ for (const item of items) {
548
+ const key = callback(item, index++);
549
+ groups[key] ??= [];
550
+ groups[key].push(item);
551
+ }
552
+ return groups;
553
+ };
554
+ }
555
+ function ensureObjectGroupBy() {
556
+ if (typeof Object.groupBy === "function") return;
557
+ Object.defineProperty(Object, "groupBy", {
558
+ value: createObjectGroupBy(),
559
+ configurable: true,
560
+ writable: true
561
+ });
562
+ }
563
+ ensureObjectGroupBy();
564
+ //#endregion
542
565
  //#region src/factory.ts
543
566
  const OPTIONAL_ANTFU_FEATURE_PACKAGES = {
544
567
  react: [
@@ -580,7 +603,8 @@ function normalizeUserConfig(userConfig) {
580
603
  if (typeof userConfig?.then === "function") return Promise.resolve(userConfig).then((resolved) => {
581
604
  return isComposer(resolved) ? resolved : normalizeResolvedUserConfig(resolved);
582
605
  });
583
- return isComposer(userConfig) ? userConfig : normalizeResolvedUserConfig(userConfig);
606
+ const resolvedUserConfig = userConfig;
607
+ return isComposer(resolvedUserConfig) ? resolvedUserConfig : normalizeResolvedUserConfig(resolvedUserConfig);
584
608
  }
585
609
  function icebreaker(options = {}, ...userConfigs) {
586
610
  const [resolved, ...presets] = getPresets(options);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/eslint-config",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "4.0.0",
5
5
  "description": "ESLint preset from Icebreaker's dev-configs",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "index.d.ts"
40
40
  ],
41
41
  "engines": {
42
- "node": ">=22.0.0"
42
+ "node": "^20.19.0 || >=22.12.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "eslint-plugin-pnpm": "^1.4.3"
@@ -59,8 +59,8 @@
59
59
  "eslint-plugin-react-refresh": "^0.5.2",
60
60
  "eslint-plugin-tailwindcss": "3.18.2",
61
61
  "eslint-plugin-vuejs-accessibility": "^2.5.0",
62
- "@icebreakers/stylelint-config": "2.2.1",
63
- "eslint-plugin-better-stylelint": "0.1.3"
62
+ "@icebreakers/stylelint-config": "3.0.0",
63
+ "eslint-plugin-better-stylelint": "1.0.0"
64
64
  },
65
65
  "optionalDependencies": {
66
66
  "@next/eslint-plugin-next": "^16.2.2",