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

Commit 92c78c4

Browse files
author
Christopher Quadflieg
committed
Reuse eslint type
1 parent 82e77f5 commit 92c78c4

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/parser-options.d.ts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Linter } from 'eslint';
12
import type { LiteralUnion } from './utility-types';
23

34
/**
@@ -9,31 +10,12 @@ import type { LiteralUnion } from './utility-types';
910
*
1011
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmaversion
1112
*/
12-
export type EcmaVersion =
13-
| 3
14-
| 5
15-
| 6
16-
| 7
17-
| 8
18-
| 9
19-
| 10
20-
| 11
21-
| 12
22-
| 13
23-
| 2015
24-
| 2016
25-
| 2017
26-
| 2018
27-
| 2019
28-
| 2020
29-
| 2021
30-
| 2022
31-
| 'latest';
13+
export type EcmaVersion = NonNullable<Linter.ParserOptions['ecmaVersion']>;
3214

3315
/**
3416
* Set to "script" (default) or "module" if your code is in ECMAScript modules.
3517
*/
36-
export type SourceType = 'script' | 'module';
18+
export type SourceType = NonNullable<Linter.ParserOptions['sourceType']>;
3719

3820
/**
3921
* An object indicating which additional language features you'd like to use.

0 commit comments

Comments
 (0)