-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add config notice to rule docs #3362
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3362 +/- ##
=======================================
Coverage 97.54% 97.54%
=======================================
Files 123 123
Lines 8873 8873
Branches 3244 3244
=======================================
Hits 8655 8655
Misses 218 218 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I don't think this needs to be closed - I'm not saying we can't indicate it somewhere, but I don't want it prominently displayed. |
Hmm, well how else would we indicate it other than with the new standardized rule doc notice system we have? |
569ead7
to
89d45bb
Compare
0307999
to
3a65a5c
Compare
What if we listed all the configs a rule was in, with a comma-separated list and no icon? |
Okay, presumably there will only ever be
or this for non-
I included a generic "config" emoji so that the notice lines up nicely with the the other fixable/suggestable notices that may be present and looks like an actual notice as opposed to just the rule detail body. If this sounds good, I'll update the PR. |
There's also |
3a65a5c
to
2f53460
Compare
2f53460
to
2a5fd53
Compare
hm, i don't see anything listing |
@ljharb I've updated to the new notice style. It looks like there are no rules in the https://eslint.org/docs/latest/user-guide/configuring/rules#configuring-rules |
oh right, hmm - that still seems important to list, though, since including a config with a rule set to off will overwrite any previous config enabling them? |
I can update the notice to mention which configs turn the rule off too. |
237796d
to
2014782
Compare
@ljharb the notice now mentions when a rule is turned off by a config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
2014782
to
eb3f3d6
Compare
036927c
to
f494052
Compare
f494052
to
c99bdbb
Compare
c99bdbb
to
1656707
Compare
This PR adds the following rule doc notice specifying what configs each rule belongs to.
all
,recommended
.For a few rules, the notice will also indicate when the rules are disabled by a particular config.
This improves usability by enabling users to clearly and easily find out if a rule is applying to their codebase given their configuration.
This notice is tested to ensure it isn't forgotten.
It's common for ESLint and many popular ESLint plugins to include a notice like this too. A couple examples: