Skip to content

docs: Use link to tagged version for rule docs #110

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
Feb 21, 2018

Conversation

sudo-suhas
Copy link
Contributor

What is the purpose of this pull request?

Documentation update

What changes did you make? (Give an overview)

This adds a helper to lib and uses the version present in package.json for generating the URL to tagged version of the rule documentation. I think this is good because the documentation will match the version the user has installed. This way, even if a rule is changed or removed in the future, the user can find the documentation with ease.

Note: The rule eslint-plugin/require-meta-docs-url cannot be used with a function which would return the URL(see not-an-aardvark/eslint-plugin-eslint-plugin#58) so I have disabled it.

@macklinu
Copy link
Contributor

@sudo-suhas thanks for contributing and for the helpful PR description!

As a whole, I like this change. However with <=v3.6.0 of eslint-plugin-promise, there were inconsistencies with rule documentation URLs in the README. Some of the URL headings were just the rule name, whereas other URL headings were Rule: {{ruleName}}.

image

I think a change like this will be useful for v3.7.0 (next version of eslint-plugin-promise) and onward. I'm not really sure how to support older versions of documentation URLs with inconsistencies without adding specific checks to the getDocsUrl() function when the version is <=v3.6.0, or if that would be worth doing/maintaining.

It's something I'd like to think about a little bit more. Please let me know if you have more thoughts around this. Also, thanks for opening and linking to eslint-community/eslint-plugin-eslint-plugin#58 - I had the same question the other week!

@sudo-suhas
Copy link
Contributor Author

Regarding the URL headings of format Rule: {{ruleName}}, I saw this as well. But this is not something we need to worry about because the changes in this PR only affect future versions. The past v3.6.0 version is immutable and won't be affected(the tagged version doesn't have docs URL itself). Even if we were to update the getDocsUrl function, that will never make it through to older versions.

Copy link
Contributor

@macklinu macklinu left a comment

Choose a reason for hiding this comment

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

You make a good point, was definitely overthinking this before. LGTM, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants