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

💅 Variable names are auto fixed in a breaking way #2216

Closed
1 task done
colin99d opened this issue Mar 26, 2024 · 2 comments · Fixed by #2264
Closed
1 task done

💅 Variable names are auto fixed in a breaking way #2216

colin99d opened this issue Mar 26, 2024 · 2 comments · Fixed by #2264
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

@colin99d
Copy link

Environment information

CLI:
  Version:                      1.6.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "screen-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

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

Linter:
  Recommended:                  false
  All:                          true
  Rules:                        a11y/noSvgWithoutTitle = "off"
                                a11y/useAltText = "off"
                                a11y/useButtonType = "off"
                                a11y/useIframeTitle = "off"
                                a11y/useKeyWithClickEvents = "off"
                                a11y/useMediaCaption = "off"
                                a11y/useValidAnchor = "off"
                                complexity/noBannedTypes = "off"
                                complexity/noForEach = "off"
                                complexity/noUselessSwitchCase = "off"
                                correctness/noChildrenProp = "off"
                                correctness/noInnerDeclarations = "off"
                                correctness/useExhaustiveDependencies = "off"
                                nursery/useImportRestrictions = "off"
                                security/noDangerouslySetInnerHtml = "off"
                                style/noArguments = "off"
                                style/noNonNullAssertion = "off"
                                style/noParameterAssign = "off"
                                suspicious/noArrayIndexKey = "off"
                                suspicious/noAssignInExpressions = "off"
                                suspicious/noExplicitAny = "off"
                                suspicious/noPrototypeBuiltins = "off"
                                suspicious/useValidTypeof = "off"

Workspace:
  Open Documents:

Rule name

lint/style/useNamingConvention

Playground link

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

Expected result

Right now this code:
function loadWidgetComponent(widgetId: WidgetId) { const Component = getWidgetComponent(widgetId); if (!Component) return null; return <Component />; }

Is converted to:
function loadWidgetComponent(widgetId: WidgetId) { const component = getWidgetComponent(widgetId); if (!component) return null; return <Component />; }

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico 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 Mar 26, 2024
@fireairforce
Copy link
Member

I want to fix this~

@Conaclos
Copy link
Member

Conaclos commented Apr 1, 2024

I think the issue is coming from the semantic model that failed to bind the variable Component with the JSX element Component.

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.

4 participants