springernature / eslint-config-springernature

ESLint shareable config used at Springer Nature
MIT License
3 stars 0 forks source link

hikes ecmaVersion for node #19

Closed jpw closed 6 years ago

jpw commented 6 years ago

specifies ecmaVersion: 8 for node, as the linter complained for using async 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 :)

alexkilgour commented 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)

jpw commented 6 years ago
  1. i did the change locally after installing all the linting packages and it seems to work :)
  2. good q, I just tried this and it didn't moan about the promise
var p = new Promise(resolve => resolve(5));
p.then(val => console.log(val)); // 5
jpw commented 6 years ago

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 :)