@pengzhanbo/eslint-config 1.5.1 → 1.5.2

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
@@ -1608,6 +1608,15 @@ async function formatters(options = {}, stylistic2 = {}) {
1608
1608
  return configs;
1609
1609
  }
1610
1610
 
1611
+ // src/resolveSubOptions.ts
1612
+ function resolveSubOptions(options, key) {
1613
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
1614
+ }
1615
+ function getOverrides(options, key) {
1616
+ const sub = resolveSubOptions(options, key);
1617
+ return "overrides" in sub ? sub.overrides : {};
1618
+ }
1619
+
1611
1620
  // src/preset.ts
1612
1621
  var defaultPreset = (options) => {
1613
1622
  const {
@@ -1805,23 +1814,15 @@ function eslintFlatConfig(options = {}, ...userConfigs) {
1805
1814
  );
1806
1815
  return merged;
1807
1816
  }
1817
+
1818
+ // src/createConfig.ts
1808
1819
  function createConfig(preset) {
1809
- return (options = {}, ...userConfigs) => {
1820
+ return function eslintFlatConfig2(options = {}, ...userConfigs) {
1810
1821
  const userPreset = options.preset || [];
1811
1822
  const presetList = Array.isArray(preset) ? preset : [preset];
1812
1823
  presetList.push(...userPreset);
1813
1824
  options.preset = presetList;
1814
- return eslintFlatConfig(options, ...userConfigs);
1815
- };
1816
- }
1817
- function resolveSubOptions(options, key) {
1818
- return typeof options[key] === "boolean" ? {} : options[key] || {};
1819
- }
1820
- function getOverrides(options, key) {
1821
- const sub = resolveSubOptions(options, key);
1822
- return {
1823
- ...options.overrides?.[key],
1824
- ..."overrides" in sub ? sub.overrides || {} : {}
1825
+ return eslintFlatConfig2(options, ...userConfigs);
1825
1826
  };
1826
1827
  }
1827
1828
 
package/dist/index.d.cts CHANGED
@@ -190,8 +190,6 @@ interface OptionsComponentExts {
190
190
  */
191
191
  componentExts?: string[];
192
192
  }
193
- interface OptionsFrameworkExtract {
194
- }
195
193
  interface OptionsTypeScriptParserOptions {
196
194
  /**
197
195
  * Additional parser options for TypeScript.
@@ -258,6 +256,8 @@ interface OptionsTailwindCSS extends OptionsOverrides {
258
256
  customClassNames?: boolean;
259
257
  }
260
258
  type PresetItem = (options: Required<Omit<OptionsConfig, 'preset'>>) => Awaitable<FlatConfigItem[]>[];
259
+ interface OptionsFrameworkExtract {
260
+ }
261
261
  interface OptionsConfig extends OptionsComponentExts, OptionsFrameworkExtract {
262
262
  /**
263
263
  * Enable gitignore support.
@@ -363,33 +363,9 @@ interface OptionsConfig extends OptionsComponentExts, OptionsFrameworkExtract {
363
363
  * @default auto-detect based on the process.env
364
364
  */
365
365
  isInEditor?: boolean;
366
- /**
367
- * Provide overrides for rules for each integration.
368
- *
369
- * @deprecated use `overrides` option in each integration key instead
370
- */
371
- overrides?: {
372
- javascript?: FlatConfigItem['rules'];
373
- typescript?: FlatConfigItem['rules'];
374
- test?: FlatConfigItem['rules'];
375
- jsonc?: FlatConfigItem['rules'];
376
- markdown?: FlatConfigItem['rules'];
377
- yaml?: FlatConfigItem['rules'];
378
- toml?: FlatConfigItem['rules'];
379
- vue?: FlatConfigItem['rules'];
380
- react?: FlatConfigItem['rules'];
381
- nextjs?: FlatConfigItem['rules'];
382
- solid?: FlatConfigItem['rules'];
383
- svelte?: FlatConfigItem['rules'];
384
- astro?: FlatConfigItem['rules'];
385
- };
386
366
  }
387
367
 
388
368
  declare function eslintFlatConfig(options?: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
389
- declare function createConfig(preset: PresetItem | PresetItem[]): typeof eslintFlatConfig;
390
- type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
391
- declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
392
- declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): any;
393
369
 
394
370
  declare const parserPlain: {
395
371
  meta: {
@@ -512,4 +488,13 @@ declare function formatters(options?: OptionsFormatters | true, stylistic?: Styl
512
488
 
513
489
  declare const defaultPreset: PresetItem;
514
490
 
515
- export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsFrameworkExtract, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, formatters, getOverrides, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, yaml };
491
+ interface EslintFlatConfigFunction {
492
+ (options: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
493
+ }
494
+ declare function createConfig(preset: PresetItem | PresetItem[]): EslintFlatConfigFunction;
495
+
496
+ type ResolvedNoNullableOptions<T> = T extends boolean ? never : NonNullable<T>;
497
+ declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedNoNullableOptions<OptionsConfig[K]>;
498
+ declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): FlatConfigItem['rules'];
499
+
500
+ export { type Awaitable, type EslintFlatConfigFunction, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsFrameworkExtract, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, formatters, getOverrides, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, yaml };
package/dist/index.d.ts CHANGED
@@ -190,8 +190,6 @@ interface OptionsComponentExts {
190
190
  */
191
191
  componentExts?: string[];
192
192
  }
193
- interface OptionsFrameworkExtract {
194
- }
195
193
  interface OptionsTypeScriptParserOptions {
196
194
  /**
197
195
  * Additional parser options for TypeScript.
@@ -258,6 +256,8 @@ interface OptionsTailwindCSS extends OptionsOverrides {
258
256
  customClassNames?: boolean;
259
257
  }
260
258
  type PresetItem = (options: Required<Omit<OptionsConfig, 'preset'>>) => Awaitable<FlatConfigItem[]>[];
259
+ interface OptionsFrameworkExtract {
260
+ }
261
261
  interface OptionsConfig extends OptionsComponentExts, OptionsFrameworkExtract {
262
262
  /**
263
263
  * Enable gitignore support.
@@ -363,33 +363,9 @@ interface OptionsConfig extends OptionsComponentExts, OptionsFrameworkExtract {
363
363
  * @default auto-detect based on the process.env
364
364
  */
365
365
  isInEditor?: boolean;
366
- /**
367
- * Provide overrides for rules for each integration.
368
- *
369
- * @deprecated use `overrides` option in each integration key instead
370
- */
371
- overrides?: {
372
- javascript?: FlatConfigItem['rules'];
373
- typescript?: FlatConfigItem['rules'];
374
- test?: FlatConfigItem['rules'];
375
- jsonc?: FlatConfigItem['rules'];
376
- markdown?: FlatConfigItem['rules'];
377
- yaml?: FlatConfigItem['rules'];
378
- toml?: FlatConfigItem['rules'];
379
- vue?: FlatConfigItem['rules'];
380
- react?: FlatConfigItem['rules'];
381
- nextjs?: FlatConfigItem['rules'];
382
- solid?: FlatConfigItem['rules'];
383
- svelte?: FlatConfigItem['rules'];
384
- astro?: FlatConfigItem['rules'];
385
- };
386
366
  }
387
367
 
388
368
  declare function eslintFlatConfig(options?: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
389
- declare function createConfig(preset: PresetItem | PresetItem[]): typeof eslintFlatConfig;
390
- type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
391
- declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
392
- declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): any;
393
369
 
394
370
  declare const parserPlain: {
395
371
  meta: {
@@ -512,4 +488,13 @@ declare function formatters(options?: OptionsFormatters | true, stylistic?: Styl
512
488
 
513
489
  declare const defaultPreset: PresetItem;
514
490
 
515
- export { type Awaitable, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsFrameworkExtract, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, formatters, getOverrides, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, yaml };
491
+ interface EslintFlatConfigFunction {
492
+ (options: OptionsConfig & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
493
+ }
494
+ declare function createConfig(preset: PresetItem | PresetItem[]): EslintFlatConfigFunction;
495
+
496
+ type ResolvedNoNullableOptions<T> = T extends boolean ? never : NonNullable<T>;
497
+ declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedNoNullableOptions<OptionsConfig[K]>;
498
+ declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): FlatConfigItem['rules'];
499
+
500
+ export { type Awaitable, type EslintFlatConfigFunction, type FlatConfigItem, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsFormatters, type OptionsFrameworkExtract, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsStylistic, type OptionsTailwindCSS, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsUnoCSS, type PresetItem, type Rules, type StylisticConfig, StylisticConfigDefaults, type UserConfigItem, type WrapRuleConfig, combine, comments, createConfig, eslintFlatConfig as default, defaultPreset, formatters, getOverrides, ignores, imports, interopDefault, javascript, jsdoc, jsonc, markdown, node, parserPlain, perfectionist, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, yaml };
package/dist/index.js CHANGED
@@ -1509,6 +1509,15 @@ async function formatters(options = {}, stylistic2 = {}) {
1509
1509
  return configs;
1510
1510
  }
1511
1511
 
1512
+ // src/resolveSubOptions.ts
1513
+ function resolveSubOptions(options, key) {
1514
+ return typeof options[key] === "boolean" ? {} : options[key] || {};
1515
+ }
1516
+ function getOverrides(options, key) {
1517
+ const sub = resolveSubOptions(options, key);
1518
+ return "overrides" in sub ? sub.overrides : {};
1519
+ }
1520
+
1512
1521
  // src/preset.ts
1513
1522
  var defaultPreset = (options) => {
1514
1523
  const {
@@ -1706,23 +1715,15 @@ function eslintFlatConfig(options = {}, ...userConfigs) {
1706
1715
  );
1707
1716
  return merged;
1708
1717
  }
1718
+
1719
+ // src/createConfig.ts
1709
1720
  function createConfig(preset) {
1710
- return (options = {}, ...userConfigs) => {
1721
+ return function eslintFlatConfig2(options = {}, ...userConfigs) {
1711
1722
  const userPreset = options.preset || [];
1712
1723
  const presetList = Array.isArray(preset) ? preset : [preset];
1713
1724
  presetList.push(...userPreset);
1714
1725
  options.preset = presetList;
1715
- return eslintFlatConfig(options, ...userConfigs);
1716
- };
1717
- }
1718
- function resolveSubOptions(options, key) {
1719
- return typeof options[key] === "boolean" ? {} : options[key] || {};
1720
- }
1721
- function getOverrides(options, key) {
1722
- const sub = resolveSubOptions(options, key);
1723
- return {
1724
- ...options.overrides?.[key],
1725
- ..."overrides" in sub ? sub.overrides || {} : {}
1726
+ return eslintFlatConfig2(options, ...userConfigs);
1726
1727
  };
1727
1728
  }
1728
1729
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pengzhanbo/eslint-config",
3
3
  "type": "module",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "author": "pengzhanbo <q942450674@outlook.com> (https://github/pengzhanbo/)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/pengzhanbo/configs#readme",
@@ -50,21 +50,21 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@antfu/eslint-define-config": "^1.23.0-2",
53
- "@eslint-types/jsdoc": "46.9.0",
54
- "@eslint-types/typescript-eslint": "^6.16.0",
53
+ "@eslint-types/jsdoc": "47.0.2",
54
+ "@eslint-types/typescript-eslint": "^6.17.0",
55
55
  "@eslint-types/unicorn": "^50.0.1",
56
- "@stylistic/eslint-plugin": "^1.5.1",
57
- "@typescript-eslint/eslint-plugin": "^6.16.0",
58
- "@typescript-eslint/parser": "^6.16.0",
56
+ "@stylistic/eslint-plugin": "^1.5.3",
57
+ "@typescript-eslint/eslint-plugin": "^6.18.0",
58
+ "@typescript-eslint/parser": "^6.18.0",
59
59
  "eslint-config-flat-gitignore": "^0.1.2",
60
60
  "eslint-merge-processors": "^0.1.0",
61
61
  "eslint-plugin-antfu": "^2.1.1",
62
62
  "eslint-plugin-eslint-comments": "^3.2.0",
63
63
  "eslint-plugin-i": "^2.29.1",
64
- "eslint-plugin-jsdoc": "^47.0.2",
64
+ "eslint-plugin-jsdoc": "^48.0.2",
65
65
  "eslint-plugin-jsonc": "^2.11.2",
66
66
  "eslint-plugin-markdown": "^3.0.1",
67
- "eslint-plugin-n": "^16.6.0",
67
+ "eslint-plugin-n": "^16.6.1",
68
68
  "eslint-plugin-no-only-tests": "^3.1.0",
69
69
  "eslint-plugin-perfectionist": "^2.5.0",
70
70
  "eslint-plugin-toml": "^0.8.0",
@@ -80,7 +80,7 @@
80
80
  "yaml-eslint-parser": "^1.2.2"
81
81
  },
82
82
  "devDependencies": {
83
- "@unocss/eslint-plugin": "^0.58.2",
83
+ "@unocss/eslint-plugin": "^0.58.3",
84
84
  "eslint": "^8.56.0",
85
85
  "eslint-flat-config-viewer": "^0.1.4",
86
86
  "eslint-plugin-format": "^0.1.0",