Different parsers for different folders in my project
See original GitHub issueTaking this PR https://github.com/balderdashy/enpeem/pull/4 as an example, I am adding Babel to the test-side of the project, so I can write my tests using the latest ES6/7 syntax, but I don’t want this in the app/production code itself because it degrades performance quite a bit.
So for eslint to recognize the ES6/7 syntax properly I am using babel-eslint as a parser, which is great to have, but I would only want that to parse the code in my tests
folder and everything else use the default eslint parser, so it recognizes if I accidently write ES6/7 code in the app itself.
Furthermore I am running eslint via mocha-esling, so may there could be some api to set the parser. So I could have babel-eslint in the .eslintrc
file, it would use that as a default, but using the api I can overwrite the parser when it comes to the test-folders.
Does that make sense? Something worth considering?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
If your rules are specified in a top-level config, then you can just specify the parser difference in
.eslintrc
in yourtests
directory and the rules will cascade. See: http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy👍