Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b785ac7

Browse files
committedAug 9, 2022
add comments
1 parent 746af73 commit b785ac7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/common/parser-object.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
import type { ESLintExtendedProgram, ESLintProgram } from "../ast"
22

3+
/**
4+
* The type of basic ESLint custom parser.
5+
* e.g. espree
6+
*/
37
export type BasicParserObject<R = ESLintProgram> = {
48
parse(code: string, options: any): R
59
parseForESLint: undefined
610
}
11+
/**
12+
* The type of ESLint custom parser enhanced for ESLint.
13+
* e.g. @babel/eslint-parser, @typescript-eslint/parser
14+
*/
715
export type EnhancedParserObject<R = ESLintExtendedProgram> = {
816
parseForESLint(code: string, options: any): R
917
parse: undefined
1018
}
1119

20+
/**
21+
* The type of ESLint (custom) parsers.
22+
*/
1223
export type ParserObject<R1 = ESLintExtendedProgram, R2 = ESLintProgram> =
1324
| EnhancedParserObject<R1>
1425
| BasicParserObject<R2>

0 commit comments

Comments
 (0)
Please sign in to comment.