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

Object "spread" properties (stage 2 proposal) not supported #2991

Closed
CoericK opened this issue Jul 30, 2016 · 27 comments
Closed

Object "spread" properties (stage 2 proposal) not supported #2991

CoericK opened this issue Jul 30, 2016 · 27 comments

Comments

@CoericK
Copy link

CoericK commented Jul 30, 2016

I got something like this

  args: {
    ...connectionArgs,
  },

And jshint its complaining about
xpected '}' to match '{' from line 167 and instead saw '...'.

What should i add to my .jshintrcfile to allow destructing?

@jugglinmike
Copy link
Member

JSHint does not currently support this proposed language feature. It recently reached "Stage 2" in the standardization process, though, so we are interested in adding support in a future version.

@CoericK
Copy link
Author

CoericK commented Jul 30, 2016

Oh thank you @jugglinmike, any idea about how can i make jshint ignore it at least?

@jugglinmike
Copy link
Member

Sure, you'll want to use the in-line directives jshint ignore:start and jshint ignore:end:

  args: {
+   // jshint ignore:start
    ...connectionArgs,
+   // jshint ignore:end
  },

@jugglinmike jugglinmike changed the title How to allow destructing Object "spread" properties (stage 2 proposal) not supported Aug 3, 2016
@jugglinmike
Copy link
Member

I've updated the issue title to more accurately describe the feature request.

@kevlarr
Copy link

kevlarr commented Dec 23, 2016

Would be great to have JSHint support for this, since it's now Stage 3

carols10cents added a commit to integer32llc/crates.io that referenced this issue Jan 15, 2017
It's now in stage 3 in the standardization process and ember recommends
using it in their documentation.

Needed until jshint/jshint#2991 is fixed.
@derwaldgeist
Copy link

+1 for supporting this. It's already widely used in React/Redux

@saidkholov
Copy link

saidkholov commented Mar 3, 2017

+1. Is anyone working on this?

@israbbani
Copy link

+1 for getting this done. Thanks guys!

@dcantatore
Copy link

+1 would enjoy this very much

@elmargasimov
Copy link

+1

1 similar comment
@leonardolessa
Copy link

+1

@jugglinmike
Copy link
Member

Support for this language feature has been merged to the v2.10.0 feature branch (via gh-3150), so we expect it to be included in the next minor release of JSHint. I'll label this issue as "has PR" to better communicate this status.

@iSkore

This comment has been minimized.

@renphi
Copy link

renphi commented Feb 19, 2018

+1 can't wait for v2.10.0 to be released. Good job! Is there any timeline for v2.10.0?

@jaredatron
Copy link

jaredatron commented Mar 22, 2018

When running jshint@2.9.5

When I have both

{
  "esnext": true,
  "esversion": 6,
}

I get the following error:

Incompatible values for the 'esversion' and 'esnext' linting options. (0% scanned).

@ilyakamens
Copy link

Same here re: Incompatible values for the 'esversion' and 'esnext' linting options. (0% scanned).

What's the timeline for 2.10.0?

@chaddjohnson
Copy link

chaddjohnson commented Jun 12, 2018

I also get Incompatible values for the 'esversion' and 'esnext' linting options even after installing directly from the v2.10.0 branch on GitHub. The error goes away when I omit esversion altogether. Here is a snippet from my .jshintrc, now:

"esnext": true,
"unstable": {
  "objspreadrest": true
},

@caitp
Copy link
Member

caitp commented Jun 12, 2018

The idea of that error is really "don't use both 'esversion' and 'esnext' (or 'es3', or 'es5'), afaiu.

The text could be clearer, but the goal of the error seems to be "emit warnings so that eventually we can remove these options and people just use 'esversion').

@jugglinmike do you think we should just make it a non-fatal error instead, or otherwise allow explicit 'esversion' to override the legacy version options?

@jugglinmike
Copy link
Member

@chaddjohnson That branch is available to promote transparency and to enable collaboration. You are of course welcome to run any code in this project, but please understand that we do not endorse the use of unreleased code because we do not have the bandwidth to support it.

@caitp I'd prefer to disallow ambiguity rather than attempt to interpret it. I'll share more detail in a response to your pull request.

@NatoBoram
Copy link

NatoBoram commented Jun 15, 2018

#2991 (comment)

[jshint] Incompatible values for the 'esversion' and 'esnext' linting options. (0% scanned). (E059)

#2991 (comment)

[jshint] Bad option: 'unstable'. (E001)

@jugglinmike Then do you mean to say that it's impossible right now to use jshint?

@jugglinmike
Copy link
Member

Not at all, @NatoBoram. I'm discouraging the use of unpublished versions of the project.

@rip3rs
Copy link

rip3rs commented Oct 1, 2018

Hmmm as anyone found a solution for the:

Incompatible values for the 'esversion' and 'esnext' linting options. (0% scanned). (E059)

@ainthek
Copy link

ainthek commented Oct 26, 2018

any resolution of this ? when will jshint support LATEST syntaxes ?

@stefanuddenberg
Copy link

Any word on this? I really appreciate this tool, but needing to litter my scripts with "ignore" comments is the worst.

@mleonhard
Copy link

Would someone have time to take a look at this? I'm running 2.9.7 which is the latest version of jshint, inside Atom editor, and my React Native app code is littered with syntax errors about the spread operator in object literals. Setting "esnext":true in .jshintrc doesn't help. The tool refuses to work when both "esnext":true and "esversion":6 are set.

If anyone has a workaround that works right now, would you please post it?

@jugglinmike
Copy link
Member

Support for this feature will be available in JSHint version 2.10.0 which we expect to release early next
week
. I'll mark this issue as "resolved" once that's published.

@jugglinmike
Copy link
Member

We just released support for object rest/spread in JSHint version 2.10.0.

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