Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit aa89b5a

Browse files
authored
fix: languageOptions.parser should be an object (#220)
1 parent 629c46b commit aa89b5a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/flat-config/language-options.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ import type {
55
SourceType,
66
} from '../parser-options';
77

8+
export type ParserModule =
9+
| {
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
parse(text: string, options?: any): any;
12+
}
13+
| {
14+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15+
parseForESLint(text: string, options?: any): any;
16+
};
17+
818
/**
919
* An object containing settings related to how JavaScript is configured for linting
1020
*/
@@ -43,7 +53,7 @@ export interface LanguageOptions {
4353
*
4454
* @see [Configuring a custom parser and its options](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#configuring-a-custom-parser-and-its-options)
4555
*/
46-
parser?: Parser;
56+
parser?: Parser | ParserModule;
4757

4858
/**
4959
* An object specifying additional options that are passed directly to the `parser()` method on the parser. The available options are parser-dependent.

0 commit comments

Comments
 (0)