Skip to content

Commit

Permalink
🤖 Merge PR #69185 [eslint]: support name field in FlatConfig by @…
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 1, 2024
1 parent 3e5c5a5 commit b8dc602
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types/eslint/eslint-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,8 @@ ruleTester.run("simple-valid-test", rule, {
// @ts-expect-error
((): Linter.FlatConfig => ({ linterOptions: { reportUnusedDisableDirectives: null } }));

((): Linter.FlatConfig => ({ name: "eslint:js" }));

// The following _should_ be an error, but we can't enforce on consumers
// as it requires exactOptionalPropertyTypes: true
// (): Linter.FlatConfig => ({ files: undefined });
Expand Down
6 changes: 6 additions & 0 deletions types/eslint/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,12 @@ export namespace Linter {
type FlatConfigFileSpec = string | ((filePath: string) => boolean);

interface FlatConfig {
/**
* An string to identify the configuration object. Used in error messages and
* inspection tools.
*/
name?: string;

/**
* An array of glob patterns indicating the files that the configuration
* object should apply to. If not specified, the configuration object applies
Expand Down

0 comments on commit b8dc602

Please sign in to comment.