@octohash/eslint-config 0.3.1 → 0.4.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.
Files changed (2) hide show
  1. package/dist/index.d.mts +46 -7
  2. package/package.json +17 -18
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _$_antfu_eslint_config0 from "@antfu/eslint-config";
2
1
  import { Awaitable, OptionsConfig, OptionsFiles, OptionsOverrides, TypedFlatConfigItem } from "@antfu/eslint-config";
3
2
  import { Linter, Rule } from "eslint";
4
3
 
@@ -201,7 +200,7 @@ interface JSONSchema4 {
201
200
  format?: string | undefined;
202
201
  }
203
202
  //#endregion
204
- //#region node_modules/.pnpm/@eslint+core@1.1.1/node_modules/@eslint/core/dist/esm/types.d.ts
203
+ //#region node_modules/.pnpm/@eslint+core@1.2.1/node_modules/@eslint/core/dist/esm/types.d.ts
205
204
  /**
206
205
  * Represents an error inside of a file.
207
206
  */
@@ -280,6 +279,12 @@ interface RulesMetaDocs {
280
279
  * Indicates if the rule is frozen (no longer accepting feature requests).
281
280
  */
282
281
  frozen?: boolean | undefined;
282
+ /**
283
+ * The dialects of the languages that the rule is intended to lint.
284
+ * @example
285
+ * ["JavaScript", "TypeScript"]
286
+ */
287
+ dialects?: string[] | undefined;
283
288
  }
284
289
  /**
285
290
  * Meta information about a rule.
@@ -324,12 +329,21 @@ interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[],
324
329
  hasSuggestions?: boolean | undefined;
325
330
  /**
326
331
  * The language the rule is intended to lint.
332
+ * @deprecated Use `languages` instead.
327
333
  */
328
334
  language?: string;
329
335
  /**
330
336
  * The dialects of `language` that the rule is intended to lint.
337
+ * @deprecated Use `docs.dialects` instead.
331
338
  */
332
339
  dialects?: string[];
340
+ /**
341
+ * Languages supported by this rule in the format `"plugin/language"`.
342
+ * Use `"*"` for any language or `"plugin/*"` for any language from a specific plugin.
343
+ * @example
344
+ * ["js/js", "markdown/gfm", "json/jsonc", "css/css"]
345
+ */
346
+ languages?: string[] | undefined;
333
347
  }
334
348
  /**
335
349
  * Provides additional metadata about a deprecation.
@@ -1026,7 +1040,7 @@ interface Language<Options extends LanguageTypeOptions = {
1026
1040
  /**
1027
1041
  * Default language options. User-defined options are merged with this object.
1028
1042
  */
1029
- defaultLanguageOptions?: LanguageOptions;
1043
+ defaultLanguageOptions?: Options["LangOptions"];
1030
1044
  /**
1031
1045
  * Validates languageOptions for this language.
1032
1046
  */
@@ -1300,7 +1314,7 @@ interface Directive {
1300
1314
  justification?: string;
1301
1315
  }
1302
1316
  //#endregion
1303
- //#region node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/types.d.ts
1317
+ //#region node_modules/.pnpm/@eslint+config-helpers@0.5.5/node_modules/@eslint/config-helpers/dist/esm/types.d.ts
1304
1318
  /**
1305
1319
  * Infinite array type.
1306
1320
  */
@@ -1327,11 +1341,11 @@ interface ConfigWithExtends$1 extends ConfigObject {
1327
1341
  extends?: ExtendsElement[];
1328
1342
  }
1329
1343
  //#endregion
1330
- //#region node_modules/.pnpm/@eslint+config-helpers@0.5.3/node_modules/@eslint/config-helpers/dist/esm/index.d.ts
1344
+ //#region node_modules/.pnpm/@eslint+config-helpers@0.5.5/node_modules/@eslint/config-helpers/dist/esm/index.d.ts
1331
1345
  type Plugin = Plugin$1;
1332
1346
  type ConfigWithExtends = ConfigWithExtends$1;
1333
1347
  //#endregion
1334
- //#region node_modules/.pnpm/eslint-flat-config-utils@3.1.0/node_modules/eslint-flat-config-utils/dist/index.d.mts
1348
+ //#region node_modules/.pnpm/eslint-flat-config-utils@3.2.0/node_modules/eslint-flat-config-utils/dist/index.d.mts
1335
1349
  /**
1336
1350
  * The options for `renamePluginsInConfigs`
1337
1351
  */
@@ -1455,6 +1469,7 @@ declare class FlatConfigComposer<T extends object = ConfigWithExtends, ConfigNam
1455
1469
  private _operationsResolved;
1456
1470
  private _renames;
1457
1471
  private _renamesOptions;
1472
+ private _defaultIgnores;
1458
1473
  private _pluginsConflictsError;
1459
1474
  constructor(...configs: ResolvableFlatConfig<T>[]);
