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(no-mixed-operators): clarify rule behavior for parameter 'groups' #302

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

teetotum
Copy link
Contributor

@teetotum teetotum commented Mar 22, 2024

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

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 change proposes a different wording.
It also contains minor changes intended to increase consistency (formatting of operators, order of groups)
Copy link

netlify bot commented Mar 22, 2024

Deploy Preview for eslint-stylistic ready!

Name Link
🔨 Latest commit 1764173
🔍 Latest deploy log https://app.netlify.com/sites/eslint-stylistic/deploys/65fd977858043f00091dd1e3
😎 Deploy Preview https://deploy-preview-302--eslint-stylistic.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu changed the title Clarify 'no-mixed-operators' rule behavior for parameter 'groups' docs: clarify 'no-mixed-operators' rule behavior for parameter 'groups' Mar 23, 2024
@antfu antfu changed the title docs: clarify 'no-mixed-operators' rule behavior for parameter 'groups' docs(no-mixed-operators): clarify rule behavior for parameter 'groups' Mar 23, 2024
@antfu antfu merged commit cd02cea into eslint-stylistic:main Mar 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants