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

🐛 Bug: Flat config causes eslint-plugin-import error message #247

Closed
3 tasks done
KristjanESPERANTO opened this issue Mar 24, 2024 · 3 comments
Closed
3 tasks done
Labels
status: wontfix This will not be worked on

Comments

@KristjanESPERANTO
Copy link
Contributor

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

I'm using the recommended rules of eslint-plugin-import also for checking eslint.config.js. I just added eslint-plugin-package-json according to the README instructions to the config like this:

import eslintPluginImport from "eslint-plugin-import";
import packageJson from "eslint-plugin-package-json/configs/recommended"; // added

I wouldn't expect any complaints from the import plugin when I import eslint-plugin-package-json.

Actual

Now when I run eslint I get the import rule no-unresolved throws that error message:

error    Unable to resolve path to module 'eslint-plugin-package-json/configs/recommended'  import/no-unresolved

eslint-plugin-package-json works nevertheless.

I have no other problems with the import plugin, so I guess there is a problem with the way eslint-plugin-package-json is imported.

Additional Info

No response

@KristjanESPERANTO KristjanESPERANTO added the type: bug Something isn't working :( label Mar 24, 2024
@JoshuaKGoldberg
Copy link
Owner

Hmm, this might be import-js/eslint-plugin-import#2495. Have you tried with eslint-plugin-import-x?

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Mar 24, 2024
@KristjanESPERANTO
Copy link
Contributor Author

I didn't know eslint-plugin-import-x before, but I just tested it. Saddly the same problem appears:

error    Unable to resolve path to module 'eslint-plugin-package-json/configs/recommended'  import-x/no-unresolved

It seems, that the issue is the same in eslint-plugin-import and eslint-plugin-import-x and not in your package. So we can close this issue?

I'll deactivate the rule for now.

@JoshuaKGoldberg
Copy link
Owner

Yeah agreed. It's unfortunate but given that the path resolution does work at runtime, I'm not inclined to do a deep dive into other plugins' issues.

Thanks for filing though! If someone else sees this then, hey, maybe they'll have info to support or dispute this conclusion. 😄

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
@JoshuaKGoldberg JoshuaKGoldberg added status: wontfix This will not be worked on and removed type: bug Something isn't working :( status: waiting for author Needs an action taken by the original poster labels Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants