Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs(eslint-plugin): standardize rule description format#4976

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

Josh-Cena
Copy link
Member

PR Checklist

Overview

Right, so here's some unwieldy chores.

  1. All rule descriptions now use imperative mood—no third-person singular.
  2. All rule descriptions start withenforce/require/disallow—following ESLint format.
  3. Some wordings have been refactored to be shorter.

Should we add it to the tests that descriptions must start withenforce/require/disallow?

@nx-cloud
Copy link

nx-cloudbot commentedMay 15, 2022
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit0544b7a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@Josh-Cena!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@netlify
Copy link

netlifybot commentedMay 15, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit0544b7a
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/62938c0d8ab4c200094aea70
😎 Deploy Previewhttps://deploy-preview-4976--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site settings.

| [`@typescript-eslint/semi`](./semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | |
| [`@typescript-eslint/space-before-function-paren`](./space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | |
| [`@typescript-eslint/space-infix-ops`](./space-infix-ops.md) | This rule is aimed at ensuring there are spaces around infix operators. | | :wrench: | |
| [`@typescript-eslint/space-before-blocks`](./space-before-blocks.md) | Enforce consistent spacing before blocks | | :wrench: | |
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

There are some rules missing in this file. I assume it's simply an oversight.

armano2 reacted with thumbs up emoji
Copy link
Member

@bradzacherbradzacherMay 16, 2022
edited
Loading

Choose a reason for hiding this comment

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

there shouldn't be any missing files - it should be tested against and enforced.

or maybe this readme file isn't tested like the main readme is...?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I don't think it's tested as comprehensively as the main readme, no.

Copy link
Member

Choose a reason for hiding this comment

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

We should definitely fix this! Considering this file powers our website - it should be generated and tested just like the one in the main readme!

Or perhaps we should just generate the website table at website build time instead of making it rely on a markdown file on disk?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Certainly. I've addeddocs/rules/README.md to the tests.

we should just generate the website table at website build time

We can do that later; it's a bit harder.

bradzacher reacted with thumbs up emoji
@codecov
Copy link

codecovbot commentedMay 15, 2022
edited
Loading

Codecov Report

Merging#4976 (3282f97) intomain (8febf11) willincrease coverage by2.50%.
The diff coverage isn/a.

❗ Current head3282f97 differs from pull request most recent head0544b7a. Consider uploading reports for the commit0544b7a to get more accurate results

@@            Coverage Diff             @@##             main    #4976      +/-   ##==========================================+ Coverage   91.32%   93.83%   +2.50%==========================================  Files         132      286     +154       Lines        1487     9838    +8351       Branches      224     2939    +2715     ==========================================+ Hits         1358     9231    +7873- Misses         65      328     +263- Partials       64      279     +215
FlagCoverage Δ
unittest93.83% <ø> (+2.50%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
packages/eslint-plugin/src/rules/array-type.ts97.18% <ø> (ø)
packages/eslint-plugin/src/rules/await-thenable.ts100.00% <ø> (ø)
packages/eslint-plugin/src/rules/ban-ts-comment.ts97.05% <ø> (ø)
...ages/eslint-plugin/src/rules/ban-tslint-comment.ts100.00% <ø> (ø)
packages/eslint-plugin/src/rules/ban-types.ts100.00% <ø> (ø)
...t-plugin/src/rules/class-literal-property-style.ts100.00% <ø> (ø)
packages/eslint-plugin/src/rules/comma-dangle.ts93.33% <ø> (ø)
packages/eslint-plugin/src/rules/comma-spacing.ts100.00% <ø> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts92.06% <ø> (ø)
...int-plugin/src/rules/consistent-type-assertions.ts88.88% <ø> (ø)
... and220 more

@@ -1,6 +1,6 @@
# `array-type`

Requires using either `T[]` or `Array<T>` for arrays.
Require using either `T[]` or `Array<T>` for arrays.

Choose a reason for hiding this comment

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

Oh, interesting! I was actually thinking of going the other way and preferring third-person singular."Requires XYZ" and such.

Reasoning: imperative mood reads (to me, at least) as a command: that you should do the thing in the sentence. That's only true for some rules, and then within each rule not true for all projects.

OTOH third-person singular indicates it's describing the rule. That's more directly the goal of these description strings & docs.

For reference,https://eslint.org/docs/rules uses imperative but the individual pages such ashttps://eslint.org/docs/rules/array-callback-return use third-person singular.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah, maybe I should line up the format with ESLint's, then? Using third-person singular for individual pages.

As for the "command-sounding" tone, though, the imperative mood reads like a description as well. "Require"/"Disallow" etc. sound obvious enough that the omitted subject is "the rule", instead of "you must do X".

Choose a reason for hiding this comment

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

Yeah I'm thinking it would make sense for ESLint to use third-person singulareverywhere 🤷

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

FWIW, I like saving one character😥

JoshuaKGoldberg and armano2 reacted with laugh emoji
@Josh-CenaJosh-Cenaforce-pushed thestandardize-description branch fromf8b7b7f to88c3061CompareMay 16, 2022 15:23
@bradzacherbradzacher added the documentationDocumentation ("docs") that needs adding/updating labelMay 16, 2022
@bradzacherbradzacher changed the titlechore: standardize rule description formatdocs(eslint-plugin): standardize rule description formatMay 16, 2022
@Josh-Cena
Copy link
MemberAuthor

Merge conflicts, merge conflicts... 😥

JoshuaKGoldberg reacted with laugh emoji

Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

this is looking good to me
I'll leave it to our resident documentation master@JoshuaKGoldberg for the final stamp.

JoshuaKGoldberg reacted with heart emoji
@JoshuaKGoldberg
Copy link
Member

I'm a bit swamped with PR things at the moment, but should get through my backlog... soon! This week!

bradzacher reacted with heart emoji

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Fantastic, thanks! This standardization will be super helpful as we continue to automate the site.

text: `${rule.meta.docs?.description.replace(
/(?<!`)(require|enforce|disallow)/gi,
'$1s',
)}.`,

Choose a reason for hiding this comment

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

Continuing the thread from#4976 (comment): I'd really rather we didn't do the extra work to massage between one and two. In addition to requiring (admittedly clever) tricks like this one, I get a bit of cognitively dissonance havingslightly different descriptions for the same rule in multiple places.

It's fine having this here for now, so we can just move this discussion to#5096 as a followup if you feel strongly.

Copy link
MemberAuthor

@Josh-CenaJosh-CenaMay 29, 2022
edited
Loading

Choose a reason for hiding this comment

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

I agree. I also mentioned in#5085 (comment) I'd like this to be eventually automated as well. However, I do prefer the table to be imperative because it looks more... succinct & professional? My own feeling when reading the ESLint docs.

@JoshuaKGoldbergJoshuaKGoldbergenabled auto-merge (squash)May 29, 2022 15:06
@JoshuaKGoldbergJoshuaKGoldberg merged commitdc58ff5 intotypescript-eslint:mainMay 29, 2022
@Josh-CenaJosh-Cena deleted the standardize-description branchMay 29, 2022 15:19
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJun 29, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher left review comments

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees
No one assigned
Labels
documentationDocumentation ("docs") that needs adding/updating
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Josh-Cena@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp