Bug: error TS2742 in eslint.config.mjs with "composite": true
and pnpm
#10893
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
good first issue
Good for newcomers
package: typescript-eslint
Issues related to the typescript-eslint package
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
In a project configured with
"composite": true
and installed with pnpm, TypeScript flags error TS2742 in this minimaleslint.config.mjs
.eslint.config.mjs:3:1 - error TS2742: The inferred type of 'default' cannot be named without a reference to '.pnpm/@typescript-eslint+utils@8.25.0_eslint@9.21.0_typescript@5.7.3/node_modules/@typescript-eslint/utils/ts-eslint'. This is likely not portable. A type annotation is necessary.
Full
tsconfig.json
:The error is not shown without
"composite": true
, nor is it shown when using npm instead of pnpm.Related:
tseslint.config()
usage examples #10508Reproduction Repository Link
https://gist.github.com/andersk/44d8dd0d3c2508f758bf51e5cbf12c2f
Repro Steps
Versions
@typescript-eslint/eslint-plugin
8.25.0
@typescript-eslint/parser
8.25.0
@typescript-eslint/scope-manager
8.25.0
@typescript-eslint/typescript-estree
8.25.0
@typescript-eslint/type-utils
8.25.0
@typescript-eslint/utils
8.25.0
TypeScript
5.7.3
ESLint
9.21.0
node
22.14.0
The text was updated successfully, but these errors were encountered: