Skip to content

[eslint config] Eslint fails if tsconfig extends multiple files #244

Open
sgrigorev opened this issue Aug 9, 2023 · 0 comments
Open

[eslint config] Eslint fails if tsconfig extends multiple files #244

sgrigorev opened this issue Aug 9, 2023 · 0 comments

Comments

@sgrigorev
Copy link

sgrigorev commented Aug 9, 2023

Typescript v5 introduced the feature that allows to extend from multiple tsconfig files, e.g

{
  "extends": ["@tinkoff/typescript-config/tsconfig.base", "@tsconfig/node16/tsconfig.json"],
  "compilerOptions": {}
  ...
}

If a project uses such tsconfig.json, the eslint fails with error

Oops! Something went wrong! :(

ESLint: 8.45.0

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
Occurred while linting "..."
Rule: "import/no-cycle"
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:162:11)
    at Object.join (node:path:1172:7)
   ...

There is an issue in eslint-plugin-import import-js/eslint-plugin-import#2751

I see 2 possible solutions:

  1. Since the author is not interested in solving the problem, we can migrate to eslint-plugin-i, which is actually fork of eslint-plugin-import with some improvements.
  2. Override the tsconfig-paths in package.json
  "overrides":{
    "tsconfig-paths": "^4.0.0"
  },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant