Skip to content

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

Merged
merged 6 commits into from
Sep 18, 2017
Merged

Docs: improve document's header #142

merged 6 commits into from
Sep 18, 2017

Conversation

mysticatea
Copy link
Member

This PR improves the header of rule documents.

npm run update generates the headers from rule's meta data.

Copy link
Contributor

@armano2 armano2 left a 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

@mysticatea
Copy link
Member Author

I added internal rules which are mostly same as eslint/lib/internal-rules to be consistent of rule descriptions.

@mysticatea mysticatea requested a review from michalsnik August 14, 2017 05:27
@@ -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
Copy link
Member

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?

Copy link
Member Author

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.

@@ -90,7 +90,7 @@ module.exports = {
create,
meta: {
docs: {
description: 'disallow duplicate attributes.',
description: 'disallow duplicate attributes',
Copy link
Member

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

@@ -49,7 +49,7 @@ function create (context) {
module.exports = {
meta: {
docs: {
description: 'Prevent overwrite reserved keys.',
description: 'disallow overwrite reserved keys',
Copy link
Member

Choose a reason for hiding this comment

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

disallow overwriting reserved keys

@@ -110,3 +110,21 @@ fs.writeFileSync(
recommendedRulesFile,
recommendedRulesContent
)

// Update the header of rule documents.
const headerPattern = /^#[^\n]*\n+(?:- .+\n)*\n*/
Copy link
Member

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.

@michalsnik
Copy link
Member

Hey @mysticatea would you mind to update this PR? Then we could push this forward, should be quick to resolve my suggestions :)

@mysticatea
Copy link
Member Author

Oops, I'm sorry, I have lost this from my brain. I will do.

@michalsnik michalsnik merged commit 94f387e into master Sep 18, 2017
@michalsnik michalsnik deleted the improve-docs branch September 18, 2017 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants