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: clarify that space-unary-ops doesn't apply when space is required #13767
Docs: clarify that space-unary-ops doesn't apply when space is required #13767
Conversation
Hi @tmdesigned!, thanks for the Pull Request The pull request title isn't properly formatted. We ask that you update the message to match this format, as we use it to generate changelogs and automate releases.
Read more about contributing to ESLint here |
Closed and reopened to fix the CLA check. |
Thanks for the PR!
Completely agree, the correct examples for |
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.
This clarifies a lot, thanks! I just have a note about the added incorrect example.
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!
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.
Thank you!
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 docs for
space-unary-ops
to clarify that thewords
operators are only considered when a space is not required for proper syntax.This was previous confusing, as the "incorrect" examples were ones that had optional spaces (i.e.
delete(foo)
) while the "correct" examples were ones that required spaces anyways (i.e.new Foo
). Therefore, in addition to a note under the rule description, the examples were modified to more closely mirror each other to make the actual rule clearer.Is there anything you'd like reviewers to focus on?