Closed shelby3 closed 7 years ago
Could you provide some sample code that JSHint is failing on?
Totally valid. Running KIDE 10.2.1.
const koa = require('koa')
const fs = require('fs-extra')
const app = new koa()
app.use(async function(ctx) {
let to = './'
let from = './there/'
let someVar = await fs.copy(to, from)
ctx.body = JSON.stringify(someVar)
})
Komodo barks with the following:
Basically, it sees the async as being a var and not a keyword...and then sees the word "function" and flips its shit, thinking there's supposed to be a comma there, etc. etc.
This is all related to nodejs 7.something (I can't recall at the moment) adding async/await support natively.
Please reopen.
Reproduced. Thanks for the repro code @damianb.
Looks mostly like it's JSHint's fault by the way, after doing a bit of reading; they've been caught unprepared for the merge and general availability of async/await.
Related: https://github.com/jshint/jshint/issues/2601 https://github.com/jshint/jshint/issues/2604 https://github.com/jshint/jshint/pull/2077
jshint has been problematic for us for a variety of reasons, we may have to revisit our JS linting in the not so distant future.
The JSHint included does not support async/await. This feature is incredibly important for modern asynchronous programming.
Please try to invest some resources to fix this.