Eslint-plugin-import: Why isn't "eslint-import-resolver-node" listed in `eslint-module-utils`'s peerDependencies?

Created on 11 May 2017  路  11Comments  路  Source: benmosher/eslint-plugin-import

This plugin does not work with pnpm because it relies on NPM3's flat node_modules structure. Please see: https://github.com/pnpm/pnpm/issues/739, where there is a reproducible repo.

accepted bug help wanted resolvenode

Most helpful comment

Any progress on this?

All 11 comments

First off, if something works with npm but not an npm clone, then the npm clone is broken.

It's listed as a dependency (https://github.com/benmosher/eslint-plugin-import/blob/master/package.json#L83), and this project works in npm 2 (which doesn't flatten like npm 3+ does), so I'm not sure why that would be an issue.

After rereading the linked issue, https://github.com/pnpm/pnpm/issues/739#issuecomment-300612332 is about eslint-module-utils, not eslint-plugin-import - so you're asking about https://github.com/benmosher/eslint-plugin-import/blob/master/utils/package.json - which yes, should probably specify everything it requires as a dep or a peer+dev dep.

see: https://github.com/pnpm/pnpm/issues/739#issuecomment-301077475

@ljharb: after reading the linked comment, I'm curious what ideas you have to resolve this. I wouldn't be against just spec'ing npm install eslint-plugin-import eslint-import-resolver-node in the README if you think that wouldn't be too much drag on the user install experience.

I like that it works out of the box for most people, thus the current setup.

So what's the verdict on this? :)

From https://github.com/pnpm/pnpm/issues/739#issuecomment-301084388 via https://github.com/benmosher/eslint-plugin-import/issues/828#issuecomment-301099241:

eslint-plugin-import should pass its __dirname to eslint-module-utils, and it should resolve from that dir. The resolve-from package might help.

PRs are welcome.

An update on this problem. I did a pull request to resolve to add a preserveSymlinks option to it. Could this package use resolve with preserveSymlinks: false instead of the custom utils/resolve module?

Since I maintain both resolve and collaborate on eslint-plugin-import, I'm naturally in favor of that.

@ljharb Sounds great!

Any progress on this?

This seems to have been fixed by #1591.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xiaodi0003 picture xiaodi0003  路  3Comments

daltonamitchell picture daltonamitchell  路  3Comments

pahan35 picture pahan35  路  3Comments

benmosher picture benmosher  路  3Comments

yutin1987 picture yutin1987  路  3Comments