Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: rules in recommended #4224

Closed
ph-fritsche opened this issue Nov 26, 2021 · 6 comments
Closed

Docs: rules in recommended #4224

ph-fritsche opened this issue Nov 26, 2021 · 6 comments
Labels
documentation Documentation ("docs") that needs adding/updating working as intended Issues that are closed as they are working as intended

Comments

@ph-fritsche
Copy link

Suggested Changes

The docs should list those rules as recommended that are part of plugin:@typescript-eslint/recommended.

https://typescript-eslint.io/rules/ does not reflect configs/recommended:

@typescript-eslint/adjacent-overload-signatures
- @typescript-eslint/await-thenable
@typescript-eslint/ban-ts-comment
@typescript-eslint/ban-types
+ @typescript-eslint/no-array-constructor
+ @typescript-eslint/no-empty-function
@typescript-eslint/no-empty-interface
@typescript-eslint/no-explicit-any
@typescript-eslint/no-extra-non-null-assertion
+ @typescript-eslint/no-extra-semi
- @typescript-eslint/no-floating-promises
- @typescript-eslint/no-for-in-array
@typescript-eslint/no-inferrable-types
+ @typescript-eslint/no-loss-of-precision
@typescript-eslint/no-misused-new
@typescript-eslint/no-namespace
@typescript-eslint/no-non-null-asserted-optional-chain
@typescript-eslint/no-non-null-assertion
@typescript-eslint/no-this-alias
- @typescript-eslint/no-unnecessary-type-assertion
@typescript-eslint/no-unnecessary-type-constraint
- @typescript-eslint/no-unsafe-argument
- @typescript-eslint/no-unsafe-assignment
- @typescript-eslint/no-unsafe-call
- @typescript-eslint/no-unsafe-member-access
- @typescript-eslint/no-unsafe-return
+ @typescript-eslint/no-unused-vars
@typescript-eslint/no-var-requires
@typescript-eslint/prefer-as-const
@typescript-eslint/prefer-namespace-keyword
- @typescript-eslint/restrict-plus-operands
- @typescript-eslint/restrict-template-expressions
@typescript-eslint/triple-slash-reference
- @typescript-eslint/unbound-method

Affected URL(s)

https://typescript-eslint.io/rules/

@ph-fritsche ph-fritsche added documentation Documentation ("docs") that needs adding/updating triage Waiting for maintainers to take a look labels Nov 26, 2021
@ph-fritsche ph-fritsche changed the title Docs: Docs: rules in recommended Nov 26, 2021
@bradzacher
Copy link
Member

bradzacher commented Nov 26, 2021

https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts

We have two recommended configs that are intentionally separated.

This is mentioned explicitly at the top of that page.

'plugin:@typescript-eslint/recommended-requiring-type-checking' additional recommended rules that require type information. See Linting for more details.

@bradzacher bradzacher added working as intended Issues that are closed as they are working as intended and removed triage Waiting for maintainers to take a look labels Nov 26, 2021
@ph-fritsche
Copy link
Author

But it doesn't reflect plugin:@typescript-eslint/recommended plus plugin:@typescript-eslint/recommended-requiring-type-checking either.

@bradzacher
Copy link
Member

The table is generated - so it contains the same metadata as defined in the rules themselves.
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/tools/generate-rules-lists.ts

So it should all match. What rules are erroneously there / missing?

@ph-fritsche
Copy link
Author

recommended without type information:

@typescript-eslint/adjacent-overload-signatures
@typescript-eslint/ban-ts-comment
@typescript-eslint/ban-types
+ @typescript-eslint/no-array-constructor
+ @typescript-eslint/no-empty-function
@typescript-eslint/no-empty-interface
@typescript-eslint/no-explicit-any
@typescript-eslint/no-extra-non-null-assertion
+ @typescript-eslint/no-extra-semi
@typescript-eslint/no-inferrable-types
+ @typescript-eslint/no-loss-of-precision
@typescript-eslint/no-misused-new
@typescript-eslint/no-namespace
@typescript-eslint/no-non-null-asserted-optional-chain
@typescript-eslint/no-non-null-assertion
@typescript-eslint/no-this-alias
@typescript-eslint/no-unnecessary-type-constraint
+ @typescript-eslint/no-unused-vars
@typescript-eslint/no-var-requires
@typescript-eslint/prefer-as-const
@typescript-eslint/prefer-namespace-keyword
@typescript-eslint/triple-slash-reference

recommended-requiring-type-checking:

@typescript-eslint/await-thenable
@typescript-eslint/no-floating-promises
@typescript-eslint/no-for-in-array
+ @typescript-eslint/no-implied-eval
+ @typescript-eslint/no-misused-promise
@typescript-eslint/no-unnecessary-type-assertion
@typescript-eslint/no-unsafe-argument
@typescript-eslint/no-unsafe-assignment
@typescript-eslint/no-unsafe-call
@typescript-eslint/no-unsafe-member-access
@typescript-eslint/no-unsafe-return
+ @typescript-eslint/require-await
@typescript-eslint/restrict-plus-operands
@typescript-eslint/restrict-template-expressions
+ @typescript-eslint/unbound-method

Sidenote: In light mode the requires-type-information icon lacks contrast:
image

@bradzacher
Copy link
Member

Scroll down to the third table and you'll find those listed:

https://typescript-eslint.io/rules/#extension-rules

@ph-fritsche
Copy link
Author

I stand corrected. Sorry about the false report.
I just got confused scrolling up and down that page and when I found the complete list much faster in the code, I somehow got the impression there was something wrong with the docs. :(

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation ("docs") that needs adding/updating working as intended Issues that are closed as they are working as intended
Projects
None yet
Development

No branches or pull requests

2 participants