-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
💡 Add eslint-import-resolver-<resolver-name>
support
#806
Comments
There is some support and coverage for this in the ESLint plugin:
Can you please show a complete reproduction of (relevant) config? |
Same problem here, it worked before with a Can be reproduced with the following
// eslint.config.js
import importPlugin from 'eslint-plugin-import';
import js from '@eslint/js';
import tseslint from "typescript-eslint";
export default [
js.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
{
files: ['**/*.{ts,tsx}'],
settings: {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
/* [...] */
},
},
];
With the corresponding // .eslintrc
{
"parser": "@typescript-eslint/parser",
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": true,
"node": true,
},
},
"plugins": [
"import",
"@typescript-eslint",
],
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
],
} |
same here: ("knip": "5.34.0")
|
Thanks for using Knip everyone, but please create an actual issue reproduction. Or rather, open a pull request. It was my assumption that |
This is a different issue, because only |
There is a actual reproduction in my comment just above. |
Please see https://knip.dev/guides/issue-reproduction |
My comment contains all of the exact commands and files needed to reproduce the issue from scratch. What more do you need? Sure, I can run the commands again and put it on GitHub, here you go: https://github.com/guillaumebrunerie/knip-import-resolver-test
|
Not trying to be pedantic or annoying, but please understand this isn't the first issue reported and it's super helpful in understanding and getting to the root of the issue. Trust me, I did my part by developing and maintaining this tool. |
Also, this isn't about what I need. |
I was trying to be helpful by providing a reproduction starting from |
I've extended the ESLint plugin for
It's a basis for further development, feel free to let me know what else should be included as well. Might open a little can of worms here, as the plugin now actually loads the
|
Thanks! I can confirm that this solved the issue. |
Thanks for confirming!
Shouldn't be an issue actually, just realized ESLint itself also uses jiti for loading this file. |
Works fine here too, thanks! |
Update: there's an issue with loading |
Suggest an idea for this project
While onboarding Knip on one of the business repositories, I noticed that while the Knip ESLint plugin has broad support for automatically picking up dependencies that ESLint uses (especially with the new flat config), it still does not recognize import resolvers.
Is that something you considered adding support for?
Current day, I have to add
eslint-import-resolver-webpack
toignoreDependencies
manually.The text was updated successfully, but these errors were encountered: