-
-
Notifications
You must be signed in to change notification settings - Fork 679
Docs: improve document's header #142
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
Conversation
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.
There is mismatch in first line of rules, sometimes first word is lowercase and sometimes its starting with capital case
I added internal rules which are mostly same as eslint/lib/internal-rules to be consistent of rule descriptions. |
lib/rules/jsx-uses-vars.js
Outdated
@@ -37,7 +37,7 @@ SOFTWARE. | |||
module.exports = { | |||
meta: { | |||
docs: { | |||
description: 'Prevent variables used in JSX to be marked as unused', | |||
description: 'prevent variables used in JSX to be marked as unused.', // eslint-disable-line consistent-docs-description |
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.
Why do you disable consistent-docs-description
rule on this line? Can't you remove the dot?
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.
Because it does not fit to descriptions which start with one of enforce
, require
and disallow
. The consistent-docs-description
rule which is cloned from eslint
repo enforces the first word of the description.
lib/rules/no-duplicate-attributes.js
Outdated
@@ -90,7 +90,7 @@ module.exports = { | |||
create, | |||
meta: { | |||
docs: { | |||
description: 'disallow duplicate attributes.', | |||
description: 'disallow duplicate attributes', |
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.
To be consistent we should call it: disallow duplication of attributes
lib/rules/no-reservered-keys.js
Outdated
@@ -49,7 +49,7 @@ function create (context) { | |||
module.exports = { | |||
meta: { | |||
docs: { | |||
description: 'Prevent overwrite reserved keys.', | |||
description: 'disallow overwrite reserved keys', |
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.
disallow overwriting reserved keys
tools/update-rules.js
Outdated
@@ -110,3 +110,21 @@ fs.writeFileSync( | |||
recommendedRulesFile, | |||
recommendedRulesContent | |||
) | |||
|
|||
// Update the header of rule documents. | |||
const headerPattern = /^#[^\n]*\n+(?:- .+\n)*\n*/ |
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.
I'd add a block comment here with example .md that matches this pattern.
Hey @mysticatea would you mind to update this PR? Then we could push this forward, should be quick to resolve my suggestions :) |
Oops, I'm sorry, I have lost this from my brain. I will do. |
# Conflicts: # README.md
This PR improves the header of rule documents.
npm run update
generates the headers from rule's meta data.