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

Spread operator should be allowed anywhere in array literals and function calls #89

Closed
BenoitZugmeyer opened this issue Mar 14, 2015 · 3 comments

Comments

@BenoitZugmeyer
Copy link

Those statements should be valid:

var a = [...b, 1];
foo(...a, b, ...c);

Right now, running eslint on code like this gives me error Spread must be the final element of an element list and as it is a syntax error, it does not lint the file.

See MDN

@nzakas
Copy link
Member

nzakas commented Mar 14, 2015

Oops, must be confusing named function argument restrictions with other uses.

@nzakas
Copy link
Member

nzakas commented Mar 14, 2015

Working on this.

@nzakas nzakas closed this as completed in 9d35ee3 Mar 14, 2015
nzakas added a commit that referenced this issue Mar 14, 2015
Allow spread in more places (fixes #89)
@BenoitZugmeyer
Copy link
Author

Awesome, thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants