Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.15k stars 300 forks source link

async/await throwing JSHint errors #1890

Closed shelby3 closed 7 years ago

shelby3 commented 8 years ago

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.

Naatan commented 8 years ago

Could you provide some sample code that JSHint is failing on?

katanacrimson commented 7 years ago

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.

th3coop commented 7 years ago

Reproduced. Thanks for the repro code @damianb.

katanacrimson commented 7 years ago

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

Naatan commented 7 years ago

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.

Naatan commented 7 years ago

Fixed with https://github.com/Komodo/KomodoEdit/commit/acba82380f3b9031ef73339122d308fbb897ec17