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

@sharmilajesupaul sharmilajesupaul 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;

…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
Copy link
Collaborator

ljharb commented Jul 11, 2018

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

@sharmilajesupaul
Copy link
Contributor Author

@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 Compare July 17, 2018 21:19
@sharmilajesupaul
Copy link
Contributor Author

@ljharb updated the guide: https://github.com/airbnb/javascript/pull/1864/files?short_path=04c6e90#diff-04c6e90faac2675aa89e2176d2eec7d8

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Compare August 13, 2018 18:21
@sharmilajesupaul
Copy link
Contributor Author

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

@ljharb
Copy link
Collaborator

ljharb 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 Compare August 9, 2019 23:44
Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=it+is+time

@ljharb ljharb merged commit f6acb78 into master Aug 9, 2019
@ljharb ljharb deleted the shar--simplify-no-mixed-operators branch August 10, 2019 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants