eslint-import-resolver-alias
eslint-import-resolver-alias copied to clipboard
Seems broken be working with [email protected]
eslint-import-resolver-alias works fine with eslint-plugin-import 2.18.2
, after update to the latest 2.20.1
, all of the aliases won't find anymore.
The eslintrc is - https://github.com/Tencent/Hippy/blob/master/.eslintrc.js#L82
Hippy on chore/update-dependencies [$!] via ⬢ v12.16.1 took 2s
➜ npm ls eslint-plugin-import eslint-import-resolver-alias
hippy@ /Users/xqkuang/Projects/github/Hippy
├── [email protected]
└── [email protected]
Hippy on chore/update-dependencies [$!] via ⬢ v12.16.1 took 2s
➜ npm run lint
> hippy@ lint /Users/xqkuang/Projects/github/Hippy
> eslint "packages/**/*.@(js|ts|tsx)" "examples/hippy-react-demo/**/*.@(js|jsx)"
/Users/xqkuang/Projects/github/Hippy/packages/hippy-vue/src/elements/index.js
1:1 error 'shared' should be listed in the project's dependencies. Run 'npm i -S shared' to add it import/no-extraneous-dependencies
/Users/xqkuang/Projects/github/Hippy/packages/hippy-vue/src/renderer/native/event/emitter.js
5:1 error 'shared' should be listed in the project's dependencies. Run 'npm i -S shared' to add it import/no-extraneous-dependencies
/Users/xqkuang/Projects/github/Hippy/packages/hippy-vue/src/runtime/index.js
5:1 error 'core' should be listed in the project's dependencies. Run 'npm i -S core' to add it import/no-extraneous-dependencies
6:1 error 'core' should be listed in the project's dependencies. Run 'npm i -S core' to add it import/no-extraneous-dependencies
7:1 error 'shared' should be listed in the project's dependencies. Run 'npm i -S shared' to add it import/no-extraneous-dependencies
8:1 error 'core' should be listed in the project's dependencies. Run 'npm i -S core' to add it import/no-extraneous-dependencies
9:1 error 'web' should be listed in the project's dependencies. Run 'npm i -S web' to add it import/no-extraneous-dependencies
10:1 error 'core' should be listed in the project's dependencies. Run 'npm i -S core' to add it import/no-extraneous-dependencies
16:1 error 'shared' should be listed in the project's dependencies. Run 'npm i -S shared' to add it import/no-extraneous-dependencies
....
Yes, as the code has 3 years not updated, I have to downgrade eslint-plugin-import to 2.18.2, it works again. If you really need this plugin, the only way to make it work is to downgrade.
Yes, as the code has 3 years not updated, I have to downgrade eslint-plugin-import to 2.18.2, it works again. If you really need this plugin, the only way to make it work is to downgrade.
No, it's not a good way. As eslint-config-airbnb must rely on the newest version of eslint-plugin-import, I have to switch back to ^2.22.1 and totally disble the 2 rules for alias checking. FYI.
PS. I guess this package is not maintained anymore, we have to abandon it.
As a tip to @fengerzh and anyone who's blocked by this - I switched to eslint-import-resolver-custom-alias, which works fine at least for my needs
Yes! Everyone who come to this page, you can replace your plugin to eslint-import-resolver-custom-alias. Thanks, @noppa !
As a tip to @fengerzh and anyone who's blocked by this - I switched to eslint-import-resolver-custom-alias, which works fine at least for my needs
Thanks. you guys saved my day!