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

Docs: Add missing meta.docs.suggestion property in some examples #14298

Closed
wants to merge 1 commit into from

Conversation

bmish
Copy link
Sponsor Member

@bmish bmish commented Apr 7, 2021

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.

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Apr 7, 2021
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation and removed triage An ESLint team member will look at this issue soon labels Apr 7, 2021
Copy link
Member

@mdjermanovic mdjermanovic 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!

@nzakas
Copy link
Member

nzakas commented Apr 8, 2021

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.

@mdjermanovic
Copy link
Member

We're already mentioning this field in the document:

https://eslint.org/docs/developer-guide/working-with-rules#rule-basics

suggestion (boolean) specifies whether rules can return suggestions (defaults to false if omitted)

@mdjermanovic mdjermanovic added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed accepted There is consensus among the team that this change meets the criteria for inclusion labels Apr 8, 2021
@bmish
Copy link
Sponsor Member Author

bmish commented Apr 8, 2021

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.

@nzakas
Copy link
Member

nzakas commented Apr 9, 2021

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.

@bmish
Copy link
Sponsor Member Author

bmish commented Apr 9, 2021

@nzakas Sounds good, I opened this issue to discuss: #14312.

@bmish bmish closed this Apr 9, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Oct 7, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants