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

[major][guide][eslint config] Simplifies `no-mixed-operators` #1864

Merged
merged 1 commit into from Aug 9, 2019

Conversation

@sharmilajesupaul
Copy link
Contributor

commented Jul 11, 2018

  • removes warning on mixing ** and arithmetic operators
  • removes warning on mixing in and instanceof
  • removes warning on mixing ~ with other bitwise operators
  • removes mixing of assignment operators with comparison operators
  • warn on mixing * and /

⚠️ working on guide update

fixed warnings:

// before 
const bar = a + b / c * d;

const bar1 = a * b / c * d;

const bar2 = a === b >> c !== d;

const bar3 = foo | c << d;

const bar4 = "foo" in b instanceof c;

// after 
const bar = a + (b / c) * d;

const bar1 = ((a * b) / c) * d;

const bar2 = (a === b >> c) !== d;

const bar3 = foo | (c << d);

const bar4 = 'foo' in b instanceof c;
[guide] [eslint config] [base] [breaking] Simplifies `no-mixed-operat…
…ors`

- adds warning on mixing `/` and `*` arithmetic operators
- removes warnings on mixing `**` and arithmetic operators
- removes warning on mixing `in` and `instanceof`
- removes warning on mixing `~` with other bitwise operators
- removes mixing of assignment operators with comparison operators
@ljharb

This comment has been minimized.

Copy link
Collaborator

commented Jul 11, 2018

The description suggests that it only removes warnings; that suggests this is a patch. Confirm?

@sharmilajesupaul

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2018

@ljharb there's actually one addition, to warn on mixing * and /, I updated the PR description and I'll update my commit to reflect that.

@sharmilajesupaul sharmilajesupaul force-pushed the shar--simplify-no-mixed-operators branch 2 times, most recently from 18dc21c to bcd874c Jul 17, 2018

@sharmilajesupaul

This comment has been minimized.

@ljharb
Copy link
Collaborator

left a comment

LGTM! Holding off on merging this until #1834 is out.

@ljharb ljharb force-pushed the shar--simplify-no-mixed-operators branch from bcd874c to c85639f Aug 13, 2018

@sharmilajesupaul

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

@ljharb can we get this into the next breaking release?

@ljharb

This comment has been minimized.

Copy link
Collaborator

commented Jun 18, 2019

yep, i'm going to make a sweep before the next release and bring in all semver-majors.

@ljharb ljharb force-pushed the shar--simplify-no-mixed-operators branch from c85639f to f6acb78 Aug 9, 2019

@ljharb

ljharb approved these changes Aug 9, 2019

Copy link
Collaborator

left a comment

=it+is+time

@ljharb ljharb merged commit f6acb78 into master Aug 9, 2019

1 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ljharb ljharb deleted the shar--simplify-no-mixed-operators branch Aug 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.