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

Commit 82e77f5

Browse files
author
Christopher Quadflieg
committed
Update ParserOptions#ecmaVersion
1 parent da71be3 commit 82e77f5

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

src/parser-options.d.ts

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
import type { LiteralUnion } from './utility-types';
22

33
/**
4-
* Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming.
4+
* Any valid ECMAScript version number or 'latest':
55
*
6-
* @default 5
6+
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ...
7+
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ...
8+
* - 'latest'
9+
*
10+
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmaversion
711
*/
8-
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021;
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';
932

1033
/**
1134
* Set to "script" (default) or "module" if your code is in ECMAScript modules.
@@ -108,9 +131,18 @@ export type Parser = LiteralUnion<'babel-eslint' | '@typescript-eslint/parser' |
108131
*/
109132
export interface ParserOptions extends Partial<Record<string, unknown>> {
110133
/**
111-
* Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming.
134+
* Accepts any valid ECMAScript version number or 'latest':
135+
*
136+
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ...
137+
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ...
138+
* - 'latest'
139+
*
140+
* When it's a version or a year, the value must be a number - so do not include the es prefix.
141+
*
142+
* Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
112143
*
113-
* @default 5
144+
* @default 2018
145+
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmaversion
114146
*/
115147
ecmaVersion?: EcmaVersion;
116148
/**

0 commit comments

Comments
 (0)