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.
Relevant Package
scope-manager
Playground Link
No response
Repro Code
// Code example adapted from typescript-eslint.io/packages/scope-managerimport{analyze}from'@typescript-eslint/scope-manager';import{parse}from'@typescript-eslint/typescript-estree';analyze(parse(`const hello: string = 'world';`).body[0]);
ESLint Config
NoESLintconfig.
tsconfig
{"compilerOptions": {"module":"nodenext","noEmit":true,"strict":true } }Expected Result
It should either:
- work at runtime, or
- fail at compile time with a TS error, AND fail at runtime with ahelpful error message.
Actual Result
- At compile time,
tscreports no errors, indicating that this is a valid usage. - At runtime,
@typescript-eslint/scope-managerthrowsaaa:
node_modules/@typescript-eslint/scope-manager/dist/assert.js:7 throw new Error(message); ^Error: aaa at assert (node_modules/@typescript-eslint/scope-manager/dist/assert.js:7:15) at Referencer.currentScope (node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js:65:33) at Referencer.VariableDeclaration (node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js:516:20) at Referencer.visit (node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js:59:21) at analyze (node_modules/@typescript-eslint/scope-manager/dist/analyze.js:39:16) at index.ts:4:1Additional Info
Looks like this error message has been present in the source code since the introduction of@typescript-eslint/scope-manager by@bradzacher in#1939.
Versions
| package | version |
|---|---|
@typescript-eslint/scope-manager | 8.46.2 |
@typescript-eslint/typescript-estree | 8.46.2 |
TypeScript | 5.9.3 |
node | 25.0.0 |