Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💅 useSingleVarDeclarator suggests non-working code #728

Closed
1 task done
rubiesonthesky opened this issue Nov 14, 2023 · 0 comments · Fixed by #1070
Closed
1 task done

💅 useSingleVarDeclarator suggests non-working code #728

rubiesonthesky opened this issue Nov 14, 2023 · 0 comments · Fixed by #1070
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@rubiesonthesky
Copy link

Environment information

CLI:
  Version:                      1.3.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.2"

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

Workspace:
  Open Documents:               0

Rule name

useSingleVarDeclarator

Playground link

https://biomejs.dev/playground/?code=IAAgACAAIABjAG8AbgBzAHQACgAgACAAIAAgACAAIABBACAAPQAgADEAMAAwACwACgAgACAAIAAgACAAIABCACAAPQAgADEANQAwACwACgAgACAAIAAgACAAIABEACAAPQAgADEAMgAwACwACgAgACAAIAAgACAAIABFACAAPQAgAEQAIAAvACAAQgAsAAoAIAAgACAAIAAgACAARgAgAD0AIAB7AGgAZQBpAGcAaAB0ADoAIABCACwAIAB3AGkAZAB0AGgAOgAgAEEAfQA7AA%3D%3D

Expected result

Code should work after lint fix :)

-     const
-       A = 100,
-       B = 150,
-       D = 120,
-       E = D / B,
-       F = {height: B, width: A};
+     constA = 100;    constB = 150;    constD = 120;    constE = D / B;    constF = {height: B, width: A};

Expected result was

    const A = 100;
    const B = 150;
    const D = 120;
    const E = D / B;
    const F = {height: B, width: A};

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 14, 2023
@Conaclos Conaclos self-assigned this Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants