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: Link to unit tests from rule documentation #15207

Merged
merged 1 commit into from Oct 26, 2021
Merged

Conversation

btmills
Copy link
Member

@btmills btmills commented Oct 25, 2021

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

In the Resources section at the bottom of each rule's documentation, we already link to the rule's implementation and the documentation's Markdown source. I've wished multiple times to have a handy link to the unit tests as well to see if a case is covered. This adds that link.

Is there anything you'd like reviewers to focus on?

For example, I ran npm run gensite locally, and here's the diff for the accessor-pairs documentation:

diff --git docs/rules/accessor-pairs.md docs/rules/accessor-pairs.md
index 8623782d..23de1f59 100644
--- docs/rules/accessor-pairs.md
+++ docs/rules/accessor-pairs.md
@@ -303,4 +303,5 @@ This rule was introduced in ESLint 0.22.0.
 ## Resources

 * [Rule source](https://github.com/eslint/eslint/tree/HEAD/lib/rules/accessor-pairs.js)
+* [Test source](https://github.com/eslint/eslint/tree/HEAD/tests/lib/rules/accessor-pairs.js)
 * [Documentation source](https://github.com/eslint/eslint/tree/HEAD/docs/rules/accessor-pairs.md)

In the Resources section at the bottom of each rule's documentation, we
already link to the rule's implementation and the documentation's
Markdown source. This adds a link to the rule's unit tests.
@btmills btmills added documentation Relates to ESLint's documentation build This change relates to ESLint's build process evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 25, 2021
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking if this. 👍

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@mdjermanovic mdjermanovic changed the title Docs: Link to unit tests from rule documentation docs: Link to unit tests from rule documentation Oct 26, 2021
@eslint-github-bot
Copy link

Hi @btmills!, thanks for the Pull Request

The first commit message isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

Read more about contributing to ESLint here

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 26, 2021
@aladdin-add
Copy link
Member

aladdin-add commented Oct 26, 2021

marked accepted, as no objections from the team. 😄

@nzakas nzakas merged commit ee8af5f into main Oct 26, 2021
@nzakas nzakas deleted the rule-docs-link-tests branch October 26, 2021 19:10
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Apr 25, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion build This change relates to ESLint's build process documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants