I am trying to use the ESLint linker with the Jest testing framework.
Jest tests run with some global variables like jest , which I will need to talk about about this; but the directory structure is a daunting task, and Jest tests are embedded in the source code in the __tests__ folders, so the directory structure looks something like this:
src foo foo.js __tests__ fooTest.js bar bar.js __tests__ barTest.js
Typically, I would have all my tests in the same directory, and I could add the .eslintrc file there to add global variables ... but I certainly do not want to add the .eslintrc file to each __test__ .
Currently, I have only added test globals to the global .eslintrc file, but since this means that I can now reference jest in non-testing code, which does not seem to be the βcorrectβ solution,
Is there a way to get eslint to apply rules based on some pattern based on the directory name or something like that?
javascript eslint jestjs
Retsam Jul 25 '15 at 17:47 2015-07-25 17:47
source share