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

💅 Private class properties (#) cause errors when using accessibility explicit #4276

Closed
1 task done
profaurore opened this issue Oct 14, 2024 · 0 comments · Fixed by #4292
Closed
1 task done

💅 Private class properties (#) cause errors when using accessibility explicit #4276

profaurore opened this issue Oct 14, 2024 · 0 comments · Fixed by #4292
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

@profaurore
Copy link

Environment information

CLI:
  Version:                      1.9.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v21.6.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.21"

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:                          true
  Enabled rules:
  suspicious/noCatchAssign
  complexity/useLiteralKeys
  complexity/noMultipleSpacesInRegularExpressionLiterals
  suspicious/useNamespaceKeyword
  complexity/noUselessEmptyExport
  nursery/useConsistentMemberAccessibility
  suspicious/noAssignInExpressions
  suspicious/noDuplicateSelectorsKeyframeBlock
  suspicious/noDuplicateParameters
  correctness/noConstructorReturn
  style/useSelfClosingElements
  suspicious/noMisplacedAssertion
  style/useTemplate
  correctness/noUnusedLabels
  correctness/noUnreachableSuper
  suspicious/noCompareNegZero
  a11y/noAutofocus
  correctness/noUnsafeOptionalChaining
  correctness/noConstAssign
  suspicious/noControlCharactersInRegex
  style/noVar
  suspicious/noDoubleEquals
  suspicious/noEmptyInterface
  suspicious/noConstEnum
  nursery/noDuplicateElseIf
  correctness/noPrecisionLoss
  correctness/noSetterReturn
  correctness/noInvalidConstructorSuper
  suspicious/noImplicitAnyLet
  a11y/useKeyWithClickEvents
  suspicious/noDuplicateObjectKeys
  suspicious/noUnsafeDeclarationMerging
  correctness/noInnerDeclarations
  correctness/useArrayLiterals
  style/noUselessElse
  correctness/noInvalidDirectionInLinearGradient
  nursery/noMissingVarFunction
  suspicious/noImportantInKeyframe
  complexity/noUselessLabel
  complexity/noUselessCatch
  a11y/useAriaPropsForRole
  style/useCollapsedElseIf
  nursery/noOctalEscape
  correctness/noNonoctalDecimalEscape
  suspicious/noDuplicateTestHooks
  style/noDoneCallback
  complexity/noStaticOnlyClass
  complexity/noUselessUndefinedInitialization
  nursery/noNestedTernary
  a11y/noInteractiveElementToNoninteractiveRole
  correctness/noNodejsModules
  correctness/noUnnecessaryContinue
  suspicious/noApproximativeNumericConstant
  suspicious/noLabelVar
  nursery/noDuplicateCustomProperties
  correctness/noUnknownUnit
  correctness/noEmptyCharacterClassInRegex
  correctness/useImportExtensions
  suspicious/noSparseArray
  a11y/useIframeTitle
  nursery/noExportedImports
  a11y/noSvgWithoutTitle
  correctness/noVoidElementsWithChildren
  correctness/useJsxKeyInIterable
  style/useExportType
  complexity/noUselessLoneBlockStatements
  style/noArguments
  a11y/useValidAriaValues
  suspicious/noGlobalAssign
  suspicious/noCommentText
  suspicious/noThenProperty
  suspicious/useGetterReturn
  style/useFragmentSyntax
  a11y/noPositiveTabindex
  style/useNamingConvention
  correctness/noRenderReturnValue
  correctness/useExhaustiveDependencies
  nursery/noSecrets
  security/noGlobalEval
  a11y/noRedundantRoles
  correctness/noUnusedVariables
  style/noYodaExpression
  suspicious/noSelfCompare
  suspicious/noAsyncPromiseExecutor
  nursery/noDescendingSpecificity
  nursery/noIrregularWhitespace
  security/noDangerouslySetInnerHtml
  style/useNodejsImportProtocol
  suspicious/noArrayIndexKey
  complexity/noWith
  suspicious/noDuplicateClassMembers
  complexity/noExtraBooleanCast
  performance/noAccumulatingSpread
  suspicious/noConfusingLabels
  correctness/noChildrenProp
  correctness/noUnknownFunction
  correctness/noInvalidPositionAtImportRule
  style/noShoutyConstants
  a11y/noAriaUnsupportedElements
  nursery/noCommonJs
  correctness/noFlatMapIdentity
  a11y/noBlankTarget
  a11y/useHeadingContent
  nursery/noDynamicNamespaceImportAccess
  correctness/useValidForDirection
  correctness/noInvalidUseBeforeDeclaration
  a11y/noAriaHiddenOnFocusable
  a11y/useGenericFontNames
  style/useBlockStatements
  correctness/noInvalidNewBuiltin
  style/noNegationElse
  complexity/useSimplifiedLogicExpression
  correctness/noUnusedFunctionParameters
  nursery/useSortedClasses
  style/noNamespaceImport
  style/noRestrictedGlobals
  correctness/noUndeclaredVariables
  nursery/noStaticElementInteractions
  nursery/useAriaPropsSupportedByRole
  nursery/useAdjacentOverloadSignatures
  style/noUnusedTemplateLiteral
  style/useExponentiationOperator
  suspicious/useAwait
  style/noNamespace
  suspicious/noDuplicateAtImportRules
  complexity/noUselessFragments
  performance/useTopLevelRegex
  complexity/noUselessStringConcat
  correctness/noUnusedImports
  suspicious/noEmptyBlock
  suspicious/noFunctionAssign
  performance/noDelete
  suspicious/noUnsafeNegation
  a11y/useValidLang
  suspicious/useValidTypeof
  a11y/useValidAriaRole
  correctness/noConstantCondition
  a11y/useAriaActivedescendantWithTabindex
  style/useExplicitLengthCheck
  style/useDefaultParameterLast
  complexity/noEmptyTypeParameters
  nursery/useComponentExportOnlyModules
  correctness/noUnknownProperty
  nursery/useTrimStartEnd
  complexity/noUselessTernary
  suspicious/noExplicitAny
  correctness/noSwitchDeclarations
  complexity/noUselessTypeConstraint
  suspicious/noRedundantUseStrict
  style/useLiteralEnumMembers
  suspicious/noGlobalIsNan
  suspicious/noSkippedTests
  suspicious/noMisleadingCharacterClass
  a11y/noLabelWithoutControl
  style/useDefaultSwitchClause
  correctness/noStringCaseMismatch
  suspicious/noRedeclare
  suspicious/noFallthroughSwitchClause
  complexity/noUselessThisAlias
  correctness/noUnreachable
  complexity/noThisInStatic
  complexity/useOptionalChain
  suspicious/noDuplicateCase
  style/noParameterAssign
  a11y/useValidAnchor
  complexity/useRegexLiterals
  correctness/noSelfAssign
  correctness/noInvalidBuiltinInstantiation
  nursery/noProcessEnv
  style/useShorthandFunctionType
  style/useSingleCaseStatement
  style/useThrowNewError
  suspicious/noEmptyBlockStatements
  suspicious/noShadowRestrictedNames
  a11y/useMediaCaption
  correctness/noUnsafeFinally
  style/useNodeAssertStrict
  style/useEnumInitializers
  a11y/useHtmlLang
  correctness/noUndeclaredDependencies
  suspicious/noEvolvingTypes
  style/useWhile
  suspicious/noConsole
  complexity/useArrowFunction
  style/noInferrableTypes
  a11y/noNoninteractiveTabindex
  complexity/useSimpleNumberKeys
  correctness/useYield
  style/useNumericLiterals
  suspicious/noImportAssign
  suspicious/useDefaultSwitchClauseLast
  correctness/noGlobalObjectCalls
  style/noParameterProperties
  a11y/useAltText
  performance/noBarrelFile
  suspicious/noSuspiciousSemicolonInJsx
  complexity/noBannedTypes
  suspicious/noPrototypeBuiltins
  style/useThrowOnlyError
  style/useAsConstAssertion
  suspicious/noDebugger
  suspicious/noMisleadingInstantiator
  complexity/noVoid
  nursery/noUnknownPseudoClass
  a11y/useFocusableInteractive
  correctness/noUnmatchableAnbSelector
  suspicious/noDuplicateJsxProps
  correctness/noEmptyPattern
  complexity/noExcessiveNestedTestSuites
  performance/noReExportAll
  a11y/useKeyWithMouseEvents
  security/noDangerouslySetInnerHtmlWithChildren
  suspicious/noExtraNonNullAssertion
  nursery/noUnknownPseudoElement
  suspicious/noShorthandPropertyOverrides
  style/useConst
  style/noNonNullAssertion
  complexity/useFlatMap
  correctness/useHookAtTopLevel
  correctness/useIsNan
  suspicious/noGlobalIsFinite
  style/useConsistentBuiltinInstantiation
  suspicious/noDuplicateFontNames
  complexity/noExcessiveCognitiveComplexity
  a11y/noDistractingElements
  nursery/useValidAutocomplete
  style/useConsistentArrayType
  style/useForOf
  nursery/useImportRestrictions
  nursery/useStrictMode
  a11y/useValidAriaProps
  a11y/noRedundantAlt
  complexity/useDateNow
  suspicious/noConfusingVoidType
  suspicious/noFocusedTests
  a11y/useButtonType
  a11y/useSemanticElements
  correctness/noInvalidGridAreas
  style/useFilenamingConvention
  style/useShorthandArrayType
  style/useShorthandAssign
  suspicious/useErrorMessage
  correctness/noConstantMathMinMaxClamp
  correctness/noUnusedPrivateClassMembers
  correctness/noVoidTypeReturn
  correctness/noUnknownMediaFeatureName
  nursery/noUselessEscapeInRegex
  a11y/useAnchorContent
  complexity/noUselessRename
  nursery/noSubstr
  style/useNumberNamespace
  complexity/noUselessConstructor
  a11y/noAccessKey
  complexity/noUselessSwitchCase
  style/noDefaultExport
  style/useSingleVarDeclarator
  suspicious/noExportsInTest
  suspicious/useNumberToFixedDigitsArgument
  a11y/noNoninteractiveElementToInteractiveRole
  nursery/noTemplateCurlyInString
  style/noCommaOperator
  suspicious/useIsArray
  nursery/useConsistentCurlyBraces
  correctness/noNewSymbol
  a11y/noHeaderScope
  suspicious/noMisrefactoredShorthandAssign
  complexity/noForEach
  suspicious/noClassAssign
  style/useImportType

Workspace:
  Open Documents:               0

Done in 0.32s.

Rule name

useConsistentMemberAccessibility

Playground link

https://biomejs.dev/playground/?indentStyle=space&quoteStyle=single&jsxQuoteStyle=single&lintRules=all&code=YwBsAGEAcwBzACAAQQBiAGMAIAB7AAoAIAAgAC8ALwAgACIATQBpAHMAcwBpAG4AZwAgAGEAYwBjAGUAcwBzAGkAYgBpAGwAaQB0AHkAIABtAG8AZABpAGYAaQBlAHIAIABvAG4AIAB0AGgAaQBzACAAbQBlAG0AYgBlAHIALgAiAAoAIAAgACMAcAByAGkAdgBhAHQAZQBfAHYAYQByAGkAYQBiAGwAZQA6ACAAcwB0AHIAaQBuAGcAOwAKAH0ACgAKAG4AZQB3ACAAQQBiAGMAKAApADsA

Expected result

Either # should be recognized as equivalent to private or there should be a way to skip the requirement for members with the # prefix.

This configuration can be used to trigger the issue.

{
  "linter": {
    "rules": {
      "nursery": {
        "useConsistentMemberAccessibility": {
          "level": "error",
          "options": {
              "accessibility": "explicit"
          }
        }
      }
    }
  }
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@profaurore profaurore added the S-Needs triage Status: this issue needs to be triaged label Oct 14, 2024
@Conaclos Conaclos self-assigned this Oct 14, 2024
@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 and removed S-Needs triage Status: this issue needs to be triaged labels Oct 14, 2024
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