Skip to content

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
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.

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

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

)

// 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.

4 participants