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

Commit b58f401

Browse files
author
Quadflieg , Christopher
committed
Update config and JSDocs
1 parent 8ca5721 commit b58f401

File tree

5 files changed

+126
-38
lines changed

5 files changed

+126
-38
lines changed

src/config/env.d.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,50 @@ export interface Environments extends Partial<Record<string, boolean>> {
2525
'shared-node-browser'?: boolean;
2626

2727
/**
28-
* Enable all ECMAScript 6 features except for modules (this automatically sets the ecmaVersion parser option to 6).
28+
* Enable all ECMAScript 6 features except for modules (this automatically sets the `ecmaVersion` parser option to 6).
2929
*/
3030
es6?: boolean;
3131

3232
/**
33-
* Adds all ECMAScript 2017 globals and automatically sets the ecmaVersion parser option to 8.
33+
* Adds all ECMAScript 2016 globals and automatically sets the `ecmaVersion` parser option to 7.
34+
*/
35+
es2016?: boolean;
36+
37+
/**
38+
* Adds all ECMAScript 2017 globals and automatically sets the `ecmaVersion` parser option to 8.
3439
*/
3540
es2017?: boolean;
3641

3742
/**
38-
* Adds all ECMAScript 2020 globals and automatically sets the ecmaVersion parser option to 11.
43+
* Adds all ECMAScript 2018 globals and automatically sets the `ecmaVersion` parser option to 9.
44+
*/
45+
es2018?: boolean;
46+
47+
/**
48+
* Adds all ECMAScript 2019 globals and automatically sets the `ecmaVersion` parser option to 10.
49+
*/
50+
es2019?: boolean;
51+
52+
/**
53+
* Adds all ECMAScript 2020 globals and automatically sets the `ecmaVersion` parser option to 11.
3954
*/
4055
es2020?: boolean;
4156

4257
/**
43-
* Adds all ECMAScript 2021 globals and automatically sets the ecmaVersion parser option to 12.
58+
* Adds all ECMAScript 2021 globals and automatically sets the `ecmaVersion` parser option to 12.
4459
*/
4560
es2021?: boolean;
4661

62+
/**
63+
* Adds all ECMAScript 2022 globals and automatically sets the `ecmaVersion` parser option to 13.
64+
*/
65+
es2022?: boolean;
66+
67+
/**
68+
* Adds all ECMAScript 2023 globals and automatically sets the `ecmaVersion` parser option to 14.
69+
*/
70+
es2023?: boolean;
71+
4772
/**
4873
* Web workers global variables.
4974
*/
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
22
* Typescript eslint extensions.
33
*
4-
* @see [Typescript eslint extensions](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md#configuration)
4+
* @see [Typescript eslint extensions](https://typescript-eslint.io/linting/configs#recommended-configurations)
55
*/
66
export type TypescriptEslintExtensions =
77
| 'plugin:@typescript-eslint/recommended'
8-
| 'plugin:@typescript-eslint/recommended-requiring-type-checking';
8+
| 'plugin:@typescript-eslint/recommended-requiring-type-checking'
9+
| 'plugin:@typescript-eslint/strict';

src/config/index.d.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,39 @@ import type { Settings } from './settings';
99
/**
1010
* ESLint Configuration.
1111
*
12-
* @see [ESLint Configuration](https://ESLint.org/docs/user-guide/configuring/)
12+
* @see [ESLint Configuration](https://eslint.org/docs/latest/user-guide/configuring/)
1313
*/
1414
export interface ESLintConfig {
1515
/**
16-
* @see [Using Configuration Files](https://ESLint.org/docs/user-guide/configuring/configuration-files#using-configuration-files)
16+
* @see [Using Configuration Files](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-configuration-files)
1717
*/
1818
root?: boolean;
1919

2020
/**
2121
* Tell ESLint to ignore specific files and directories.
2222
*
23-
* @see [Ignore Patterns](https://ESLint.org/docs/user-guide/configuring/ignoring-code)
23+
* @see [Ignore Patterns](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code)
2424
*/
2525
ignorePatterns?: string[];
2626

2727
/**
2828
* An environment provides predefined global variables.
2929
*
30-
* @see [Environments](https://ESLint.org/docs/user-guide/configuring/language-options#specifying-environments)
30+
* @see [Environments](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-environments)
3131
*/
3232
env?: Environments;
3333

3434
/**
3535
* Extending Configuration Files.
3636
*
37-
* @see [Extends](https://ESLint.org/docs/user-guide/configuring/configuration-files#extending-configuration-files)
37+
* @see [Extends](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#extending-configuration-files)
3838
*/
3939
extends?: Extends;
4040

4141
/**
4242
* Specifying Globals.
4343
*
44-
* @see [Globals](https://ESLint.org/docs/user-guide/configuring/language-options#specifying-globals)
44+
* @see [Globals](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-globals)
4545
*/
4646
globals?: Record<
4747
string,
@@ -51,65 +51,65 @@ export interface ESLintConfig {
5151
/**
5252
* Parser.
5353
*
54-
* @see [Working with Custom Parsers](https://ESLint.org/docs/developer-guide/working-with-custom-parsers)
55-
* @see [Specifying Parser](https://ESLint.org/docs/user-guide/configuring/plugins#specifying-parser)
54+
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/developer-guide/working-with-custom-parsers)
55+
* @see [Specifying Parser](https://eslint.org/docs/latest/user-guide/configuring/plugins#configure-a-parser)
5656
*/
5757
parser?: Parser;
5858

5959
/**
6060
* Parser Options.
6161
*
62-
* @see [Working with Custom Parsers](https://ESLint.org/docs/developer-guide/working-with-custom-parsers)
63-
* @see [Specifying Parser Options](https://ESLint.org/docs/user-guide/configuring/language-options#specifying-parser-options)
62+
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/developer-guide/working-with-custom-parsers)
63+
* @see [Specifying Parser Options](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-parser-options)
6464
*/
6565
parserOptions?: ParserOptions;
6666

6767
/**
6868
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
6969
*
70-
* @see [Configuring Plugins](https://ESLint.org/docs/user-guide/configuring/plugins#configuring-plugins)
70+
* @see [Configuring Plugins](https://eslint.org/docs/latest/user-guide/configuring/plugins#configure-plugins)
7171
*/
7272
plugins?: Plugin[];
7373

7474
/**
7575
* Specifying Processor.
7676
*
77-
* @see [processor](https://ESLint.org/docs/user-guide/configuring/plugins#specifying-processor)
77+
* @see [processor](https://eslint.org/docs/latest/user-guide/configuring/plugins#specify-a-processor)
7878
*/
7979
processor?: string;
8080

8181
/**
8282
* Rules.
8383
*
84-
* @see [Rules](https://ESLint.org/docs/user-guide/configuring/rules)
84+
* @see [Rules](https://eslint.org/docs/latest/user-guide/configuring/rules)
8585
*/
8686
rules?: Rules;
8787

8888
/**
8989
* Overrides.
9090
*
91-
* @see [How do overrides work](https://ESLint.org/docs/user-guide/configuring/configuration-files#how-do-overrides-work)
91+
* @see [How do overrides work](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#how-do-overrides-work)
9292
*/
9393
overrides?: Overrides;
9494

9595
/**
9696
* Settings.
9797
*
98-
* @see [Settings](https://ESLint.org/docs/user-guide/configuring/configuration-files#adding-shared-settings)
98+
* @see [Settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#adding-shared-settings)
9999
*/
100100
settings?: Settings;
101101

102102
/**
103103
* Disabling Inline Comments.
104104
*
105-
* @see [Disabling Inline Comments](https://ESLint.org/docs/user-guide/configuring/rules#disabling-inline-comments)
105+
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/user-guide/configuring/rules#disabling-inline-comments)
106106
*/
107107
noInlineConfig?: boolean;
108108

109109
/**
110110
* Report unused `ESLint-disable` comments.
111111
*
112-
* @see [Report unused `ESLint-disable` comments](https://ESLint.org/docs/user-guide/configuring/rules#report-unused-ESLint-disable-comments)
112+
* @see [Report unused `ESLint-disable` comments](https://eslint.org/docs/latest/user-guide/configuring/rules#report-unused-eslint-disable-comments)
113113
*/
114114
reportUnusedDisableDirectives?: boolean;
115115
}

src/config/overrides.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface Override {
3030
/**
3131
* Specifying Globals.
3232
*
33-
* @see [Globals](https://ESLint.org/docs/user-guide/configuring/language-options#specifying-globals)
33+
* @see [Globals](https://eslint.org/docs/latest/user-guide/configuring/language-options#specifying-globals)
3434
*/
3535
globals?: Record<
3636
string,

src/parser-options.d.ts

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import type { LiteralUnion } from './utility-types';
55
/**
66
* Any valid ECMAScript version number or 'latest':
77
*
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, ...
1010
* - 'latest'
1111
*
12-
* @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmaversion
12+
* @see https://typescript-eslint.io/architecture/parser/#ecmaversion
1313
*/
1414
export type EcmaVersion =
1515
| 3
@@ -22,6 +22,7 @@ export type EcmaVersion =
2222
| 11
2323
| 12
2424
| 13
25+
| 14
2526
| 2015
2627
| 2016
2728
| 2017
@@ -30,6 +31,7 @@ export type EcmaVersion =
3031
| 2020
3132
| 2021
3233
| 2022
34+
| 2023
3335
| 'latest';
3436

3537
/**
@@ -39,6 +41,9 @@ export type SourceType = 'script' | 'module';
3941

4042
/**
4143
* 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
4247
*/
4348
export interface EcmaFeatures extends Partial<Record<string, boolean>> {
4449
/**
@@ -141,35 +146,76 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
141146
/**
142147
* Accepts any valid ECMAScript version number or `'latest'`:
143148
*
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
146151
* - `'latest'`
147152
*
148153
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
149154
*
150155
* 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
151156
*
152157
* @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
154160
*/
155161
ecmaVersion?: EcmaVersion;
156162

157163
/**
158164
* 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
159169
*/
160170
sourceType?: SourceType;
161171

162172
/**
163173
* 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
164177
*/
165178
ecmaFeatures?: EcmaFeatures;
166179

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+
*/
167193
jsxPragma?: string;
168194

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+
*/
169206
jsxFragmentName?: string | null;
170207

171208
/**
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)
173219
*/
174220
lib?: Lib[];
175221

@@ -187,7 +233,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
187233
* The default extensions are `.ts`, `.tsx`, `.js`, and `.jsx`. Add extensions starting with `.`, followed by the file extension.
188234
* E.g. for a `.vue` file use `"extraFileExtensions: [".vue"]`.
189235
*
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)
191237
*/
192238
extraFileExtensions?: string[];
193239

@@ -204,12 +250,28 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
204250
parser?: Parser;
205251

206252
/**
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)
208261
*/
209262
project?: string | string[];
210263

211264
/**
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)
213275
*/
214276
projectFolderIgnoreList?: Array<string | RegExp>;
215277

@@ -220,7 +282,7 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
220282
/**
221283
* This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above.
222284
*
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)
224286
*/
225287
tsconfigRootDir?: string;
226288

@@ -231,17 +293,17 @@ export interface ParserOptions extends Partial<Record<string, unknown>> {
231293
*
232294
* @default true
233295
*
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)
235297
*/
236298
warnOnUnsupportedTypeScriptVersion?: boolean;
237299

238300
/**
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).
240302
* In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
241303
*
242304
* @default undefined
243305
*
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)
245307
*/
246308
emitDecoratorMetadata?: boolean;
247309

0 commit comments

Comments
 (0)