question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different parsers for different folders in my project

See original GitHub issue

Taking 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:closed
  • Created 8 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Apr 2, 2015

If your rules are specified in a top-level config, then you can just specify the parser difference in .eslintrc in your tests directory and the rules will cascade. See: http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy

0reactions
ORESoftwarecommented, May 19, 2015

👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to parse multiple folders with multiple files in them?
As a workaround, if the folders are in the same subfolder, resp. have the same naming structure, you could just make a table...
Read more >
How to parse whole project but build only subfolder that have ...
It is part of a huge project, each subproject in a folder. I want to build only my project and its dependencies. I...
Read more >
Configuring Project Structure | PyCharm Documentation
Within a content root, PyCharm can distinguish between the folders that contain source code, and the ones to be ignored while searching, parsing,...
Read more >
Creating Parsers - Tree-sitter
You can install the CLI in a few different ways: ... create a package.json file that describes your project, and allows your parser...
Read more >
Document Parser
Relying purely on manual parsing slows the problem startup phase as you are mired in extracting source information. Accessible from the project explorer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found