fix: include meta.docs.url for all rules #60
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This enables and fixes the
eslint-plugin/require-meta-docs-url
rule. The diff is large since most of the rules were converted fromfunction(context)
to{ meta, create }
signatures (it's much more manageable to look at when appending?w=1
to the pull request URL).One way this PR could be improved:
The
require-meta-docs-url
rule is fixable, given the following option:The rule will validate all
meta.docs.url
properties to match the provided pattern, replacing{{name}}
with the filename.The current issue is that the rule filenames are snake-cased (
valid_expect
) and the doc filenames are kebab-cased (valid-expect
), so therequire-meta-docs-url
rule will generate links that 404. Would it be worthwhile to rename the rule and test files to use kebab-casing, or perhaps rename the documentation files to use snake-casing? I don't know what the preferred convention is in this codebase, and I didn't want to introduce a change like that without pointing it out and discussing first.(meta: I wasn't sure if the commit prefix should be chore, refactor, or feat, so please feel free to comment with what I should change it to or change it when squashing - thanks 😄 )