-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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
class ZodError<T = unknown> {}
try {
// ...
} catch (e) {
if (e instanceof ZodError) {
alert(e.toString());
}
}
ESLint Config
module.exports = {
"rules": {
"@typescript-eslint/no-base-to-string": [
"error",
{
"ignoredTypeNames": [
"Error",
"RegExp",
"URL",
"URLSearchParams"
]
}
]
}
}
tsconfig
Expected Result
The lint should be ignored due to the ignoredTypeNames
.
Actual Result
The lint is triggered:
'e' will use Object's default stringification format ('[object Object]') when stringified. 7:11 - 7:12
Additional Info
I got this error when upgrading zod from v3 to v4.
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin