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

2.0.0-beta.1 noUselessFragments removes important code #5484

Open
1 task done
hyperknot opened this issue Mar 27, 2025 · 1 comment · May be fixed by #5550
Open
1 task done

2.0.0-beta.1 noUselessFragments removes important code #5484

hyperknot opened this issue Mar 27, 2025 · 1 comment · May be fixed by #5550
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

@hyperknot
Copy link

Environment information

CLI:
  Version:                      2.0.0-beta.1
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v22.13.1
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         pnpm/10.6.5

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         /Users/user/Documents/dev/chatcore/repo/biome.jsonc
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  true

Linter:
  JavaScript enabled:           unset
  JSON enabled:                 unset
  CSS enabled:                  unset
  GraphQL enabled:              unset
  Recommended:                  unset
  Enabled rules:
    a11y/noAccessKey
    a11y/noAriaHiddenOnFocusable
    a11y/noAriaUnsupportedElements
    a11y/noAutofocus
    a11y/noBlankTarget
    a11y/noDistractingElements
    a11y/noHeaderScope
    a11y/noInteractiveElementToNoninteractiveRole
    a11y/noLabelWithoutControl
    a11y/noNoninteractiveTabindex
    a11y/noPositiveTabindex
    a11y/noRedundantAlt
    a11y/noRedundantRoles
    a11y/noSvgWithoutTitle
    a11y/useAltText
    a11y/useAnchorContent
    a11y/useAriaActivedescendantWithTabindex
    a11y/useAriaPropsForRole
    a11y/useGenericFontNames
    a11y/useHeadingContent
    a11y/useHtmlLang
    a11y/useIframeTitle
    a11y/useMediaCaption
    a11y/useValidAnchor
    a11y/useValidAriaProps
    a11y/useValidAriaRole
    a11y/useValidAriaValues
    a11y/useValidLang
    complexity/noAdjacentSpacesInRegex
    complexity/noBannedTypes
    complexity/noEmptyTypeParameters
    complexity/noExtraBooleanCast
    complexity/noStaticOnlyClass
    complexity/noThisInStatic
    complexity/noUselessCatch
    complexity/noUselessConstructor
    complexity/noUselessEmptyExport
    complexity/noUselessFragments
    complexity/noUselessLabel
    complexity/noUselessLoneBlockStatements
    complexity/noUselessRename
    complexity/noUselessSwitchCase
    complexity/noUselessTernary
    complexity/noUselessThisAlias
    complexity/noUselessTypeConstraint
    complexity/noWith
    complexity/useArrowFunction
    complexity/useFlatMap
    complexity/useLiteralKeys
    complexity/useOptionalChain
    complexity/useRegexLiterals
    complexity/useSimpleNumberKeys
    correctness/noChildrenProp
    correctness/noConstAssign
    correctness/noConstantCondition
    correctness/noConstructorReturn
    correctness/noEmptyCharacterClassInRegex
    correctness/noEmptyPattern
    correctness/noFlatMapIdentity
    correctness/noGlobalObjectCalls
    correctness/noInnerDeclarations
    correctness/noInvalidBuiltinInstantiation
    correctness/noInvalidConstructorSuper
    correctness/noInvalidDirectionInLinearGradient
    correctness/noInvalidGridAreas
    correctness/noInvalidPositionAtImportRule
    correctness/noInvalidUseBeforeDeclaration
    correctness/noNonoctalDecimalEscape
    correctness/noPrecisionLoss
    correctness/noPrivateImports
    correctness/noSelfAssign
    correctness/noSetterReturn
    correctness/noStringCaseMismatch
    correctness/noSwitchDeclarations
    correctness/noUnknownFunction
    correctness/noUnknownMediaFeatureName
    correctness/noUnknownProperty
    correctness/noUnknownUnit
    correctness/noUnmatchableAnbSelector
    correctness/noUnreachable
    correctness/noUnreachableSuper
    correctness/noUnsafeFinally
    correctness/noUnsafeOptionalChaining
    correctness/noUnusedLabels
    correctness/noUselessContinue
    correctness/noVoidElementsWithChildren
    correctness/noVoidTypeReturn
    correctness/useIsNan
    correctness/useValidForDirection
    correctness/useYield
    performance/noAccumulatingSpread
    security/noDangerouslySetInnerHtml
    security/noDangerouslySetInnerHtmlWithChildren
    security/noGlobalEval
    style/noArguments
    style/noCommaOperator
    style/noInferrableTypes
    style/noParameterAssign
    style/noUnusedTemplateLiteral
    style/useAsConstAssertion
    style/useConsistentArrayType
    style/useDefaultParameterLast
    style/useEnumInitializers
    style/useExponentiationOperator
    style/useExportType
    style/useImportType
    style/useLiteralEnumMembers
    style/useNodejsImportProtocol
    style/useNumberNamespace
    style/useNumericLiterals
    style/useSelfClosingElements
    style/useShorthandFunctionType
    style/useSingleVarDeclarator
    style/useTemplate
    suspicious/noApproximativeNumericConstant
    suspicious/noArrayIndexKey
    suspicious/noAsyncPromiseExecutor
    suspicious/noCatchAssign
    suspicious/noClassAssign
    suspicious/noCommentText
    suspicious/noCompareNegZero
    suspicious/noConfusingLabels
    suspicious/noConfusingVoidType
    suspicious/noConstEnum
    suspicious/noControlCharactersInRegex
    suspicious/noDoubleEquals
    suspicious/noDuplicateAtImportRules
    suspicious/noDuplicateCase
    suspicious/noDuplicateClassMembers
    suspicious/noDuplicateFontNames
    suspicious/noDuplicateJsxProps
    suspicious/noDuplicateObjectKeys
    suspicious/noDuplicateParameters
    suspicious/noDuplicateSelectorsKeyframeBlock
    suspicious/noEmptyInterface
    suspicious/noExtraNonNullAssertion
    suspicious/noFallthroughSwitchClause
    suspicious/noFunctionAssign
    suspicious/noGlobalAssign
    suspicious/noGlobalIsFinite
    suspicious/noGlobalIsNan
    suspicious/noImportAssign
    suspicious/noImportantInKeyframe
    suspicious/noLabelVar
    suspicious/noMisleadingCharacterClass
    suspicious/noMisleadingInstantiator
    suspicious/noMisrefactoredShorthandAssign
    suspicious/noPrototypeBuiltins
    suspicious/noRedeclare
    suspicious/noRedundantUseStrict
    suspicious/noSelfCompare
    suspicious/noShadowRestrictedNames
    suspicious/noShorthandPropertyOverrides
    suspicious/noSparseArray
    suspicious/noSuspiciousSemicolonInJsx
    suspicious/noThenProperty
    suspicious/noUnsafeDeclarationMerging
    suspicious/noUnsafeNegation
    suspicious/useDefaultSwitchClauseLast
    suspicious/useGetterReturn
    suspicious/useIsArray
    suspicious/useNamespaceKeyword
    suspicious/useValidTypeof

