Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eslint]: support name field in FlatConfig #69185

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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