-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docs: Add missing meta.docs.suggestion
property in some examples
#14298
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I don’t think these changes make sense given how this field is being used currently (which is to say, not in a way that it matters for plugin rules). I’d rather we come up with a coherent story for whether or not this field should be included and why before outing examples throughout our docs. |
We're already mentioning this field in the document: https://eslint.org/docs/developer-guide/working-with-rules#rule-basics
|
Hmm, I thought this property was already part of the public API as @mdjermanovic mentioned, so I was just updating the examples to consistently use it, i.e. no change in status quo. As I mentioned in #14292, there seems to be some confusion / lack of consistency around this property, so maybe we should consider reevaluating it in a separate discussion. |
I know we have this property documented, however, as already pointed out, we are actually not enforcing its usage for rules with suggestions. I think adding examples of something that isn’t properly implemented will only serve to confuse people more than they status quo. I’d rather not call attention to something that doesn’t work as described and would prefer we just delete its mention from the documentation until we decide if we want to introduce a formal meta.suggestions property that is enforced. |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[X] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Updated some documentation examples and test cases to include the
meta.docs.suggestion
property when providing suggestions. Previously, usage of this property was inconsistent which could be confusing to developers hoping to correctly implement their own suggestions.These changes were extracted from #14292.