Workspace:
  Open Documents:               0

Rule name

lint/complexity/noUselessFragments

Playground link

https://next.biomejs.dev/playground/?code=ZQB4AHAAbwByAHQAIABjAG8AbgBzAHQAIABDAGgAYQB0AFMAZQB0AHQAaQBuAGcAcwA6ACAAQwBvAG0AcABvAG4AZQBuAHQAPABDAGgAYQB0AFAAcgBvAHAAcwA%2BACAAPQAgACgAcAByAG8AcABzACkAIAA9AD4AIAB7AAoAIAAgAHIAZQB0AHUAcgBuACAAKAAKACAAIAAgACAAPABkAGkAdgAgAHsALgAuAC4AcwB0AHkAbABlAHgALgBhAHQAdAByAHMAKABzAHQAeQBsAGUAcwAuAGIAYQBzAGUAKQB9AD4ACgAgACAAIAAgACAAIAA8AD4AcwB5AHMAdABlAG0AIABwAHIAbwBtAHAAdAA6AHsAJwAgACcAfQA8AC8APgAKACAAIAAgACAAIAAgADwAQgBsAG8AYwBrAEEAcgByAGEAeQAgAGIAbABvAGMAawBBAHIAcgBhAHkAPQB7AHAAcgBvAHAAcwAuAGMAaABhAHQALgBzAHQAYQB0AGUALgBzAHkAcwB0AGUAbQBfAHAAcgBvAG0AcAB0AH0AIABwAHIAbwBjAGUAcwBzAE0AYQByAGsAZABvAHcAbgA9AHsAZgBhAGwAcwBlAH0AIAAvAD4ACgAgACAAIAAgACAAIAA8AE0AbwBkAGUAbABTAGUAbABlAGMAdABvAHIAIABjAGgAYQB0AD0AewBwAHIAbwBwAHMALgBjAGgAYQB0AH0AIAAvAD4ACgAgACAAIAAgADwALwBkAGkAdgA%2BAAoAIAAgACkACgB9AAoA&ruleDomains.solid=recommended

Expected result

Playground doesn't show this, but it's actually totally destroyed with check --write --unsafe.

It becomes this!!

export const ChatSettings: Component<ChatProps> = (props) => {
  return <div {...stylex.attrs(styles.base)}>system prompt: </div>
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@hyperknot hyperknot added the S-Needs triage Status: this issue needs to be triaged label Mar 27, 2025
@ematipico
Copy link
Member

Playground doesn't show this

It does, actually. You need to click the console tab, next to Diagnostics:

Image

@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 27, 2025
@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Mar 27, 2025
@dyc3 dyc3 self-assigned this Apr 1, 2025
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
3 participants