Skip to content

Unable to resolve path to module 'typescript-eslint'.eslintimport/no-unresolved | Not working with ESLINT 9> FlatConfig and typescript-eslint #3154

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

Closed
gabriel-logan opened this issue Feb 5, 2025 · 5 comments
Labels

Comments

@gabriel-logan
Copy link

Unable to resolve path to module 'typescript-eslint'.eslintimport/no-unresolved

Unsafe argument of type error typed assigned to a parameter of type InfiniteDepthConfigWithExtends.eslint@typescript-eslint/no-unsafe-argument

Unsafe member access .flatConfigs on an error typed value.eslint@typescript-eslint/no-unsafe-member-access

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import importPlugin from "eslint-plugin-import";

export default tseslint.config(
  eslint.configs.recommended,
  importPlugin.flatConfigs.recommended,
  tseslint.configs.strictTypeChecked,
  eslintPluginPrettierRecommended,
  {
    languageOptions: {
      parserOptions: {
        project: "tsconfig.eslint.json",
        tsconfigRootDir: ".",
      },
    },
    ignores: [
      "webpack.config.js",
      "dist/",
      "tests/generateFakeImage.js",
      "types/",
      "internalTests/",
    ],
    rules: {
      "no-else-return": ["error", { allowElseIf: false }],
      "consistent-return": "error",
      "no-console": "warn",
      "@typescript-eslint/typedef": [
        "error",
        {
          variableDeclaration: true,
          memberVariableDeclaration: true,
        },
      ],
      "@typescript-eslint/prefer-readonly": "error",
      "@typescript-eslint/explicit-function-return-type": "error",
      "@typescript-eslint/explicit-member-accessibility": [
        "error",
        {
          accessibility: "explicit",
          overrides: {
            accessors: "explicit",
            constructors: "no-public",
            methods: "explicit",
            properties: "explicit",
            parameterProperties: "explicit",
          },
        },
      ],
      "@typescript-eslint/consistent-type-imports": "error",
      "@typescript-eslint/consistent-type-exports": "error",
    },
  },
);
	"devDependencies": {
		"@eslint/js": "^9.19.0",
		"@types/jest": "^29.5.14",
		"@types/node": "^22.13.1",
		"@typescript-eslint/parser": "^8.23.0",
		"eslint": "^9.19.0",
		"eslint-config-prettier": "^10.0.1",
		"eslint-import-resolver-typescript": "^3.7.0",
		"eslint-plugin-import": "^2.31.0",
		"eslint-plugin-prettier": "^5.2.3",
		"jest": "^29.7.0",
		"prettier": "^3.4.2",
		"ts-jest": "^29.2.5",
		"ts-loader": "^9.5.2",
		"ts-node": "^10.9.2",
		"typescript": "^5.7.3",
		"typescript-eslint": "^8.23.0",
		"webpack": "^5.97.1",
		"webpack-cli": "^6.0.1"
	},

I always used it with ESLINT 8< and it always worked ok, I tested it with eslint 9 now and it's giving these errors, besides not applying the rules.

@soryy708
Copy link
Collaborator

soryy708 commented Feb 6, 2025

I couldn't reproduce the errors listed with the configuration provided.

Can you please create a minimal repository that reproduces the issue?

@gabriel-logan
Copy link
Author

I couldn't reproduce the errors listed with the configuration provided.

Can you please create a minimal repository that reproduces the issue?

It was in this repo: https://github.com/gabriel-logan/typescript.multiform-validator/blob/main/eslint.config.mjs but I removed these codes, I preferred to give up.

@gabriel-logan
Copy link
Author

gabriel-logan commented Feb 6, 2025

I couldn't reproduce the errors listed with the configuration provided.
Can you please create a minimal repository that reproduces the issue?

It was in this repo: https://github.com/gabriel-logan/typescript.multiform-validator/blob/main/eslint.config.mjs but I removed these codes, I preferred to give up.

It could be my vscode, it could be sonarQube, it could be the lib itself, the fact is that these very large updates like eslint 8 to 9 bring more headaches than the benefits they promise.

@soryy708
Copy link
Collaborator

soryy708 commented Feb 7, 2025

Thank you for the link to the repository where you experienced the issues upgrading to ESLint 9.
This is far from a minimal reproduction repository.

If you prefer to give up, before this can be root-caused and remediated (whether it's a bug or just unclear documentation), I understand.

Without further cooperation this isn't actionable by eslint-plugin-import, so I'll close this issue.
If you'll decide to try the ESLint 9 upgrade again and still experience the same problem, LMK and I'll re-open this issue.

@soryy708 soryy708 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2025
@TrevorBurnham
Copy link

I believe this is a duplicate of #3140. Per @michaelfaith's comment there:

The typescript-eslint package doesn't have a main entry and only uses exports conditions for its entry points, which the node resolver doesn't currently support.

The main ticket tracking this issue is #1810 (though discussion there was locked back in November 2023). There are also several other issues tagged with "exports support".

@JounQin JounQin closed this as completed May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants