Skip to content

Bug: @typescript-eslint/parser - missing types  #7279

@ivodolenc

Description

@ivodolenc

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 have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Relevant Package

parser

Playground Link

Repro Code

-

ESLint Config

-

tsconfig

-

Expected Result

No errors.

Actual Result

Cannot find module '@typescript-eslint/parser' or its corresponding type declarations.

Additional Info

Hi, I believe you need to specify types in package.json because when using the parser in .ts files it reports missing type declarations.

Simple fix (I tested this manually and it works as expected):

@typescript-eslint/parser: package.json

{
+ "types": "./dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    },
    "./package.json": "./package.json"
  }
}

Versions

"@typescript-eslint/parser": "^6.1.0"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfix: user errorissue was fixed by correcting the configuration / correcting the codepackage: parserIssues related to @typescript-eslint/parserworking as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions