Skip to content

🐛 useExhaustiveDependencies error when useState is on a new line #168

@aparedes

Description

@aparedes

Environment information

CLI:
  Version:                      1.0.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.16.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.19"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Discovering running Biome servers...

Running Biome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The client isn't connected to any server but rage discovered this running Biome server.

Server:
  Version:                      1.0.0
  Name:                         rome_lsp
  CPU Architecture:             x86_64
  OS:                           macos

Workspace:
  Open Documents:               0

Other Active Server Workspaces:

Workspace:
  Open Documents:               4
  Client Name:                  Visual Studio Code
  Client Version:               1.81.1

What happened?

useExhaustiveDependencies marks incorrectly a useState function as a missing dependency when the useState statement is on the next line.

https://biomejs.dev/playground/?indentStyle=space&quoteStyle=single&jsxQuoteStyle=single&lintRules=all&code=aQBtAHAAbwByAHQAIAB7ACAAdQBzAGUAUwB0AGEAdABlACwAIAB1AHMAZQBFAGYAZgBlAGMAdAAgAH0AIABmAHIAbwBtACAAJwByAGUAYQBjAHQAJwA7AAoACgB0AHkAcABlACAAUwBvAG0AZQBMAG8AbgBnAFMAdAByAGkAbgBnAFQAeQBwAGUAIAA9ACAAcwB0AHIAaQBuAGcAOwAKAGUAeABwAG8AcgB0ACAAYwBvAG4AcwB0ACAAQwBvAG0AcABvAG4AZQBuAHQAIAA9ACAAKAApACAAPQA%2BACAAewAKACAAIABjAG8AbgBzAHQAIABbAHMAdAByAGkAbgBnAEMAbwBuAHQAZQBuAHQALAA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AKAAoAIAAgAHIAZQB0AHUAcgBuACAAcwB0AHIAaQBuAGcAQwBvAG4AdABlAG4AdAA7AAoAfQA7AAoA

Expected result

No useExhaustiveDependencies error on useState functions

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions