Closed
Description
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:
- A backend repository using NestJS with a single
tsconfig.json
. - 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
- Clone the repository:
git clone https://github.com/La-Fabryck/caddie-frontend-preact.git
- Switch to the branch:
git switch bug/eslint-import-resolver-typescript
- Follow the
README.md
to install the project (up to step 4). - Run the lint command:
This will show
docker compose run --rm frontend npm run lint-fix
import-x/no-unresolved
errors. - Install version 3.7.0:
docker compose run --rm frontend npm install eslint-import-resolver-typescript@3.7.0
- Run the lint command again:
No errors should appear.
docker compose run --rm frontend npm run lint-fix
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
Labels
No labels