Closed
Description
Repro
function f() { }
const o = { ...f };
Expected Result
Error on line 2 - spreading function into object.
Actual Result
No error - and nothing happens (spreading a plain function into object doesn't do anything afaik).
Additional Info
Detecting this is very useful when someone is attempting to spread the result of a function call, but actually accidentally spreads the function itself.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
4.22.0 |
@typescript-eslint/parser |
4.22.0 |
TypeScript |
4.1.5 |
ESLint |
7.24.0 |
node |
15.14.0 |