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

💅 lint/complexity/noUselessFragments crashes when applying fix in some cases #3149

Closed
1 task done
simon-paris opened this issue Jun 10, 2024 · 2 comments · Fixed by #3338
Closed
1 task done

💅 lint/complexity/noUselessFragments crashes when applying fix in some cases #3149

simon-paris opened this issue Jun 10, 2024 · 2 comments · Fixed by #3338
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 S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@simon-paris
Copy link
Contributor

Environment information

CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.22"

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

Workspace:
  Open Documents:               0

✨  Done in 0.49s.
simonparis@CMBP-SG-MAR22-0321 mweb % yarn biome rage --linter
yarn run v1.22.22
$ /Users/simonparis/mweb/node_modules/.bin/biome rage --linter
CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.11.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.22"

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

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  false
  Recommended:                  true
  All:                          false
  Enabled rules:
  suspicious/noCatchAssign
  suspicious/noUnsafeNegation
  suspicious/useNamespaceKeyword
  a11y/useValidLang
  complexity/noUselessEmptyExport
  complexity/noMultipleSpacesInRegularExpressionLiterals
  suspicious/useValidTypeof
  a11y/useValidAriaRole
  correctness/noConstantCondition
  a11y/useAriaActivedescendantWithTabindex
  suspicious/noDuplicateParameters
  complexity/noEmptyTypeParameters
  correctness/noConstructorReturn
  style/useTemplate
  correctness/noUnusedLabels
  complexity/noUselessTernary
  correctness/noUnreachableSuper
  suspicious/noCompareNegZero
  correctness/noSwitchDeclarations
  correctness/noUnsafeOptionalChaining
  correctness/noConstAssign
  suspicious/noControlCharactersInRegex
  complexity/noUselessTypeConstraint
  style/noVar
  suspicious/noDoubleEquals
  suspicious/noRedundantUseStrict
  style/useLiteralEnumMembers
  suspicious/noGlobalIsNan
  suspicious/noEmptyInterface
  suspicious/noMisleadingCharacterClass
  correctness/noPrecisionLoss
  suspicious/noRedeclare
  correctness/noStringCaseMismatch
  correctness/noSetterReturn
  correctness/noInvalidConstructorSuper
  suspicious/noDuplicateObjectKeys
  suspicious/noUnsafeDeclarationMerging
  correctness/noUnreachable
  complexity/noUselessThisAlias
  complexity/noThisInStatic
  correctness/noInnerDeclarations
  suspicious/noDuplicateCase
  style/noParameterAssign
  a11y/useValidAnchor
  correctness/noSelfAssign
  style/useShorthandFunctionType
  suspicious/noShadowRestrictedNames
  complexity/noUselessLabel
  complexity/noUselessCatch
  correctness/noUnsafeFinally
  a11y/useAriaPropsForRole
  correctness/noNonoctalDecimalEscape
  a11y/useHtmlLang
  complexity/noStaticOnlyClass
  style/useWhile
  suspicious/noImportAssign
  style/useNumericLiterals
  complexity/useSimpleNumberKeys
  a11y/noInteractiveElementToNoninteractiveRole
  suspicious/noLabelVar
  correctness/noUnnecessaryContinue
  suspicious/noApproximativeNumericConstant
  correctness/noGlobalObjectCalls
  a11y/useAltText
  correctness/noEmptyCharacterClassInRegex
  suspicious/noSuspiciousSemicolonInJsx
  suspicious/noSparseArray
  a11y/useIframeTitle
  suspicious/noPrototypeBuiltins
  correctness/noVoidElementsWithChildren
  suspicious/noMisleadingInstantiator
  suspicious/noDebugger
  style/useExportType
  complexity/noUselessLoneBlockStatements
  style/noArguments
  a11y/useValidAriaValues
  suspicious/noGlobalAssign
  suspicious/noCommentText
  suspicious/noThenProperty
  suspicious/useGetterReturn
  suspicious/noDuplicateJsxProps
  a11y/noPositiveTabindex
  correctness/noEmptyPattern
  security/noDangerouslySetInnerHtmlWithChildren
  suspicious/noExtraNonNullAssertion
  correctness/noRenderReturnValue
  security/noGlobalEval
  style/useConst
  a11y/noRedundantRoles
  complexity/useFlatMap
  correctness/useIsNan
  suspicious/noGlobalIsFinite
  suspicious/noSelfCompare
  suspicious/noAsyncPromiseExecutor
  a11y/noDistractingElements
  complexity/noWith
  suspicious/noDuplicateClassMembers
  complexity/noExtraBooleanCast
  a11y/useValidAriaProps
  a11y/noRedundantAlt
  correctness/noChildrenProp
  suspicious/noConfusingLabels
  suspicious/noConfusingVoidType
  suspicious/noFocusedTests
  a11y/noAriaUnsupportedElements
  correctness/noFlatMapIdentity
  a11y/noBlankTarget
  a11y/useHeadingContent
  correctness/useValidForDirection
  correctness/noVoidTypeReturn
  correctness/noInvalidUseBeforeDeclaration
  a11y/noAriaHiddenOnFocusable
  a11y/useAnchorContent
  complexity/noUselessRename
  correctness/noInvalidNewBuiltin
  complexity/noUselessConstructor
  a11y/noAccessKey
  style/useExponentiationOperator
  suspicious/noExportsInTest
  a11y/noNoninteractiveElementToInteractiveRole
  style/noCommaOperator
  suspicious/useIsArray
  a11y/noHeaderScope
  complexity/noUselessFragments
  suspicious/noMisrefactoredShorthandAssign
  suspicious/noClassAssign
  suspicious/noFunctionAssign

Workspace:
  Open Documents:               0

Rule name

lint/complexity/noUselessFragments

Playground link

https://biomejs.dev/playground/?code=LwAvACAAYwByAGEAcwBoACAAaQBzACAAdAByAGkAZwBnAGUAcgBlAGQAIABiAHkAOgAKAC8ALwAgADEALgAgAHAAYQBzAHMAaQBuAGcAIABmAHIAYQBnAG0AZQBuAHQAIAB0AG8AIABmAHUAbgBjAHQAaQBvAG4AIABvAHIAIAB1AHMAaQBuAGcAIABmAHIAYQBnAG0AZQBuAHQAIABhAHMAIABvAHAAZQByAGEAdABvAHIAIABhAHIAZwAsACAAYQBuAGQACgAvAC8AIAAyAC4AIABmAHIAYQBnAG0AZQBuAHQAIABjAG8AbgB0AGEAaQBuAHMAIABhAG4AeQAgAGUAeABwAGUAcgBzAHMAaQBvAG4AIABvAHQAaABlAHIAIAB0AGgAYQBuACAAYQAgAHAAbABhAGkAbgAgAGkAZABlAG4AdABpAGYAaQBlAHIALAAgAGEAbgBkAAoALwAvACAAMwAuACAALQAtAGEAcABwAGwAeQAtAHUAbgBzAGEAZgBlACAAaQBzACAAdQBzAGUAZAAKAGYAbgAoADwAPgB7AG0AZQBtAGIAZQByAC4AZQB4AHAAcgBlAHMAcwBpAG8AbgB9ADwALwA%2BACkAOwAKACgAPAA%2BAHsAMQB9ADwALwA%2BACkALgB0AG8AUwB0AHIAaQBuAGcAKAApADsACgA%3D

Expected result

It should not crash.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@togami2864 togami2864 added S-Help-wanted Status: you're familiar with the code base and want to help the project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Jun 10, 2024
@unvalley unvalley self-assigned this Jun 17, 2024
@unvalley
Copy link
Member

unvalley commented Jul 1, 2024

@simon-paris
Hi, thank you for reporting.
I have tried in my own repository and have not been able to reproduce it. Could you create a reproduction?

@simon-paris
Copy link
Contributor Author

No problem, here you go: https://github.com/simon-paris/biome-fragment-crash-repro

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 S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants