@isentinel/eslint-config 4.6.1 → 4.7.1

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 CHANGED
@@ -297,6 +297,32 @@ export default isentinel({
297
297
  });
298
298
  ```
299
299
 
300
+ ### Named Configs
301
+
302
+ Enable `namedConfigs` to require all config items to have a `name` property.
303
+ This improves debugging and makes the
304
+ [ESLint Config Inspector](https://github.com/eslint/config-inspector) much more
305
+ useful by displaying meaningful names instead of anonymous configs.
306
+
307
+ ```ts
308
+ // eslint.config.ts
309
+ import isentinel from "@isentinel/eslint-config";
310
+
311
+ export default isentinel(
312
+ {
313
+ name: "project/root",
314
+ namedConfigs: true,
315
+ },
316
+ {
317
+ name: "project/custom-rules",
318
+ files: ["**/*.ts"],
319
+ rules: {},
320
+ },
321
+ );
322
+ ```
323
+
324
+ > **Note:** This will become the default in a future major version.
325
+
300
326
  ### Plugins Renaming
301
327
 
302
328
  Since flat config requires us to explicitly provide the plugin names (instead of
package/dist/index.d.mts CHANGED
@@ -6,6 +6,7 @@ import { ParserOptions } from "@typescript-eslint/parser";
6
6
  import { Linter } from "eslint";
7
7
  import { ESLintReactSettings } from "@eslint-react/shared";
8
8
  import { FlatGitignoreOptions } from "eslint-config-flat-gitignore";
9
+ import { SetRequired } from "type-fest";
9
10
 
10
11
  //#region src/typegen.d.ts
11
12
  interface RuleOptions {
@@ -16866,6 +16867,22 @@ interface JsdocOptions {
16866
16867
  */
16867
16868
  full?: boolean;
16868
16869
  }
16870
+ /**
16871
+ * A TypedFlatConfigItem that requires a name property. All configs should have
16872
+ * a name for better debugging and tooling support.
16873
+ */
16874
+ type NamedFlatConfigItem = SetRequired<TypedFlatConfigItem, "name">;
16875
+ /**
16876
+ * Options type that requires `name` on the options config and all user configs.
16877
+ *
16878
+ * @remarks
16879
+ * This will become the default in a future major version.
16880
+ * @see {@link OptionsConfig.namedConfigs}
16881
+ */
16882
+ type NamedOptionsConfig = OptionsConfig & TypedFlatConfigItem & {
16883
+ name: string;
16884
+ namedConfigs: true;
16885
+ };
16869
16886
  interface OptionsComponentExtensions {
16870
16887
  /** Additional extensions for components. */
16871
16888
  componentExts?: Array<string>;
@@ -16954,6 +16971,16 @@ interface OptionsConfig extends OptionsComponentExtensions, OptionsProjectType {
16954
16971
  * @default true
16955
16972
  */
16956
16973
  markdown?: boolean | OptionsOverrides;
16974
+ /**
16975
+ * Require all config items to have a `name` property for better debugging
16976
+ * and tooling support.
16977
+ *
16978
+ * @remarks
16979
+ * This will default to `true` in a future major version and this option
16980
+ * will be removed.
16981
+ * @default false
16982
+ */
16983
+ namedConfigs?: boolean;
16957
16984
  /** Supply custom options for eslint-plugin-perfectionist. */
16958
16985
  perfectionist?: PerfectionistConfig;
16959
16986
  /**
@@ -17422,12 +17449,19 @@ declare const defaultPluginRenaming: {
17422
17449
  * Generates an array of user configuration items based on the provided options
17423
17450
  * and user configs.
17424
17451
  *
17452
+ * @template NamedConfigs - When `true`, requires all config items to have a
17453
+ * name.
17425
17454
  * @param options - The options for generating the user configuration items.
17426
17455
  * @param userConfigs - Additional user configuration items.
17427
17456
  * @returns A promise that resolves to an array of user configuration items.
17428
17457
  * @rejects Will throw an error if configuration generation fails.
17429
17458
  */
17430
- declare function isentinel(options?: OptionsConfig & TypedFlatConfigItem, ...userConfigs: Array<Awaitable<Array<Linter.Config> | Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): Promise<FlatConfigComposer<TypedFlatConfigItem, ConfigNames>>;
17459
+ declare function isentinel(options: Omit<OptionsConfig, "namedConfigs"> & TypedFlatConfigItem & {
17460
+ namedConfigs?: false;
17461
+ }, ...userConfigs: Array<Awaitable<Array<TypedFlatConfigItem> | FlatConfigComposer<any, any> | TypedFlatConfigItem>>): Promise<FlatConfigComposer<TypedFlatConfigItem, ConfigNames>>;
17462
+ declare function isentinel(options: NamedOptionsConfig, ...userConfigs: Array<Awaitable<FlatConfigComposer<any, any>>>): Promise<FlatConfigComposer<TypedFlatConfigItem, ConfigNames>>;
17463
+ declare function isentinel(options: NamedOptionsConfig, ...userConfigs: Array<Awaitable<Array<NamedFlatConfigItem>>>): Promise<FlatConfigComposer<TypedFlatConfigItem, ConfigNames>>;
17464
+ declare function isentinel(options: NamedOptionsConfig, ...userConfigs: Array<Awaitable<NamedFlatConfigItem>>): Promise<FlatConfigComposer<TypedFlatConfigItem, ConfigNames>>;
17431
17465
  //#endregion
17432
17466
  //#region src/globs.d.ts
17433
17467
  declare const GLOB_ROOT: string[];
@@ -17463,4 +17497,4 @@ declare const GLOB_BUILD_TOOLS: string[];
17463
17497
  declare const GLOB_ALL_SRC: string[];
17464
17498
  declare const GLOB_EXCLUDE: string[];
17465
17499
  //#endregion
17466
- export { Awaitable, type ConfigNames, ExtractRuleOptions, type FlatConfigComposer, GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, GitignoreOptions, JsdocOptions, OptionsComponentExtensions, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsOverridesTypeAware, OptionsPnpm, OptionsProjectType, OptionsRoblox, OptionsStylistic, OptionsTestFramework, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVitest, PerfectionistConfig, type PrettierOptions, PrettierRuleOptions, ReactConfig, ResolvedOptions, Rules, SpellCheckConfig, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, createTsParser, isentinel as default, isentinel, defaultPluginRenaming, disables, ensurePackages, eslintPlugin, flawless, getOverrides, getTsConfig, gitignore, ignores, imports, interopDefault, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, mergeGlobs, mergePrettierOptions, node, packageJson, parserPlain, perfectionist, pnpm, prettier, promise, react, renamePluginInConfigs, renameRules, require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic, test, toml, typescript, unicorn, yaml };
17500
+ export { Awaitable, type ConfigNames, ExtractRuleOptions, type FlatConfigComposer, GLOB_ALL_JSON, GLOB_ALL_SRC, GLOB_BUILD_TOOLS, GLOB_CSS, GLOB_DTS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LUA, GLOB_MARKDOWN, GLOB_MARKDOWN_BLOCKS, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_ROOT, GLOB_ROOT_SRC, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_XML, GLOB_YAML, GitignoreOptions, JsdocOptions, NamedFlatConfigItem, NamedOptionsConfig, OptionsComponentExtensions, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsOverridesTypeAware, OptionsPnpm, OptionsProjectType, OptionsRoblox, OptionsStylistic, OptionsTestFramework, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVitest, PerfectionistConfig, type PrettierOptions, PrettierRuleOptions, ReactConfig, ResolvedOptions, Rules, SpellCheckConfig, StylisticConfig, StylisticConfigDefaults, TypedFlatConfigItem, combine, comments, createTsParser, isentinel as default, isentinel, defaultPluginRenaming, disables, ensurePackages, eslintPlugin, flawless, getOverrides, getTsConfig, gitignore, ignores, imports, interopDefault, isInEditorEnvironment, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, mergeGlobs, mergePrettierOptions, node, packageJson, parserPlain, perfectionist, pnpm, prettier, promise, react, renamePluginInConfigs, renameRules, require, resolvePrettierConfigOptions, resolveSubOptions, resolveWithDefaults, roblox, shopify, shouldEnableFeature, sonarjs, sortGithubAction, sortPnpmWorkspace, sortRojoProject, sortTsconfig, spelling, stylistic, test, toml, typescript, unicorn, yaml };
package/dist/index.mjs CHANGED
@@ -141,16 +141,22 @@ const GLOB_EXCLUDE = [
141
141
  "**/.history",
142
142
  "**/.idea",
143
143
  "**/.next",
144
+ "**/.nuxt",
144
145
  "**/.output",
146
+ "**/.svelte-kit",
145
147
  "**/.temp",
146
148
  "**/.tmp",
147
149
  "**/.vercel",
148
150
  "**/.vite-inspect",
151
+ "**/.vitepress/cache",
152
+ "**/.worktree",
153
+ "**/.yarn",
149
154
  "**/coverage",
150
155
  "**/out",
151
156
  "**/output",
152
157
  "**/temp",
153
158
  "**/tmp",
159
+ "**/vite.config.*.timestamp-*",
154
160
  "**/*.min.*",
155
161
  "**/CHANGELOG*.md",
156
162
  "**/LICENSE*",
@@ -4618,17 +4624,17 @@ async function packageJson(options = {}) {
4618
4624
  "package-json/require-attribution": "error",
4619
4625
  "package-json/require-author": "error",
4620
4626
  "package-json/require-description": "error",
4621
- "package-json/require-exports": "error",
4627
+ "package-json/require-exports": ["error", { ignorePrivate: true }],
4622
4628
  "package-json/require-files": ["error", { ignorePrivate: true }],
4623
4629
  "package-json/require-keywords": "error",
4624
- "package-json/require-license": "error",
4630
+ "package-json/require-license": ["error", { ignorePrivate: true }],
4625
4631
  "package-json/require-name": "error",
4626
- "package-json/require-types": "error",
4632
+ "package-json/require-types": ["error", { ignorePrivate: true }],
4627
4633
  "package-json/require-version": "error"
4628
4634
  } : {},
4629
4635
  ...type === "package" && !roblox$1 ? {
4630
4636
  "package-json/require-engines": "error",
4631
- "package-json/require-sideEffects": "error"
4637
+ "package-json/require-sideEffects": ["error", { ignorePrivate: true }]
4632
4638
  } : {}
4633
4639
  }
4634
4640
  }];
@@ -4930,16 +4936,7 @@ const defaultPluginRenaming = {
4930
4936
  "n": "node",
4931
4937
  "yml": "yaml"
4932
4938
  };
4933
- /**
4934
- * Generates an array of user configuration items based on the provided options
4935
- * and user configs.
4936
- *
4937
- * @param options - The options for generating the user configuration items.
4938
- * @param userConfigs - Additional user configuration items.
4939
- * @returns A promise that resolves to an array of user configuration items.
4940
- * @rejects Will throw an error if configuration generation fails.
4941
- */
4942
- async function isentinel(options = {}, ...userConfigs) {
4939
+ async function isentinel(options, ...userConfigs) {
4943
4940
  const { autoRenamePlugins = true, componentExts: componentExtensions = [], eslintPlugin: enableEslintPlugin = false, formatters, gitignore: enableGitignore = true, jsdoc: enableJsdoc = true, jsx: enableJsx = true, pnpm: enableCatalogs = findUpSync("pnpm-workspace.yaml") !== void 0, react: enableReact = false, root: customRootGlobs, spellCheck: enableSpellCheck, typescript: enableTypeScript } = options;
4944
4941
  const rootGlobs = mergeGlobs(GLOB_ROOT, customRootGlobs);
4945
4942
  const enableRoblox = options.roblox !== false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isentinel/eslint-config",
3
- "version": "4.6.1",
3
+ "version": "4.7.1",
4
4
  "description": "iSentinel's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config",
@@ -121,11 +121,11 @@
121
121
  "pnpm-workspace-yaml": "1.4.2",
122
122
  "rimraf": "6.1.2",
123
123
  "simple-git-hooks": "2.13.1",
124
- "tsdown": "0.17.2",
124
+ "tsdown": "0.17.3",
125
125
  "tsx": "4.21.0",
126
126
  "type-fest": "5.3.1",
127
127
  "typescript": "5.9.3",
128
- "@isentinel/eslint-config": "4.6.1"
128
+ "@isentinel/eslint-config": "4.7.1"
129
129
  },
130
130
  "peerDependencies": {
131
131
  "@vitest/eslint-plugin": "^1.0.0",