Closed jpw closed 6 years ago
This seems fine. Just a couple of questions
1) Node support is added in addition to core
which already defines ecmaVersion
. I think that if you then set this in the node config it will override the setting in core
. Have you checked?
2) Does setting this to 8 to support async
mean that, for example, a promise based approach will now error, or does it just add support for async
? (will affect versioning)
var p = new Promise(resolve => resolve(5));
p.then(val => console.log(val)); // 5
Hold on a mo, I think I misunderstood. I assumed with the environment setting eslint was doing something more clever than just knowing what globals were available i.e. "knowing" that the code would be executing in a node not browser context, so me "scoping" my change to the node config file would not affect code for the browser. But now I think this is not the case :)
specifies
ecmaVersion: 8
fornode
, as the linter complained for usingasync
functions, which are an ES2017/ES8 feature IIRC.I am not expert on these eslint configs so hopefully someone who is can have a look :)