Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

import-x/no-unresolved errors after updating eslint-import-resolver-typescript from 3.7.0 to 3.8.3 #364

Copy link
Copy link
Closed
@befabry

Description

@befabry
Issue body actions

Hi,

As suggested in this comment, I'm opening a ticket to report an issue I encountered after updating eslint-import-resolver-typescript from version 3.7.0 to 3.8.3.

Context

I have two repositories:

  1. A backend repository using NestJS with a single tsconfig.json.
  2. A frontend repository using Vite & Preact with multiple tsconfig files (tsconfig.json, tsconfig.app.json, tsconfig.node.json).

The backend repository works fine, but the frontend repository started showing import-x/no-unresolved errors after the update.

Configuration

Backend ESLint Configuration:

settings: {
  'import/resolver-next': [
    createTypeScriptImportResolver({
      alwaysTryTypes: true,
      project: '<root>/tsconfig.json',
      extensions: ['.js', '.ts'],
    }),
  ],
},

Frontend ESLint Configuration:

settings: {
  'import/resolver-next': [
    createTypeScriptImportResolver({
      alwaysTryTypes: true,
      project: ['<root>/tsconfig.json', '<root>/tsconfig.app.json', '<root>/tsconfig.node.json'],
      extensions: ['.js', '.jsx', '.ts', '.tsx'],
    }),
  ],
},

Issue

After updating from version 3.7.0 to 3.8.2 (and later to 3.8.3), my IDE stopped resolving aliased paths in the frontend repository. The import-x/no-unresolved errors started appearing.

Steps to Reproduce

  1. Clone the repository:
    git clone https://github.com/La-Fabryck/caddie-frontend-preact.git
  2. Switch to the branch:
    git switch bug/eslint-import-resolver-typescript
  3. Follow the README.md to install the project (up to step 4).
  4. Run the lint command:
    docker compose run --rm frontend npm run lint-fix
    This will show import-x/no-unresolved errors.
  5. Install version 3.7.0:
    docker compose run --rm frontend npm install eslint-import-resolver-typescript@3.7.0
  6. Run the lint command again:
    docker compose run --rm frontend npm run lint-fix
    No errors should appear.

Expected Behavior

The import-x/no-unresolved errors should not appear after updating to version 3.8.3, just as they don't appear in version 3.7.0.

Additional Information

  • The issue seems to be related to the multiple tsconfig files in the frontend repository.
  • The backend repository, which has a single tsconfig.json, does not exhibit this issue.

Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.