Skip to content

Seems broken be working with eslint-plugin-import@2.20.1 #16

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

Open
xuqingkuang opened this issue Mar 23, 2020 · 5 comments
Open

Seems broken be working with eslint-plugin-import@2.20.1 #16

xuqingkuang opened this issue Mar 23, 2020 · 5 comments

Comments

@xuqingkuang
Copy link

xuqingkuang commented Mar 23, 2020

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
├── eslint-import-resolver-alias@1.1.2 
└── eslint-plugin-import@2.20.1 


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
....
@fengerzh
Copy link

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.

@fengerzh
Copy link

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.

@noppa
Copy link

noppa commented Aug 18, 2021

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

@fengerzh
Copy link

Yes! Everyone who come to this page, you can replace your plugin to eslint-import-resolver-custom-alias. Thanks, @noppa !

@sgwanlee
Copy link

sgwanlee commented Feb 6, 2022

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!

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

4 participants