1460
1475
  /**
@@ -1463,6 +1478,30 @@ declare class FlatConfigComposer<T extends object = ConfigWithExtends, ConfigNam
1463
1478
  * This will runs after all config items are resolved. Applies to `plugins` and `rules`.
1464
1479
  */
1465
1480
  renamePlugins(renames: Record<string, string>, options?: RenamePluginsInConfigsOptions): this;
1481
+ /**
1482
+ * Set default `ignores` globs for configs that have rules but no explicit
1483
+ * scoping (`files` / `ignores` / `language`).
1484
+ *
1485
+ * The callback receives the composer's previously-accumulated globs and
1486
+ * returns the new list, so calls compose:
1487
+ *
1488
+ * ```ts
1489
+ * composer
1490
+ * .setDefaultIgnores(() => ['**\/*.md'])
1491
+ * .setDefaultIgnores(prev => [...prev, '**\/*.json'])
1492
+ * ```
1493
+ *
1494
+ * Useful when mixing fundamentally different languages (e.g. JS + Markdown)
1495
+ * and you want global rule configs to not "leak" into a foreign language
1496
+ * whose `SourceCode` lacks JS-only methods.
1497
+ */
1498
+ setDefaultIgnores(fn: (globs: string[]) => string[]): this;
1499
+ /**
1500
+ * Absorb another composer's accumulated state when it is appended/prepended/etc.
1501
+ * into this one, so renames and default-ignores globs declared on the inner
1502
+ * composer apply to the parent's other configs as well.
1503
+ */
1504
+ private _absorbComposer;
1466
1505
  /**
1467
1506
  * Append configs to the end of the current configs array.
1468
1507
  */
@@ -1647,6 +1686,6 @@ interface OptionsTailwindcss extends OptionsFiles, OptionsOverrides {
1647
1686
  }
1648
1687
  //#endregion
1649
1688
  //#region src/index.d.ts
1650
- declare function defineConfig(options?: Options, ...userConfigs: UserConfig): FlatConfigComposer<_$_antfu_eslint_config0.TypedFlatConfigItem, _$_antfu_eslint_config0.ConfigNames>;
1689
+ declare function defineConfig(options?: Options, ...userConfigs: UserConfig): FlatConfigComposer<import("@antfu/eslint-config").TypedFlatConfigItem, import("@antfu/eslint-config").ConfigNames>;
1651
1690
  //#endregion
1652
1691
  export { defineConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octohash/eslint-config",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "description": "Personal ESLint config based on @antfu/eslint-config with opinionated extensions.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
@@ -38,27 +38,26 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@antfu/eslint-config": "^8.1.1",
41
+ "@antfu/eslint-config": "^9.0.0",
42
42
  "eslint-plugin-catalogs-sort": "^0.0.0-alpha.0",
43
43
  "find-up-simple": "^1.0.1",
44
- "local-pkg": "^1.1.2",
44
+ "local-pkg": "^1.2.1",
45
45
  "pathe": "^2.0.3"
46
46
  },
47
47
  "devDependencies": {
48
- "tsdown": "^0.21.7",
49
- "@octohash/tsconfig": "^0.2.0",
50
- "bumpp": "^11.0.1",
48
+ "tsdown": "^0.22.1",
49
+ "bumpp": "^11.1.0",
51
50
  "nano-staged": "^1.0.2",
52
- "pncat": "^0.11.1",
51
+ "pncat": "^0.12.0",
53
52
  "simple-git-hooks": "^2.13.1",
54
- "taze": "^19.11.0",
55
- "typescript": "^6.0.2",
56
- "eslint": "^10.2.0",
57
- "eslint-flat-config-utils": "^3.1.0",
58
- "eslint-plugin-better-tailwindcss": "^4.3.2",
59
- "vitest": "^4.1.4",
60
- "@types/node": "^25.5.2",
61
- "@octohash/eslint-config": "0.3.1"
53
+ "taze": "^19.14.1",
54
+ "typescript": "^6.0.3",
55
+ "eslint": "^10.4.1",
56
+ "eslint-flat-config-utils": "^3.2.0",
57
+ "eslint-plugin-better-tailwindcss": "^4.5.0",
58
+ "vitest": "^4.1.8",
59
+ "@types/node": "^25.9.1",
60
+ "@octohash/eslint-config": "0.4.0"
62
61
  },
63
62
  "simple-git-hooks": {
64
63
  "pre-commit": "pnpm nano-staged"
@@ -67,10 +66,10 @@
67
66
  "*": "eslint --fix"
68
67
  },
69
68
  "inlinedDependencies": {
70
- "@eslint/config-helpers": "0.5.3",
71
- "@eslint/core": "1.1.1",
69
+ "@eslint/config-helpers": "0.5.5",
70
+ "@eslint/core": "1.2.1",
72
71
  "@types/json-schema": "7.0.15",
73
- "eslint-flat-config-utils": "3.1.0"
72
+ "eslint-flat-config-utils": "3.2.0"
74
73
  },
75
74
  "scripts": {
76
75
  "build": "tsdown",