import-js / import-js/eslint-plugin-import

Missing typescript setting in `flatConfigs.typescript`

Open
#3,170 10 comments 2 reactions 0 assignees View on GitHub
docs typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

With the recent official support of ESLint TypeScript config ([ref](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files)), when trying to setup the [example config in the README file](https://github.com/import-js/eslint-plugin-import?tab=readme-ov-file#config---flat-with-config-in-typescript-eslint), I get the following issue:

`Unable to resolve path to module 'typescript-eslint'.eslint[import/no-unresolved](https://github.com/import-js/eslint-plugin-import/blob/v2.31.0/docs/rules/no-unresolved.md)`

I managed to fix this by adding this extra setting:

```js
settings: {
'import/resolver': {
typescript: true,
},
},
```

When I look at what settings `flatConfigs.typescript` has, it only has the following settings:

```js
'import/resolver': {
node: {
extensions: allExtensions,
},
},
```

I presume we should add `typescript: true` in `flatConfigs.typescript` or otherwise maybe mentionning this somewhere in the doc? The only way I was able to fix this was because I had this in a previous config.

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the implementation of flatConfigs.typescript and the README's flat TypeScript configuration example. Check whether the configuration includes the TypeScript resolver setting, then validate the example with an ESLint TypeScript configuration; done means the example resolves typescript without requiring an additional setting or the documentation explains the required setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.