Skip to content

💅 noUnresolvedImports: cannot resolve variables exported using export = Namespace #10283

@kosmadenis

Description

@kosmadenis

Environment information

Details
CLI:
  Version:                      2.4.14
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

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:                         unset
  JS_RUNTIME_VERSION:           v25.9.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         pnpm/11.0.6

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

Linter:
  JavaScript enabled:           unset
  JSON enabled:                 unset
  CSS enabled:                  unset
  GraphQL enabled:              unset
  Recommended:                  false
  Enabled rules:
    correctness/noUnresolvedImports

Workspace:
  Open Documents:               0

Rule name

noUnresolvedImports

Playground link

https://next.biomejs.dev/playground/?lintRules=noUnresolvedImports&tab=formatter&pane=Diagnostics&files.main.ts=aQBtAHAAbwByAHQAIAB7AAoACQBhAEYAdQBuAGMAdABpAG8AbgAsAAoACQBhAEMAbABhAHMAcwAsAAoACQBhAFQAeQBwAGUALAAKAAkAYQBuAEkAbgB0AGUAcgBmAGEAYwBlACwACgAJAGEAQwBvAG4AcwB0ACwACgAJAGEATABlAHQALAAKAAkAYQBWAGEAcgAsAAoAfQAgAGYAcgBvAG0AIAAiAC4ALwBmAG8AbwAiADsACgA%3D&files.foo.d.ts=ZQB4AHAAbwByAHQAIAA9ACAARgBvAG8AOwAKAAoAZABlAGMAbABhAHIAZQAgAG4AYQBtAGUAcwBwAGEAYwBlACAARgBvAG8AIAB7AAoAIAAgAGYAdQBuAGMAdABpAG8AbgAgAGEARgB1AG4AYwB0AGkAbwBuACgAKQA6ACAAdgBvAGkAZAA7AAoAIAAgAGMAbABhAHMAcwAgAGEAQwBsAGEAcwBzACAAewB9AAoAIAAgAHQAeQBwAGUAIABhAFQAeQBwAGUAIAA9ACAAbgB1AGwAbAA7AAoAIAAgAGkAbgB0AGUAcgBmAGEAYwBlACAAYQBuAEkAbgB0AGUAcgBmAGEAYwBlACAAewB9AAoAIAAgAGMAbwBuAHMAdAAgAGEAQwBvAG4AcwB0ADoAIABuAHUAbABsADsACgAgACAAbABlAHQAIABhAEwAZQB0ADoAIABuAHUAbABsADsACgAgACAAdgBhAHIAIABhAFYAYQByADoAIABuAHUAbABsADsACgB9AAoA

Expected result

Biome fails to resolve variables (const, let, var) that are exported using export = Namespace from a .d.ts file. It does successfully resolve function, class, type and interface.

I originally ran into this while using react: import { Suspense, use } from 'react'. There, use is a function and it does not produce a diagnostic, but Suspense is a const and there is a diagnostic.

Related to #9626, #9904.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-Needs triageStatus: this issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions