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

operator-assignment fix is breaking the code #8293

Closed
nemoxps opened this issue Mar 20, 2017 · 1 comment · Fixed by singapore/lint-condo#244 or renovatebot/renovate#147 · May be fixed by iamhunter/teammates#4
Closed

operator-assignment fix is breaking the code #8293

nemoxps opened this issue Mar 20, 2017 · 1 comment · Fixed by singapore/lint-condo#244 or renovatebot/renovate#147 · May be fixed by iamhunter/teammates#4
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@nemoxps
Copy link

nemoxps commented Mar 20, 2017

Tell us about your environment

  • ESLint Version: v3.18.0
  • Node Version: v7.7.2
  • npm Version: v4.1.2

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

module.exports = {
    root: true,
    parserOptions: {
        ecmaVersion: 8,
    },
    rules: {
        'operator-assignment': [2, 'always'],
    },
};

What did you do? Please include the actual source code causing the issue.

test.js

tmp = tmp + (2 * options.x[y]);

$ eslint test.js --fix

What did you expect to happen?
I expected the fix function to fix the code.

What actually happened? Please include the actual, raw output from ESLint.
Instead, it broke the code.

$ eslint test.js --fix > output.txt

c:\nodejs\test\test.js
  1:25  error  Parsing error: Unexpected token ;

 1 problem (1 error, 0 warnings)

test.js

tmp += (2 * options.x[y];

It seems, that the rule doesn't handle braces properly.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Mar 20, 2017
@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Mar 20, 2017
@not-an-aardvark
Copy link
Member

Thanks for the bug report. I was able to reproduce this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
3 participants