Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Bug: error TS2742 in eslint.config.mjs with"composite": true and pnpm #10893

Open
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: typescript-eslintIssues related to the typescript-eslint package
@andersk

Description

@andersk

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:

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

packageversion
@typescript-eslint/eslint-plugin8.25.0
@typescript-eslint/parser8.25.0
@typescript-eslint/scope-manager8.25.0
@typescript-eslint/typescript-estree8.25.0
@typescript-eslint/type-utils8.25.0
@typescript-eslint/utils8.25.0
TypeScript5.7.3
ESLint9.21.0
node22.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: typescript-eslintIssues related to the typescript-eslint package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp