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

💅 noParameterAssign does not work when assigning to value in array #5205

Open
1 task done
harrismcc opened this issue Feb 25, 2025 · 0 comments
Open
1 task done
Labels
good first issue Good for newcomers 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

@harrismcc
Copy link

Environment information

CLI:
  Version:                      1.9.4
  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:           "v18.20.6"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/4.5.0"

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

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  true
  GraphQL enabled:              false
  Recommended:                  false
  All:                          false
  Enabled rules:
  suspicious/noCatchAssign
  suspicious/noUnsafeNegation
  complexity/useLiteralKeys
  complexity/noMultipleSpacesInRegularExpressionLiterals
  suspicious/useValidTypeof
  a11y/useValidAriaRole
  correctness/noConstantCondition
  a11y/useAriaActivedescendantWithTabindex
  suspicious/noDuplicateParameters
  style/useDefaultParameterLast
  correctness/noConstructorReturn
  style/useTemplate
  correctness/noUnusedLabels
  complexity/noUselessTernary
  correctness/noUnreachableSuper
  suspicious/noExplicitAny
  suspicious/noCompareNegZero
  correctness/noSwitchDeclarations
  a11y/noAutofocus
  correctness/noUnsafeOptionalChaining
  correctness/noConstAssign
  suspicious/noControlCharactersInRegex
  complexity/noUselessTypeConstraint
  style/noVar
  suspicious/noDoubleEquals
  suspicious/noMisleadingCharacterClass
  correctness/noPrecisionLoss
  correctness/noSetterReturn
  suspicious/noFallthroughSwitchClause
  a11y/useKeyWithClickEvents
  suspicious/noDuplicateObjectKeys
  correctness/noUnreachable
  suspicious/noUnsafeDeclarationMerging
  correctness/noInnerDeclarations
  suspicious/noDuplicateCase
  style/noParameterAssign
  a11y/useValidAnchor
  complexity/useRegexLiterals
  correctness/noSelfAssign
  suspicious/noEmptyBlockStatements
  suspicious/noShadowRestrictedNames
  a11y/useMediaCaption
  complexity/noUselessLabel
  complexity/noUselessCatch
  correctness/noUnsafeFinally
  a11y/useAriaPropsForRole
  style/useCollapsedElseIf
  correctness/noNonoctalDecimalEscape
  a11y/useHtmlLang
  suspicious/noImportAssign
  style/useNumericLiterals
  a11y/noNoninteractiveTabindex
  correctness/useYield
  suspicious/useDefaultSwitchClauseLast
  a11y/noInteractiveElementToNoninteractiveRole
  suspicious/noLabelVar
  correctness/noGlobalObjectCalls
  a11y/useAltText
  correctness/noEmptyCharacterClassInRegex
  a11y/useIframeTitle
  complexity/noBannedTypes
  suspicious/noPrototypeBuiltins
  style/useAsConstAssertion
  correctness/useJsxKeyInIterable
  suspicious/noMisleadingInstantiator
  complexity/noUselessLoneBlockStatements
  complexity/noVoid
  a11y/useValidAriaValues
  style/noArguments
  suspicious/noGlobalAssign
  suspicious/noCommentText
  suspicious/noDebugger
  suspicious/useGetterReturn
  suspicious/noDuplicateJsxProps
  a11y/noPositiveTabindex
  correctness/noEmptyPattern
  security/noDangerouslySetInnerHtmlWithChildren
  suspicious/noExtraNonNullAssertion
  a11y/useKeyWithMouseEvents
  correctness/useExhaustiveDependencies
  security/noGlobalEval
  style/useConst
  a11y/noRedundantRoles
  correctness/useHookAtTopLevel
  correctness/useIsNan
  suspicious/noSelfCompare
  suspicious/noAsyncPromiseExecutor
  security/noDangerouslySetInnerHtml
  a11y/noDistractingElements
  complexity/noWith
  style/useForOf
  complexity/noExtraBooleanCast
  a11y/useValidAriaProps
  a11y/noRedundantAlt
  correctness/noChildrenProp
  a11y/noAriaUnsupportedElements
  style/useShorthandAssign
  a11y/noBlankTarget
  correctness/useValidForDirection
  style/useBlockStatements
  a11y/useAnchorContent
  complexity/noUselessRename
  correctness/noInvalidNewBuiltin
  a11y/noAccessKey
  style/noRestrictedGlobals
  style/useExponentiationOperator
  suspicious/useAwait
  style/useSingleVarDeclarator
  a11y/noNoninteractiveElementToInteractiveRole
  style/noCommaOperator
  style/noNamespace
  a11y/noHeaderScope
  correctness/noNewSymbol
  suspicious/noClassAssign
  suspicious/noFunctionAssign

Workspace:
  Open Documents:               0

Rule name

lint/style/noParameterAssign

Playground link

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

Expected result

The biome lint rule lint/style/noParameterAssign correctly flags the direct reassignment of a function parameter at the top level, but fails to identify indirect reassignment, or parameter mutations.

This works differently that eslints no-param-reassign which catches this case.

Image
Image

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@harrismcc harrismcc added the S-Needs triage Status: this issue needs to be triaged label Feb 25, 2025
@arendjr arendjr added S-Help-wanted Status: you're familiar with the code base and want to help the project S-Bug-confirmed Status: report has been confirmed as a valid bug good first issue Good for newcomers and removed S-Needs triage Status: this issue needs to be triaged labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers 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

No branches or pull requests

2 participants