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

Bug: [no-redundant-type-constituents]string | undefined withstrickNullChecks: false should have an exception #11800

Open
Labels
bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a look
@alumni

Description

@alumni

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.9.2&showAST=ts&fileType=.tsx&code=C4TwDgpgBAysBOBLAdgc0QZwBZQLxQwRVSgB8oBXZAEwgDMUJqypkKAbdoA&eslintrc=N4KABGBEBOCuA2BTAzpAXGYELm5AAgC4CeADigMbQCWphAtCvNQHaED0LA9vdIgCawW-AIZt6JcvQpcWyQtUKxEbVBgDakRNGhdokALq4AviGNA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylAGYBDVCXTgwAXxCygA&tokens=false

Repro Code

typeStringLike=string|undefined|null;

ESLint Config

module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/no-redundant-type-constituents":["error"],},};

tsconfig

{"compilerOptions": {"strictNullChecks":false,  }}

Expected Result

No error (either by default like before or via additional option)

Actual Result

undefined is overridden by string in this union type
null is overridden by string in this union type

Additional Info

There are a lot of repos not using strict type checking but trying to transition to it, so adding| null or| undefined to the places where it's necessary takes a lot of time, especially when it's not done on a per-file basis where you can use a TS plugin.

Would be great to be allowed to have an exception for that, or have them ignored by default like until 8.47.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a look

    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