It would be nice to have this feature incorporated:
Thanks for the reminder! We would accept a patch for this.
(Before implementing new language features, we require them to have reached "Stage 2" of TC-39's standardization process. Because "optional chaining" has reached "Stage 4", it qualifies for implementation in JSHint. Here's a blog post explaining the policy: A Formal Commitment to New Language Features)
Both optional chaining and Nullish coalescing operators gives the same error message in VSC:
"Expected an identifier and instead saw '?'. (E030)jshint(E030)"
Very annoying… Is there a temporary fix?
Thanks
You can use the ignore:start
/ignore:end
or ignore:line
directives to cause JSHint to pass over any syntax it doesn't recognize.
Is there an update on this?
Is this issue being worked on?
Looks like there is a fix in the works for this. For anyone interested, here is the pull request so you can watch it: https://github.com/jshint/jshint/pull/3486.
JSHint version 2.13.0, released today, introduces support for optional chaining. Be sure to update your configuration to opt in to the new language feature via esversion: 11
or later.
Most helpful comment
Is there an update on this?