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
(new Error('broken')).toString()
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/no-base-to-string": ["error"],
},
};
tsconfig
Expected Result
The code should be fine as the runtime output is:
'Error: broken'
Actual Result
eslint reports:
'new Error('broken') will evaluate to '[object Object]' when stringified.ESLint (@typescript-eslint/no-base-to-string)
Additional Info
No response
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
5.24.0 |
@typescript-eslint/parser |
5.24.0 |
TypeScript |
4.6.2 |
ESLint |
8.15.0 |