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

Commit 40f11d4

Browse files
committed
Define knwon parsers
1 parent 8221d14 commit 40f11d4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Environments } from './env';
22
import type { Extends } from './extends';
33
import type { Overrides } from './overrides';
4-
import type { ParserOptions } from './parser-options';
4+
import type { Parser, ParserOptions } from './parser-options';
55
import type { Rules } from './rules';
66
import type { Settings } from './settings';
77

@@ -39,7 +39,7 @@ export interface EslintConfig {
3939
* @see [Working with Custom Parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers)
4040
* @see [Specifying Parser](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser)
4141
*/
42-
parser?: string;
42+
parser?: Parser;
4343
/**
4444
* Parser Options.
4545
*

src/parser-options.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export type Lib = LiteralUnion<
8080
/** DebugLevel. */
8181
export type DebugLevel = boolean | Array<'eslint' | 'typescript' | 'typescript-eslint'>;
8282

83+
/** Parser. */
84+
export type Parser = LiteralUnion<'@typescript-eslint/parser'>;
85+
8386
/**
8487
* Parser options.
8588
*
@@ -129,7 +132,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
129132
* @see [Working with Custom Parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers)
130133
* @see [Specifying Parser](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser)
131134
*/
132-
parser?: string;
135+
parser?: Parser;
133136
project?: string | string[];
134137
projectFolderIgnoreList?: Array<string | RegExp>;
135138
range?: boolean;

0 commit comments

Comments
 (0)