Skip to content

Bug: Missing src/util import in @typescript-eslint/eslint-plugin@rc-v8 with skipLibCheck: false #9164

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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.

Issue Description

When skipLibCheck isn't enabled, we produce a type error for users because rules.d.ts imports from src/util.

> tsc

node_modules/@typescript-eslint/eslint-plugin/rules.d.ts:40:63 - error TS2307: Cannot find module './src/util' or its corresponding type declarations.

40 import type { ESLintPluginDocs, ESLintPluginRuleModule } from './src/util';
                                                                 ~~~~~~~~~~~~


Found 1 error in node_modules/@typescript-eslint/eslint-plugin/rules.d.ts:40

Note that you need to have the @typescript-eslint/eslint-plugin package imported from (directly or transitively) in your code, so TypeScript knows to type check it. This tripped me up a bit at first. 😄

Reproduction Repository Link

https://github.com/JoshuaKGoldberg/repros/tree/ts-eslint-plugin-src-util-path

Repro Steps

  1. clone the repo
  2. npm i
  3. npm run tsc

Versions

package version
@typescript-eslint/eslint-plugin 8.0.0-alpha.20
TypeScript 5.4.5
node 20.11.0

Originally reported by @voxpelli in Discord (https://discord.com/channels/1026804805894672454/1084238921677946992/1244642021302599691), thanks!

💖

Metadata

Metadata

Labels

accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinglocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions