Skip to content

Commit

Permalink
fix: correct overrideConfigFile type (#19289)
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime authored Dec 29, 2024
1 parent 8c07ebb commit da768d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ export namespace ESLint {
allowInlineConfig?: boolean | undefined;
baseConfig?: Linter.Config | Linter.Config[] | null | undefined;
overrideConfig?: Linter.Config | Linter.Config[] | null | undefined;
overrideConfigFile?: string | boolean | undefined;
overrideConfigFile?: string | true | null | undefined;
plugins?: Record<string, Plugin> | null | undefined;
ruleFilter?: ((arg: { ruleId: string; severity: Exclude<Linter.Severity, 0> }) => boolean) | undefined;
stats?: boolean | undefined;
Expand Down
10 changes: 8 additions & 2 deletions tests/lib/types/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,6 @@ linterWithEslintrcConfig.getRules();
eslint = new ESLint();
eslint = new ESLint({ allowInlineConfig: false });
eslint = new ESLint({ baseConfig: {} });
eslint = new ESLint({ overrideConfig: {} });
eslint = new ESLint({ overrideConfigFile: "foo" });
eslint = new ESLint({ cache: true });
eslint = new ESLint({ cacheLocation: "foo" });
eslint = new ESLint({ cacheStrategy: "content" });
Expand All @@ -941,6 +939,14 @@ linterWithEslintrcConfig.getRules();
eslint = new ESLint({ globInputPaths: true });
eslint = new ESLint({ ignore: true });
eslint = new ESLint({ ignorePatterns: ["foo", "bar"] });
eslint = new ESLint({ overrideConfig: {} });

eslint = new ESLint({ overrideConfigFile: "foo" });
eslint = new ESLint({ overrideConfigFile: true });
eslint = new ESLint({ overrideConfigFile: null });
// @ts-expect-error `overrideConfigFile` cannot be `false`
eslint = new ESLint({ overrideConfigFile: false });

eslint = new ESLint({ plugins: { foo: {} } });
eslint = new ESLint({
ruleFilter({ severity }) {
Expand Down

0 comments on commit da768d4

Please sign in to comment.