8000 Docs: Add rationale to rules · Issue #5265 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Docs: Add rationale to rules #5265

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

Closed
2 tasks done
hoffa opened this issue Jun 27, 2022 · 2 comments
Closed
2 tasks done

Docs: Add rationale to rules #5265

hoffa opened this issue Jun 27, 2022 · 2 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

Comments

@hoffa
Copy link
hoffa commented Jun 27, 2022

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

Would be great if the rules consistently explained why something is a rule.

See e.g. shellcheck rules, which always include a "Rationale" section:

For typescript-eslint, the rationales are either unclear (mixed in the what section) or missing (e.g. https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-template-expressions.md).

A rationale would help developers improve their understanding as they stumble upon violations, and would help rule writers clarify their reasoning.

Affected URL(s)

Some examples:

@hoffa hoffa added documentation Documentation ("docs") that needs adding/updating triage Waiting for team members to take a look labels Jun 27, 2022
@JoshuaKGoldberg
Copy link
Member

Strong agree! We can treat this as a spin-off / subset of #4861, in that this is a big part of why a lot of rule docs are unclear.

It'd be great to have testing set up to make sure each rule has a Rule Details section and at least one sentence explaining the rule. Right now that's in Jest tests but will likely eventually be linting. #4366.

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jun 28, 2022
@JoshuaKGoldberg
Copy link
Member
JoshuaKGoldberg commented Aug 22, 2024

Following up on this old issue, we've had a lot of docs overhauls land:

At this point, roughly all rules have a 1-2 paragraph rationale as their opening descriptions. So I think we can close this general issue out as resolved.

But! Docs are never done, and it's a certainty some rules don't have informative rationales. Request to anybody reading this: if you see a rule whose docs are lacking, please file a new issue. That'd be lovely. ❤️

@github-project-automation github-project-automation bot moved this from Todo to Done in Documentation Aug 22, 2024
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Aug 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue documentation Documentation ("docs") that needs adding/updating locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants
@hoffa @JoshuaKGoldberg and others
0