Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force to use specific ES version

I have some files that will be handled with Babel and therefore are written in ES6. However, I also have some files that will not go through Babel and there fore should be in ES5 in the same project. Can I configure Eslint so it would throw errors, if I accidentally use some ES6 features (e.g. arrow functions, destructuring) in those files?

I've noticed, that setting "parserOptions": {"ecmaVersion": 5} doesn't provide desirable effect as well as setting "env": {"es6": false}.

like image 292
Roman Bekkiev Avatar asked Oct 29 '22 19:10

Roman Bekkiev


1 Answers

As it finally turned out, the problem was in shareable config that I used (xo). In that config ecmaVersion was set to 6, and ESLint doesn't support override for ecmaVersion

like image 134
Roman Bekkiev Avatar answered Nov 11 '22 02:11

Roman Bekkiev