Skip to content
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

New: CLIEngine#getRules() (refs #6582) #9782

Merged
merged 1 commit into from Jan 4, 2018

Conversation

pmcelhaney
Copy link
Contributor

What is the purpose of this pull request? (put an "X" next to item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[x] Add a CLI option method
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

  • add CLIEngine#getRules() as discussed in TSC
  • update the documentation and unit tests

Is there anything you'd like reviewers to focus on?

Next step::

  • add meta.docs.url to each of the built-in rules
  • document meta.docs.url as a property that third party rules are encouraged to include

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for contributing!

@j-f1
Copy link
Contributor

j-f1 commented Dec 28, 2017

Would it be possible to add a method on the exported plugin object that generates the docs URL so that people can optionally DRY out their code? (i.e. getDocsURL: name => `https://github.com/foo/eslint-plugin-bar/blob/master/docs/rules/${name}.md` instead of providing meta.docs.url on each rule)

@platinumazure
Copy link
Member

platinumazure commented Dec 28, 2017 via email

@ilyavolodin
Copy link
Member

Also it already can be done by extracting the logic into a separate file, and importing it into each rule in the plugin.

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint labels Dec 30, 2017
Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Would you mind rebasing on master and adding this new function to the table of contents added in #9785? Thanks!

@pmcelhaney
Copy link
Contributor Author

@platinumazure Done. Thanks for merging #9785!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants