Skip to content

Commit 90576fa

Browse files
feat(typescript-eslint): add JSDoc comments on generated configs (#9672)
* feat(typescript-eslint): add JSDoc comments on generated configs * Also add to index.ts
1 parent fe56157 commit 90576fa

15 files changed

+167
-12
lines changed

packages/typescript-eslint/src/configs/all.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.
15+
* @see {@link https://typescript-eslint.io/users/configs#all}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
22

3+
/**
4+
* A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
5+
* We don't recommend using this directly; instead, extend from an earlier recommended rule.
6+
* @see {@link https://typescript-eslint.io/users/configs#base}
7+
*/
38
export default (
49
plugin: FlatConfig.Plugin,
510
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/disable-type-checked.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
99

10+
/**
11+
* A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
12+
* @see {@link https://typescript-eslint.io/users/configs#disable-type-checked}
13+
*/
1014
export default (
1115
_plugin: FlatConfig.Plugin,
1216
_parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/eslint-recommended.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
55
* This is a compatibility ruleset that:
66
* - disables rules from eslint:recommended which are already handled by TypeScript.
77
* - enables rules that make sense due to TS's typechecking / transpilation.
8+
* @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
89
*/
910
export default (
1011
_plugin: FlatConfig.Plugin,

packages/typescript-eslint/src/configs/recommended-type-checked-only.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.
15+
* @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/recommended-type-checked.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* Contains all of `recommended` along with additional recommended rules that require type information.
15+
* @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/recommended.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* Recommended rules for code correctness that you can drop in without additional configuration.
15+
* @see {@link https://typescript-eslint.io/users/configs#recommended}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/strict-type-checked-only.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.
15+
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/strict-type-checked.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
15+
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

packages/typescript-eslint/src/configs/strict.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
1010
import baseConfig from './base';
1111
import eslintRecommendedConfig from './eslint-recommended';
1212

13+
/**
14+
* Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
15+
* @see {@link https://typescript-eslint.io/users/configs#strict}
16+
*/
1317
export default (
1418
plugin: FlatConfig.Plugin,
1519
parser: FlatConfig.Parser,

0 commit comments

Comments
 (0)