Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Jest's modulePaths option #38

Closed
AndrewFinlay opened this issue Mar 29, 2018 · 4 comments
Closed

Support Jest's modulePaths option #38

AndrewFinlay opened this issue Mar 29, 2018 · 4 comments

Comments

@AndrewFinlay
Copy link

Like Midzelis in #35, I'm having trouble reaching eslint when it's located outside of the current working directory. In my case I have a bunch of projects, one which is a collection of test utils that can be accessed by the other projects during test. This test utils project holds jest-runner-eslint and the eslint module. When run, jest-runner-eslint only looks for eslint in the directory of the application under test, I can't direct it to look in the test utils directory.

From the code it looks like only config.rootDir is checked as a possible modules source, where it probably should support the modulePaths option from the jest config. Then I can set where the module should look for eslint.

@ljharb
Copy link
Collaborator

ljharb commented Mar 29, 2018

This runner should work just like eslint itself does imo - which means that in order for it to work, eslint should be in the PATH.

@rogeliog
Copy link
Member

I agree with @ljharb

@ljharb
Copy link
Collaborator

ljharb commented Mar 29, 2018

Closing, because this is answered.

iow, use PATH="path/to/eslint:$PATH" jest blah if you want to change how eslint is resolved. If this doesn't work, then that's an issue to file :-)

@ljharb ljharb closed this as completed Mar 29, 2018
@AndrewFinlay
Copy link
Author

Unfortunately that doesn't work, getLocalESLint resolves the eslint module using a full path, so require never looks at alternate PATH options or for a globally installed eslint.

To me it looks like #35 is so close to this issue that it may be best to discuss the problem there, either that or file a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants