Closed
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.
Playground Link
Repro Code
export type Value =
| undefined
| boolean
| number
| string
| Date
| Uint8Array
| Value[]
| Struct;
export type Struct = { [key: string]: Value };
function foo(v: Value) {
console.log(`Hi ${v}`); // causes rule to crash
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-base-to-string": "error"
},
};
tsconfig
Expected Result
No crash
Actual Result
Rule crashes with stack trace like this:
RangeError: Maximum call stack size exceeded
Occurred while linting ...
Rule: "@typescript-eslint/no-base-to-string"
at getNameOfSymbolAsWritten (.../node_modules/typescript/lib/typescript.js:59075:36)
at createAccessFromSymbolChain (.../node_modules/typescript/lib/typescript.js:56976:25)
at symbolToTypeNode (.../node_modules/typescript/lib/typescript.js:56953:26)
at typeToTypeNodeWorker (.../node_modules/typescript/lib/typescript.js:55397:16)
at typeToTypeNodeHelper (.../node_modules/typescript/lib/typescript.js:55247:24)
at mapToTypeNodes (.../node_modules/typescript/lib/typescript.js:56233:28)
at typeReferenceToTypeNode (.../node_modules/typescript/lib/typescript.js:55913:33)
at visitAndTransformType (.../node_modules/typescript/lib/typescript.js:55733:24)
at typeToTypeNodeWorker (.../node_modules/typescript/lib/typescript.js:55402:28)
at typeToTypeNodeHelper (.../node_modules/typescript/lib/typescript.js:55247:24)
Additional Info
No response