@@ -5,11 +5,11 @@ import type { LiteralUnion } from './utility-types';
5
5
/**
6
6
* Any valid ECMAScript version number or 'latest':
7
7
*
8
- * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ...
9
- * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ...
8
+ * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ...
9
+ * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ...
10
10
* - 'latest'
11
11
*
12
- * @see https://github.com/ typescript-eslint/typescript-eslint/tree/master/packages/ parser#parseroptionsecmaversion
12
+ * @see https://typescript-eslint.io/architecture/ parser/#ecmaversion
13
13
*/
14
14
export type EcmaVersion =
15
15
| 3
@@ -22,6 +22,7 @@ export type EcmaVersion =
22
22
| 11
23
23
| 12
24
24
| 13
25
+ | 14
25
26
| 2015
26
27
| 2016
27
28
| 2017
@@ -30,6 +31,7 @@ export type EcmaVersion =
30
31
| 2020
31
32
| 2021
32
33
| 2022
34
+ | 2023
33
35
| 'latest' ;
34
36
35
37
/**
@@ -39,6 +41,9 @@ export type SourceType = 'script' | 'module';
39
41
40
42
/**
41
43
* An object indicating which additional language features you'd like to use.
44
+ *
45
+ * @see https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options
46
+ * @see https://typescript-eslint.io/architecture/parser#ecmafeatures
42
47
*/
43
48
export interface EcmaFeatures extends Partial < Record < string , boolean > > {
44
49
/**
@@ -141,35 +146,76 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
141
146
/**
142
147
* Accepts any valid ECMAScript version number or `'latest'`:
143
148
*
144
- * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ..., or
145
- * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ..., or
149
+ * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
150
+ * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
146
151
* - `'latest'`
147
152
*
148
153
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
149
154
*
150
155
* 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
151
156
*
152
157
* @default 2018
153
- * @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmaversion
158
+ *
159
+ * @see https://typescript-eslint.io/architecture/parser/#ecmaversion
154
160
*/
155
161
ecmaVersion ?: EcmaVersion ;
156
162
157
163
/**
158
164
* Set to "script" (default) or "module" if your code is in ECMAScript modules.
165
+ *
166
+ * @default 'script'
167
+ *
168
+ * @see https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options
159
169
*/
160
170
sourceType ?: SourceType ;
161
171
162
172
/**
163
173
* An object indicating which additional language features you'd like to use.
174
+ *
175
+ * @see https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options
176
+ * @see https://typescript-eslint.io/architecture/parser#ecmafeatures
164
177
*/
165
178
ecmaFeatures ?: EcmaFeatures ;
166
179
180
+ /**
181
+ * The identifier that's used for JSX Elements creation (after transpilation).
182
+ * If you're using a library other than React (like `preact`), then you should change this value.
183
+ * If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`.
184
+ *
185
+ * This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`).
186
+ *
187
+ * If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
188
+ *
189
+ * @default 'React'
190
+ *
191
+ * @see [jsxPragma](https://typescript-eslint.io/architecture/parser#jsxpragma)
192
+ */
167
193
jsxPragma ?: string ;
168
194
195
+ /**
196
+ * The identifier that's used for JSX fragment elements (after transpilation).
197
+ * If `null`, assumes transpilation will always use a member of the configured `jsxPragma`.
198
+ * This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`).
199
+ *
200
+ * If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
201
+ *
202
+ * @default null
203
+ *
204
+ * @see [jsxFragmentName](https://typescript-eslint.io/architecture/parser#jsxfragmentname)
205
+ */
169
206
jsxFragmentName ?: string | null ;
170
207
171
208
/**
172
- * @see [lib](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionslib)
209
+ * For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib).
210
+ *
211
+ * Specifies the TypeScript `libs` that are available.
212
+ * This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript.
213
+ *
214
+ * If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
215
+ *
216
+ * @default ['es2018']
217
+ *
218
+ * @see [lib](https://typescript-eslint.io/architecture/parser/#lib)
173
219
*/
174
220
lib ?: Lib [ ] ;
175
221
@@ -187,7 +233,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
187
233
* The default extensions are `.ts`, `.tsx`, `.js`, and `.jsx`. Add extensions starting with `.`, followed by the file extension.
188
234
* E.g. for a `.vue` file use `"extraFileExtensions: [".vue"]`.
189
235
*
190
- * @see [extraFileExtensions](https://github.com/ typescript-eslint/typescript-eslint/tree/master/packages/ parser#parseroptionsextrafileextensions )
236
+ * @see [extraFileExtensions](https://typescript-eslint.io/architecture/ parser/#extrafileextensions )
191
237
*/
192
238
extraFileExtensions ?: string [ ] ;
193
239
@@ -204,12 +250,28 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
204
250
parser ?: Parser ;
205
251
206
252
/**
207
- * @see [project](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject)
253
+ * This option allows you to provide a path to your project's `tsconfig.json`.
254
+ * **This setting is required if you want to use rules which require type information.**
255
+ * Relative paths are interpreted relative to the current working directory if `tsconfigRootDir` is not set.
256
+ * If you intend on running ESLint from directories other than the project root, you should consider using `tsconfigRootDir`.
257
+ *
258
+ * @default undefined
259
+ *
260
+ * @see [project](https://typescript-eslint.io/architecture/parser/#project)
208
261
*/
209
262
project ?: string | string [ ] ;
210
263
211
264
/**
212
- * @see [projectFolderIgnoreList](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsprojectfolderignorelist)
265
+ * This option allows you to ignore folders from being included in your provided list of `project`s.
266
+ * This is useful if you have configured glob patterns, but want to make sure you ignore certain folders.
267
+ *
268
+ * It accepts an array of globs to exclude from the `project` globs.
269
+ *
270
+ * For example, by default it will ensure that a glob like `./**/tsconfig.json` will not match any `tsconfigs` within your `node_modules` folder (some npm packages do not exclude their source files from their published packages).
271
+ *
272
+ * @default ['**/node_modules/**']
273
+ *
274
+ * @see [projectFolderIgnoreList](https://typescript-eslint.io/architecture/parser/#projectfolderignorelist)
213
275
*/
214
276
projectFolderIgnoreList ?: Array < string | RegExp > ;
215
277
@@ -220,7 +282,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
220
282
/**
221
283
* This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above.
222
284
*
223
- * @see [tsconfigRootDir](https://github.com/ typescript-eslint/typescript-eslint/tree/master/packages/ parser#parseroptionstsconfigrootdir )
285
+ * @see [tsconfigRootDir](https://typescript-eslint.io/architecture/ parser/#tsconfigrootdir )
224
286
*/
225
287
tsconfigRootDir ?: string ;
226
288
@@ -231,17 +293,17 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
231
293
*
232
294
* @default true
233
295
*
234
- * @see [warnOnUnsupportedTypeScriptVersion](https://github.com/ typescript-eslint/typescript-eslint/tree/main/packages/ parser#parseroptionswarnonunsupportedtypescriptversion )
296
+ * @see [warnOnUnsupportedTypeScriptVersion](https://typescript-eslint.io/architecture/ parser/#warnonunsupportedtypescriptversion )
235
297
*/
236
298
warnOnUnsupportedTypeScriptVersion ?: boolean ;
237
299
238
300
/**
239
- * This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/docs/ linting/type -linting/ ).
301
+ * This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/linting/typed -linting).
240
302
* In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
241
303
*
242
304
* @default undefined
243
305
*
244
- * @see [emitDecoratorMetadata](https://github.com/ typescript-eslint/typescript-eslint/tree/main/packages/ parser#parseroptionsemitdecoratormetadata )
306
+ * @see [emitDecoratorMetadata](https://typescript-eslint.io/architecture/ parser/#emitdecoratormetadata )
245
307
*/
246
308
emitDecoratorMetadata ?: boolean ;
247
309
0 commit comments