Skip to content

🐛 lint/nursery/useNullishCoalescing not working properly in 2.4.11 #9919

@jakeleventhal

Description

@jakeleventhal

Environment information

Details
▶ bun biome rage                                                                                                                                                                  
CLI:
  Version:                      2.4.11
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v24.12.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         bun/1.3.12

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.jsonc
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true
  HTML full support enabled:    unset

Workspace:
  Open Documents:               0

What happened?

biome check . --write --unsafe --error-on-warnings
export const normalizeTaxRegistrationValue = (
	value: string | null | undefined,
) =>
	// `""` = not configured, `null` = user explicitly does not have one.
	value === undefined ? "" : value;

Expected result

This should not trigger a diagnostic. It wants me to use nullish coallescing for
this but this changes behavior.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions