Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

[BUG] Prefer conditional expressions rule breaks code with increment / decrement operators. #441

Closed
PlugFox opened this issue Sep 1, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@PlugFox
Copy link

PlugFox commented Sep 1, 2021

image

Source

if (cond) {
  value += delta;
} else {
  value -= delta;
}

Now rule suggestion

value = cond ? delta : delta;

Need to suggest

cond ? value += 1 : value -= 1;

// or

value  = cond ? value + 1 : value - 1;
@incendial
Copy link
Member

Good catch, thanks for reporting!

@incendial incendial changed the title Change condition imports suggestion [BUG] Prefer conditional expressions rule breaks code with increment / decrement operators. Sep 1, 2021
@incendial incendial added the good first issue Good for newcomers label Sep 4, 2021
@incendial incendial added waiting for release Will be available after new version is released and removed good first issue Good for newcomers labels Nov 24, 2021
@dkrutskikh
Copy link
Member

Available in 4.8.0 release 🚀

@dkrutskikh dkrutskikh removed the waiting for release Will be available after new version is released label Dec 2, 2021
@dkrutskikh dkrutskikh added this to the 4.8.0 milestone Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants