Skip to content

linter: role "option" have aria-posinset property, but excluded in oxlint #19950

@Sayakie

Description

@Sayakie

What version of Oxlint are you using?

1.50.0

What command did you run?

bunx oxlint -c .oxlintrc.json packages/ui-components/src/components/search-dialog/index.tsx

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

// Replace this with your actual config file contents.
// It can be helpful to keep it minimal, if possible, but please ensure that it actually reproduces the issue you're reporting.
{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "ignorePatterns": ["dist", "node_modules"],
  "env": {
    "node": true,
    "commonjs": true,
    "es2023": true
  },
  "rules": {
    "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
    "sort-keys": ["error", "asc", { "allowLineSeparatedGroups": true }],
    "eqeqeq": ["error", "smart"],
    "no-console": "error",
    "no-param-reassign": "error",
    "no-unused-vars": [
      "error",
      {
        "ignoreRestSiblings": true,
        "argsIgnorePattern": "^_",
        "varsIgnorePattern": "^_"
      }
    ],
    "no-undef": "error",
    "no-inline-comments": ["error", { "ignorePattern": "^!.*" }],
    "no-void": "off",
    "max-statements": ["error", { "max": 18 }],
    "@typescript-eslint/consistent-type-imports": "error",
    "@typescript-eslint/adjacent-overload-signatures": "error",
    "@typescript-eslint/array-type": "error",
    "@typescript-eslint/ban-tslint-comment": "error",
    "typescript/no-empty-object-type": "warn",
    "@typescript-eslint/consistent-generic-constructors": "error",
    "@typescript-eslint/consistent-indexed-object-style": "error",
    "@typescript-eslint/consistent-type-definitions": "error",
    "@typescript-eslint/no-confusing-non-null-assertion": "error",
    "@typescript-eslint/no-empty-function": "off",
    "@typescript-eslint/no-inferrable-types": "off",
    "@typescript-eslint/prefer-for-of": "error",
    "@typescript-eslint/prefer-function-type": "error"
  },
  "overrides": [
    {
      "files": ["**/*.{ts,tsx}"],
      "rules": {
        "no-unused-vars": "off",
        "no-unused-expressions": "off",
        "no-undef": "off",
        "@typescript-eslint/no-unused-vars": [
          "error",
          {
            "ignoreRestSiblings": true,
            "argsIgnorePattern": "^_",
            "varsIgnorePattern": "^_",
            "caughtErrorsIgnorePattern": "^_"
          }
        ],
        "@typescript-eslint/no-unused-expressions": [
          "error",
          {
            "allowShortCircuit": true,
            "allowTernary": true,
            "allowTaggedTemplates": true
          }
        ]
      }
    },
    {
      "files": ["**/*.js"],
      "rules": {
        "no-inline-comments": ["error", { "ignorePattern": "(?:@type|!)\\s.*" }]
      }
    }
  ],
  "extends": [
    "./node_modules/ultracite/config/oxlint/core/.oxlintrc.json",
    "./node_modules/ultracite/config/oxlint/react/.oxlintrc.json",
    "./node_modules/ultracite/config/oxlint/next/.oxlintrc.json"
  ]
}

What happened?

WAI-ARIA 1.3 describes a role "option" supports aria-posinset and MDN docs also do but oxlint threw following error:

  × eslint-plugin-jsx-a11y(role-supports-aria-props): The attribute `aria-posinset` is not supported by the role `option`.
     ╭─[packages/ui-components/src/components/search-dialog/index.tsx:307:7]
 306 │       aria-setsize={ariaSetsize}
 307 │       aria-posinset={ariaPosinset}
     ·       ────────────────────────────
 308 │       className={styles["search-dialog-item"]}
     ╰────
  help: Try to remove invalid attribute `aria-posinset`.

See WAI-ARIA 1.3 and MDN docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions