biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.6k stars 486 forks source link

🐛 a11y/noNoninteractiveElementToInteractiveRole doesn't support rule options #4635

Closed Excalibaard closed 3 days ago

Excalibaard commented 4 days ago

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:           "v20.12.2"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.14.2"

Biome Configuration:
  Error:                        options has an incorrect type, expected no value, but received an object.
  Status:                       Loaded with errors
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

What happened?

  1. Set "linter.rules.recommended: false" in the Biome config JSON.
  2. Set the following value for "linter.rules.a11y.noNoninteractiveElementToInteractiveRole":
    {
    "level": "error",
    "options": {
    "ul": ["listbox"]
    }
    }
  3. The Biome config is considered invalid, because property 'options' is not allowed and options has an incorrect type, expected no value, but received an object.

Expected result

I expect to be able set options for the rule, as described by the rule source.

In this case, specifically to whitelist the "listbox" role on non-interactive ul elements, which follows ARIA's listbox example implementation, and is part of the recommended options for this rule in the rule source.

Code of Conduct