Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docs: [no-base-to-string] erroneously refers to regular expressions #11420

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@tyilo

Description

@tyilo

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.

Playground Link

https://typescript-eslint.io/play/#ts=5.8.2&fileType=.ts&code=MYGwhgzhAEBaD2ATAogJ1fVAeAKtAvNAK4B2A1ifAO4kB80A3gL4BQLALqgJ6MvTQB6AdAB0Ylk2jAw7YAAtoACgCmASl78AlgDMly6JpIR2YEsGXxdCFOkzqGfftDAhlqdipHt4AZU6GAc0VVVQBuR1YmIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oCMBDZRLXxdk%2BKkwDm6MAG1w2HImjQO0SABp5CrAuyRKEztEQATAColEAOV4BbFNLm7dkAKLLVGrc6gAlRBKuAB7EXj56AKq%2BADJh4VBR0QDKiLzQZAAWAAppdqjeCgC6BWAAvt7FEOWlQA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

classZodError<T=unknown>{}try{// ...}catch(e){if(einstanceofZodError){alert(e.toString());}}

ESLint Config

module.exports={"rules":{"@typescript-eslint/no-base-to-string":["error",{"ignoredTypeNames":["Error","RegExp","URL","URLSearchParams"]}]}}

tsconfig

{"compilerOptions": {"strictNullChecks":true  }}

Expected Result

The lint should be ignored due to theignoredTypeNames.

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 upgradingzod from v3 to v4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuedocumentationDocumentation ("docs") that needs adding/updatingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp