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

ESLint crash with prefer-object-spread #10646

Closed
nstepien opened this issue Jul 22, 2018 · 1 comment · Fixed by #10649
Closed

ESLint crash with prefer-object-spread #10646

nstepien opened this issue Jul 22, 2018 · 1 comment · Fixed by #10649
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

@nstepien
Copy link

Tell us about your environment

  • ESLint Version: 5.2.0
  • Node Version: v10.7.0
  • npm Version: 6.1.0

What parser (default, Babel-ESLint, etc.) are you using?
I can reproduce this with the default parser, and with babel-eslint. I haven't tried other alternatives.

Please show your full configuration:

Configuration
{
  "root": true,
  "rules": {
    "prefer-object-spread": 1
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

Object.assign({
});
./node_modules/.bin/eslint src

What did you expect to happen?

.../src/test.js
1:1  warning  Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`  prefer-object-spread

✖ 1 problem (0 errors, 1 warning)
  0 errors and 1 warning potentially fixable with the `--fix` option.

What actually happened? Please include the actual, raw output from ESLint.

Fix objects must not be overlapped in a report.
AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (/mnt/c/test/node_modules/eslint/lib/report-translator.js:150:9)
    at normalizeFixes (/mnt/c/test/node_modules/eslint/lib/report-translator.js:180:16)
    at args (/mnt/c/test/node_modules/eslint/lib/report-translator.js:278:18)
    at Object.report (/mnt/c/test/node_modules/eslint/lib/linter.js:830:41)
    at Program (/mnt/c/test/node_modules/eslint/lib/rules/prefer-object-spread.js:249:33)
    at listeners.(anonymous function).forEach.listener (/mnt/c/test/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/mnt/c/test/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/mnt/c/test/node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (/mnt/c/test/node_modules/eslint/lib/util/node-event-generator.js:280:22)
@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jul 22, 2018
@aladdin-add aladdin-add added bug ESLint is working incorrectly rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jul 22, 2018
@aladdin-add
Copy link
Member

thanks for the report, I can repro it!

@aladdin-add aladdin-add added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 22, 2018
aladdin-add added a commit to aladdin-add/eslint that referenced this issue Jul 22, 2018
platinumazure pushed a commit that referenced this issue Jul 26, 2018
* Fix: ESLint crash with prefer-object-spread (fixes #10646)

* Chore: add tests

* Chore: review suggestions
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jan 23, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 23, 2019
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
Development

Successfully merging a pull request may close this issue.

2 participants