docs(no-mixed-operators): clarify rule behavior for parameter 'groups' #302
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.
Description
This merge request proposes changes to the documentation page https://eslint.style/rules/js/no-mixed-operators
The current explanation of the rule parameter
groups
is ambiguous w.r.t. what is considered to be 'mixed operators': it is easily misconstrued to mean 'operators of different groups are mixed'.This merge request proposes a different wording.
It also contains minor changes intended to increase consistency (formatting of operators, order of groups) and one rendering issue (the first occurence of the ternary operator in the current doc is rendered as a smiley because the colon and paren are not formatted as code)
This change is motivated by my struggle I had recently while adding and configuring the rule for my project. I misunderstood the documentation. So did my colleagues.
Linked Issues
eslint/eslint#18201
Additional context
This proposal modifies the documentation page https://eslint.style/rules/js/no-mixed-operators
The old documentation page of the (now deprecated) eslint rule was identical; I have currently not planned to propagate this update back to the legacy documentation https://eslint.org/docs/latest/rules/no-mixed-operators