Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Issue Description
In a project configured with"composite": true
and installed with pnpm, TypeScript flags error TS2742 in this minimaleslint.config.mjs
.
//@ts-checkimporttseslintfrom"typescript-eslint";exportdefaulttseslint.config(tseslint.configs.recommended);
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.
Fulltsconfig.json
:
{"compilerOptions": {"allowJs":true,"composite":true,"module":"nodenext","noEmit":true,"strict":true }}
The error is not shown without"composite": true
, nor is it shown when using npm instead of pnpm.
Related:
- Docs: add type annotation for
tseslint.config()
usage examples #10508 - fix(typescript-eslint): export types so that declarations can be named for dts files #10513 (merged in v8.18.2)
Reproduction Repository Link
https://gist.github.com/andersk/44d8dd0d3c2508f758bf51e5cbf12c2f
Repro Steps
$git clone https://gist.github.com/andersk/44d8dd0d3c2508f758bf51e5cbf12c2ftest$cdtest$pnpm iPackages: +116++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Progress: resolved 116, reused 116, downloaded 0, added 116, donedependencies:+ eslint 9.21.0+ typescript 5.7.3+ typescript-eslint 8.25.0Done in 1.9s using pnpm v10.5.1$pnpmexec tsceslint.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.3 export default tseslint.config(tseslint.configs.recommended); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Found 1 error in eslint.config.mjs:3
Versions
package | version |
---|---|
@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 |