Skip to content

Commit da768d4

Browse files
authored
fix: correct overrideConfigFile type (#19289)
1 parent 8c07ebb commit da768d4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ export namespace ESLint {
14841484
allowInlineConfig?: boolean | undefined;
14851485
baseConfig?: Linter.Config | Linter.Config[] | null | undefined;
14861486
overrideConfig?: Linter.Config | Linter.Config[] | null | undefined;
1487-
overrideConfigFile?: string | boolean | undefined;
1487+
overrideConfigFile?: string | true | null | undefined;
14881488
plugins?: Record<string, Plugin> | null | undefined;
14891489
ruleFilter?: ((arg: { ruleId: string; severity: Exclude<Linter.Severity, 0> }) => boolean) | undefined;
14901490
stats?: boolean | undefined;

tests/lib/types/types.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,6 @@ linterWithEslintrcConfig.getRules();
927927
eslint = new ESLint();
928928
eslint = new ESLint({ allowInlineConfig: false });
929929
eslint = new ESLint({ baseConfig: {} });
930-
eslint = new ESLint({ overrideConfig: {} });
931-
eslint = new ESLint({ overrideConfigFile: "foo" });
932930
eslint = new ESLint({ cache: true });
933931
eslint = new ESLint({ cacheLocation: "foo" });
934932
eslint = new ESLint({ cacheStrategy: "content" });
@@ -941,6 +939,14 @@ linterWithEslintrcConfig.getRules();
941939
eslint = new ESLint({ globInputPaths: true });
942940
eslint = new ESLint({ ignore: true });
943941
eslint = new ESLint({ ignorePatterns: ["foo", "bar"] });
942+
eslint = new ESLint({ overrideConfig: {} });
943+
944+
eslint = new ESLint({ overrideConfigFile: "foo" });
945+
eslint = new ESLint({ overrideConfigFile: true });
946+
eslint = new ESLint({ overrideConfigFile: null });
947+
// @ts-expect-error `overrideConfigFile` cannot be `false`
948+
eslint = new ESLint({ overrideConfigFile: false });
949+
944950
eslint = new ESLint({ plugins: { foo: {} } });
945951
eslint = new ESLint({
946952
ruleFilter({ severity }) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy