Skip to content

Chore: rewrite 'npm run update' #332

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 1 commit into from
Jan 7, 2018
Merged

Chore: rewrite 'npm run update' #332

merged 1 commit into from
Jan 7, 2018

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Jan 7, 2018

I realized Uncategorized section is duplicate: README.md.
npm run update seems wrong, but it's difficult to identify the cause.

This PR rewrites the npm run update script to be readable.

  • tools/lib/rules.js provides the rule list to be used by update scripts.
  • tools/lib/categories.js provides the category list to be used by update scripts.
  • tools/update-docs.js updates the header of docs/rules/*.md files.
  • tools/update-lib-configs.js updates lib/configs/*.js files.
  • tools/update-lib-index.js updates lib/index.js file.
  • tools/update-readme.js updates the rule tables of lib/README.md file.

Additionally, this PR changes this internal structure a bit.

  • This removes lib/*-rules.js files and npm run update updates lib/configs/*.js directly. Because we don't have lib/config/use-with-caution.js before, but the script seems to make lib/use-with-caution-rules.js if rules exist. This can cause mistakes in future.
  • This removes dependency to file system from this plugin. (npm run update updates lib/index.js instead of using require-all at runtime.)
    It will make easy to use this plugin in browsers.

And this PR changes documents a bit:

  • This adds a new note into docs/rules/*.md files to show which config includes each rule.
  • This adds lacking vue/ prefix to rule IDs in the doc.

Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

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

Amazing ❤️

@michalsnik michalsnik merged commit 9da315c into master Jan 7, 2018
@michalsnik michalsnik deleted the fix-readme branch January 7, 2018 14:47
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.

2 participants