-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager
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 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
scope-manager
Playground Link
No response
Repro Code
// Code example adapted from typescript-eslint.io/packages/scope-manager
import { analyze } from '@typescript-eslint/scope-manager';
import { parse } from '@typescript-eslint/typescript-estree';
analyze(parse(`const hello: string = 'world';`).body[0]);ESLint Config
No ESLint config.tsconfig
Expected Result
It should either:
- work at runtime, or
- fail at compile time with a TS error, AND fail at runtime with a helpful 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:1
Additional 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 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: scope-managerIssues related to @typescript-eslint/scope-managerIssues related to @typescript-eslint/scope-manager
{ "compilerOptions": { "module": "nodenext", "noEmit": true, "strict": true } }