Skip to content

Commit

Permalink
fix: languageOptions.parser should be an object (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotEvenANeko committed Aug 4, 2023
1 parent 629c46b commit aa89b5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/flat-config/language-options.d.ts
Expand Up @@ -5,6 +5,16 @@ import type {
SourceType,
} from '../parser-options';

export type ParserModule =
| {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parse(text: string, options?: any): any;
}
| {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parseForESLint(text: string, options?: any): any;
};

/**
* An object containing settings related to how JavaScript is configured for linting
*/
Expand Down Expand Up @@ -43,7 +53,7 @@ export interface LanguageOptions {
*
* @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)
*/
parser?: Parser;
parser?: Parser | ParserModule;

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

0 comments on commit aa89b5a

Please sign in to comment.