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

ESnext set to true, still warning when use Spread operator #2060

Closed
mattma opened this issue Dec 30, 2014 · 6 comments
Closed

ESnext set to true, still warning when use Spread operator #2060

mattma opened this issue Dec 30, 2014 · 6 comments
Labels

Comments

@mattma
Copy link

mattma commented Dec 30, 2014

If you head to jshint.com, simply empty the field, paste the code snippet below

/*jshint esnext: true */
this.getProperties(...['username', 'email', 'password', 'firstName']);

Then, you should see the warning below

One warning
Expected an identifier and instead saw '['.

I read the issue list and think it has been fixed in the current version. If it is not, how could I turn off this warning by applied /*jshint ***** */.

@rwaldron
Copy link
Member

I read the issue list and think it has been fixed in the current version.

I can still reproduce this error.

rwaldron added a commit to rwaldron/jshint that referenced this issue Dec 30, 2014
rwaldron added a commit to rwaldron/jshint that referenced this issue Dec 30, 2014
@mattma
Copy link
Author

mattma commented Dec 30, 2014

@rwaldron Thank you for verifying the issue. At the same time, if I use spread operator in my ES6 module, how could I add a jshint rule to suppress the warning?

@rwaldron
Copy link
Member

/*jshint ignore:start*/
fn(...[1, 2, 3])
/*jshint ignore:end*/

Is the best I can do until release

@mattma
Copy link
Author

mattma commented Dec 31, 2014

No wonder that I could not find any useful fixes on the internet and stackoverflow. Well, i will stick with the ES5 syntax until it is being fixed in the next release of jshint. Thanks.

@caitp
Copy link
Member

caitp commented Dec 31, 2014

It will be patched soon

@mattma
Copy link
Author

mattma commented Dec 31, 2014

Great!. Thanks.

rwaldron added a commit that referenced this issue Jan 3, 2015
…n call args.

Fixes gh-2060

Squashed commit of the following:

commit cb9d868bc084bc1c4a25b105ce13e044f1cdec39
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Wed Dec 31 11:06:30 2014 -0500

    String condition, Additional tests

commit 6c1bb47ac9539b521083409079e8a0dbbf10944d
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:20:56 2014 -0500

    Removes unnecessary conditions

commit c02239ebcb7f9986a725c5d375fa448fd1ec3824
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:19:00 2014 -0500

    Cleanup "spread & rest operator support" tests

commit 80728050087907e21739325273915df0ab26b14e
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 17:37:00 2014 -0500

    Allow array literal form to follow spread operator in function call args. Fixes gh-2060
rwaldron added a commit to rwaldron/jshint that referenced this issue Jan 4, 2015
…n call args.

Fixes jshintgh-2060

Squashed commit of the following:

commit cb9d868bc084bc1c4a25b105ce13e044f1cdec39
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Wed Dec 31 11:06:30 2014 -0500

    String condition, Additional tests

commit 6c1bb47ac9539b521083409079e8a0dbbf10944d
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:20:56 2014 -0500

    Removes unnecessary conditions

commit c02239ebcb7f9986a725c5d375fa448fd1ec3824
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:19:00 2014 -0500

    Cleanup "spread & rest operator support" tests

commit 80728050087907e21739325273915df0ab26b14e
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 17:37:00 2014 -0500

    Allow array literal form to follow spread operator in function call args. Fixes jshintgh-2060
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Feb 23, 2015
…or in function call args.

Fixes jshintgh-2060

Squashed commit of the following:

commit cb9d868bc084bc1c4a25b105ce13e044f1cdec39
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Wed Dec 31 11:06:30 2014 -0500

    String condition, Additional tests

commit 6c1bb47ac9539b521083409079e8a0dbbf10944d
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:20:56 2014 -0500

    Removes unnecessary conditions

commit c02239ebcb7f9986a725c5d375fa448fd1ec3824
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 18:19:00 2014 -0500

    Cleanup "spread & rest operator support" tests

commit 80728050087907e21739325273915df0ab26b14e
Author: Rick Waldron <waldron.rick@gmail.com>
Date:   Tue Dec 30 17:37:00 2014 -0500

    Allow array literal form to follow spread operator in function call args. Fixes jshintgh-2060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants