Repository: biomejs/biome (language: rust)

Issue:
💅 Incorrect suggestion for <form role="search">
### Environment information

```bash
CLI:
  Version:                      1.9.3
  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:           "v21.5.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.1.30"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  false
  GraphQL enabled:              false
  Recommended:                  true
  All:                          false
  Enabled rules:
  performance/noDelete
  suspicious/noCatchAssign
  suspicious/noUnsafeNegation
  complexity/useLiteralKeys
  correctness/noUnusedImports
  suspicious/noClassAssign
  complexity/noMultipleSpacesInRegularExpressionLiterals
  a11y/useValidLang
  complexity/noUselessEmptyExport
  suspicious/useNamespaceKeyword
  suspicious/useValidTypeof
  a11y/useValidAriaRole
  correctness/noConstantCondition
  a11y/useAriaActivedescendantWithTabindex
  suspicious/noAssignInExpressions
  style/useDefaultParameterLast
  complexity/noEmptyTypeParameters
  correctness/noConstructorReturn
  style/useSelfClosingElements
  suspicious/noDuplicateParameters
  suspicious/noDuplicateSelectorsKeyframeBlock
  correctness/noUnknownProperty
  style/useTemplate
  correctness/noUnusedLabels
  complexity/noUselessTernary
  correctness/noUnreachableSuper
  suspicious/noCompareNegZero
  suspicious/noExplicitAny
  correctness/noSwitchDeclarations
  a11y/noAutofocus
  correctness/noUnsafeOptionalChaining
  correctness/noConstAssign
  suspicious/noControlCharactersInRegex
  complexity/noUselessTypeConstraint
  style/noVar
  suspicious/noDoubleEquals
  suspicious/noRedundantUseStrict
  style/useLiteralEnumMembers
  suspicious/noGlobalIsNan
  suspicious/noEmptyInterface
  suspicious/noConstEnum
  style/useImportType
  nursery/noDuplicateElseIf
  correctness/noPrecisionLoss
  nursery/noRestrictedImports
  suspicious/noMisleadingCharacterClass
  suspicious/noRedeclare
  correctness/noStringCaseMismatch
  correctness/noSetterReturn
  correctness/noInvalidConstructorSuper
  suspicious/noImplicitAnyLet
  suspicious/noDuplicateObjectKeys
  suspicious/noFallthroughSwitchClause
  complexity/noUselessThisAlias
  correctness/noUnreachable
  a11y/useKeyWithClickEvents
  suspicious/noUnsafeDeclarationMerging
  complexity/noThisInStatic
  complexity/useOptionalChain
  correctness/noInnerDeclarations
  style/noParameterAssign
  suspicious/noDuplicateCase
  a11y/useValidAnchor
  correctness/useArrayLiterals
  complexity/useRegexLiterals
  correctness/noSelfAssign
  correctness/noInvalidBuiltinInstantiation
  style/noUselessElse
  style/useShorthandFunctionType
  suspicious/noShadowRestrictedNames
  correctness/noInvalidDirectionInLinearGradient
  suspicious/noEmptyBlockStatements
  suspicious/noImportantInKeyframe
  a11y/useMediaCaption
  complexity/noUselessLabel
  complexity/noUselessCatch
  correctness/noUnsafeFinally
  a11y/useAriaPropsForRole
  correctness/noNonoctalDecimalEscape
  style/useEnumInitializers
  a11y/useHtmlLang
  suspicious/noDuplicateTestHooks
  complexity/noStaticOnlyClass
  style/useWhile
  complexity/useArrowFunction
  style/noInferrableTypes
  a11y/noNoninteractiveTabindex
  complexity/useSimpleNumberKeys
  correctness/useYield
  a11y/noInteractiveElementToNoninteractiveRole
  style/useNumericLiterals
  correctness/noUnnecessaryContinue
  suspicious/noApproximativeNumericConstant
  suspicious/noImportAssign
  suspicious/noLabelVar
  correctness/noGlobalObjectCalls
  suspicious/useDefaultSwitchClauseLast
  correctness/noEmptyCharacterClassInRegex
  correctness/noUnknownUnit
  a11y/useAltText
  suspicious/noSuspiciousSemicolonInJsx
  a11y/useIframeTitle
  complexity/noBannedTypes
  a11y/noSvgWithoutTitle
  correctness/noVoidElementsWithChildren
  style/useAsConstAssertion
  correctness/useJsxKeyInIterable
  style/useExportType
  complexity/noUselessLoneBlockStatements
  suspicious/noDebugger
  style/noArguments
  a11y/useValidAriaValues
  suspicious/noCommentText
  a11y/useFocusableInteractive
  correctness/noUnmatchableAnbSelector
  suspicious/noGlobalAssign
  suspicious/noDuplicateJsxProps
  suspicious/noMisleadingInstantiator
  a11y/noPositiveTabindex
  correctness/noEmptyPattern
  complexity/noExcessiveNestedTestSuites
  security/noDangerouslySetInnerHtmlWithChildren
  a11y/useKeyWithMouseEvents
  suspicious/noExtraNonNullAssertion
  suspicious/noShorthandPropertyOverrides
  correctness/noRenderReturnValue
  correctness/useExhaustiveDependencies
  security/noGlobalEval
  style/noNonNullAssertion
  a11y/noRedundantRoles
  complexity/useFlatMap
  correctness/noUnusedVariables
  correctness/useHookAtTopLevel
  correctness/useIsNan
  style/useConst
  suspicious/noGlobalIsFinite
  suspicious/noAsyncPromiseExecutor
  suspicious/noDuplicateFontNames
  suspicious/noSelfCompare
  suspicious/noThenProperty
  security/noDangerouslySetInnerHtml
  style/useNodejsImportProtocol
  a11y/noDistractingElements
  suspicious/noArrayIndexKey
  complexity/noWith
  suspicious/useGetterReturn
  suspicious/noDuplicateClassMembers
  complexity/noExtraBooleanCast
  performance/noAccumulatingSpread
  a11y/useValidAriaProps
  a11y/noRedundantAlt
  correctness/noChildrenProp
  correctness/noUnknownFunction
  correctness/noInvalidPositionAtImportRule
  suspicious/noConfusingLabels
  suspicious/noPrototypeBuiltins
  suspicious/noConfusingVoidType
  suspicious/noFocusedTests
  a11y/useButtonType
  a11y/useSemanticElements
  a11y/noAriaUnsupportedElements
  correctness/noInvalidGridAreas
  correctness/noFlatMapIdentity
  a11y/noBlankTarget
  a11y/useHeadingContent
  suspicious/noSparseArray
  correctness/noConstantMathMinMaxClamp
  correctness/useValidForDirection
  correctness/noUnusedPrivateClassMembers
  correctness/noVoidTypeReturn
  correctness/noInvalidUseBeforeDeclaration
  a11y/noAriaHiddenOnFocusable
  a11y/useGenericFontNames
  correctness/noUnknownMediaFeatureName
  a11y/useAnchorContent
  complexity/noUselessRename
  correctness/noInvalidNewBuiltin
  style/useNumberNamespace
  complexity/noUselessConstructor
  a11y/noAccessKey
  correctness/noUnusedFunctionParameters
  style/noUnusedTemplateLiteral
  complexity/noUselessSwitchCase
  style/useExponentiationOperator
  correctness/noUndeclaredVariables
  style/useSingleVarDeclarator
  suspicious/noExportsInTest
  a11y/noNoninteractiveElementToInteractiveRole
  style/noCommaOperator
  suspicious/noDuplicateAtImportRules
  suspicious/useIsArray
  a11y/noHeaderScope
  complexity/noUselessFragments
  suspicious/noMisrefactoredShorthandAssign
  suspicious/noEmptyBlock
  correctness/noNewSymbol
  complexity/noForEach
  suspicious/noFunctionAssign

Workspace:
  Open Documents:               0
```


### Rule name

lint/a11y/useSemanticElements

### Playground link

https://biomejs.dev/playground/?code=PABmAG8AcgBtACAAaQBkAD0AIgBzAGUAYQByAGMAaAAiACAAcgBvAGwAZQA9ACIAcwBlAGEAcgBjAGgAIgA%2BAAoAIAAgADwAbABhAGIAZQBsACAAZgBvAHIAPQAiAHMAZQBhAHIAYwBoAC0AaQBuAHAAdQB0ACIAPgBTAGUAYQByAGMAaAAgAHQAaABpAHMAIABzAGkAdABlADwALwBsAGEAYgBlAGwAPgAKACAAIAA8AGkAbgBwAHUAdAAgAHQAeQBwAGUAPQAiAHMAZQBhAHIAYwBoACIAIABpAGQAPQAiAHMAZQBhAHIAYwBoAC0AaQBuAHAAdQB0ACIAIABuAGEAbQBlAD0AIgBzAGUAYQByAGMAaAAiACAAcwBwAGUAbABsAGMAaABlAGMAawA9ACIAZgBhAGwAcwBlACIAIAAvAD4ACgAgACAAPABpAG4AcAB1AHQAIAB2AGEAbAB1AGUAPQAiAFMAdQBiAG0AaQB0ACIAIAB0AHkAcABlAD0AIgBzAHUAYgBtAGkAdAAiACAALwA%2BAAoAPAAvAGYAbwByAG0APgA%3D

### Expected result

Using `<form role="search">` throws an error saying that we should instead use `<input type="search">`. However, according to MDN's [ARIA: search role](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/search_role) documentation:

> The search role is [a landmark](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles#3._landmark_roles) role that can be added to the container element that encompasses all of the elements that combined to form the search feature of the document or application, including a descendant [(`<input type="search">`)](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search). ... There is a [input of type search)](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search), though this does not define a search landmark by itself. Using [<search>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search) is an alternative way to define a search landmark.

and they provide an example recommending using the "search" role on a "form":

> When a [`<form>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form) is a search form, use the `search` role instead of [`form`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/form_role) role.
> 
> ```html
> <form id="search" role="search">
>   <label for="search-input">Search this site</label>
>   <input type="search" id="search-input" name="search" spellcheck="false">
>   <input value="Submit" type="submit">
> </form>
> ```

They do recommend an alternative, using `<search>` as the landmark instead, which might be a better error message for this case, so the way to fix the above example might be:

```html
<search>
  <form id="search">
    <label for="search-input">Search this site</label>
    <input type="search" id="search-input" name="search" spellcheck="false">
    <input value="Submit" type="submit">
  </form>
</search>
```

### Code of Conduct

- [X] I agree to follow Biome's Code of Conduct


Discussion / hints:
Correct; this is probably just a typo. [role="search"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/search_role) (landmark) is different from [role="searchbox"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/searchbox_role) (`<input type="search">`).

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0b04f68dd6f1..f97e3eed9915 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b
 
 ## Unreleased
 
+- Fix [#4323](https://github.com/biomejs/biome/issues/4258), where `lint/a11y/useSemanticElement` accidentally showed recommendations for `role="searchbox"` instead of `role="search"`
+
 ### Analyzer
 
 #### Bug fixes
diff --git a/crates/biome_aria/src/roles.rs b/crates/biome_aria/src/roles.rs
index 3ee36918df62..d4dfcd86e307 100644
--- a/crates/biome_aria/src/roles.rs
+++ b/crates/biome_aria/src/roles.rs
@@ -1338,7 +1338,7 @@ impl<'a> AriaRoles {
             "row" => &RowRole as &dyn AriaRoleDefinitionWithConcepts,
             "rowgroup" => &RowGroupRole as &dyn AriaRoleDefinitionWithConcepts,
             "rowheader" => &RowHeaderRole as &dyn AriaRoleDefinitionWithConcepts,
-            "search" => &SearchboxRole as &dyn AriaRoleDefinitionWithConcepts,
+            "search" => &SearchRole as &dyn AriaRoleDefinitionWithConcepts,
             "searchbox" => &SearchboxRole as &dyn AriaRoleDefinitionWithConcepts,
             "table" => &TableRole as &dyn AriaRoleDefinitionWithConcepts,
             "term" => &TermRole as &dyn AriaRoleDefinitionWithConcepts,


Test patch:
diff --git a/crates/biome_js_analyze/tests/specs/a11y/useSemanticElements/invalid.jsx.snap b/crates/biome_js_analyze/tests/specs/a11y/useSemanticElements/invalid.jsx.snap
index f5b8d2d44dab..143f131547dd 100644
--- a/crates/biome_js_analyze/tests/specs/a11y/useSemanticElements/invalid.jsx.snap
+++ b/crates/biome_js_analyze/tests/specs/a11y/useSemanticElements/invalid.jsx.snap
@@ -585,7 +585,7 @@ invalid.jsx:28:10 lint/a11y/useSemanticElements ━━━━━━━━━━
 invalid.jsx:29:10 lint/a11y/useSemanticElements ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 
   ! The elements with the following roles can be changed to the following elements:
-    <input type="search">
+    <search>
   
   
     27 │     <div role="rowgroup" ></div>