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

fix: languageOptions.parser should be an object #220

Merged
merged 3 commits into from Aug 4, 2023
Merged
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
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