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

resolvePaths option works differently with import compared to require #56

Closed
jordanbtucker opened this issue Oct 3, 2022 · 1 comment

Comments

@jordanbtucker
Copy link

jordanbtucker commented Oct 3, 2022

When using the resolvePaths setting to set the paths where eslint should look when resolving module specifiers, import statements resolve as expected, but require statements don't.

See my minimal reproducible example.

The way eslint-plugin-n handles import statements is that it pretends that the source module is in each of the directories specified by resolvePaths, however it does not do this for require statements.


Note that the paths property of the options parameter of resolve.sync should work like the paths property of the options parameter of require.resolve, but it doesn't.

@scagood
Copy link

scagood commented Jan 10, 2024

#139 has just been merged which may help with this as both import and require use the same code 😀

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