prefer-object-spread
rule should not report Object.assign({}, ...array)
#10344
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
good first issue
Good for people who haven't worked on ESLint before
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
eslint .
What did you expect to happen?
Object.assign()
should not be reported as wrong. There is no way to use object spreads in this example becauseobjects
is an array of objects. It is not possible to use object spreads to concatenate an array of objects (e.g.[{ ... }, { ... }]
) into a single object.The
prefer-object-spread
rule should not report a linting error when one of the arguments toObject.assign()
uses an array spread.This also means the above line with
--fix
would be converted to{ ...objects }
which is incorrect.What actually happened? Please include the actual, raw output from ESLint.
Object.assign()
was reported as wrong.The text was updated successfully, but these errors were encountered: