Skip to content

Bug: Types used in JSDoc blocks of @eslint/js are missing #18100

@colireg

Description

@colireg

Environment

Node version: v21.2.0
npm version: v10.2.3
Local ESLint version: v8.56.0 (Currently used)
Global ESLint version: Not found
Operating System: NixOS 23.11 (Tapir)

What parser are you using?

Default (Espree)

What did you do?

Configuration

packages.json:

{
  "main": "index.js",
  "type": "module",
  "scripts": {
    "lint": "npx eslint && npx tsc -p jsconfig.json"
  },
  "devDependencies": {
    "@eslint/js": "^8.56.0",
    "eslint": "^8.56.0",
    "typescript": "^5.3.3"
  }
}

index.js:

import "@eslint/js";

jsconfig.json:

{
  "compilerOptions": {
    "checkJs": true
  },
  "exclude": ["node_modules"]
}

Running npx tsc -p jsconfig.json complains about missing types used by @eslint/js

What did you expect to happen?

No missing type errors caused by @eslint/js

What actually happened?

❯ npx tsc -p jsconfig.json
node_modules/@eslint/js/src/configs/eslint-recommended.js:11:19 - error TS2307: Cannot find module '../lib/shared/types' or its corresponding type declarations.

11 /** @type {import("../lib/shared/types").ConfigData} */
                     ~~~~~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/@eslint/js/src/configs/eslint-recommended.js:11

Link to Minimal Reproducible Example

https://stackblitz.com/edit/eslintjs-bug

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyrepro:yesIssues with a reproducible example

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions