> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-access-key

[Added in v0.5.3](https://github.com/web-infra-dev/rslint/releases/tag/v0.5.3)
## Configuration

| Preset                              | Configured Value |
| ----------------------------------- | ---------------- |
| ✅ jsxA11yPlugin.configs.recommended | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, jsxA11yPlugin } from '@rslint/core';

export default defineConfig([
  jsxA11yPlugin.configs.recommended,
  {
    rules: {
      'jsx-a11y/no-access-key': 'error',
    },
  },
]);
```

## Rule Details

This rule disallows the `accessKey` prop on JSX elements. The attribute
name is matched case-insensitively, so `accesskey`, `accessKey`, and
`acCesSKeY` are all checked. Access-key shortcuts assigned through this
prop frequently conflict with the keyboard commands used by screen
readers and keyboard-only users, causing accessibility regressions.

The rule reports an element whenever it carries an `accessKey` attribute
whose value resolves to a truthy JavaScript value. An attribute whose
value is `undefined`, `null`, `false`, `0`, or the empty string is left
alone.

This rule takes no arguments.

Examples of **incorrect** code for this rule:

```jsx
<div accessKey="h" />
<div accesskey="h" />
<div accessKey="h" {...props} />
<div acCesSKeY="y" />
<div accessKey={"y"} />
<div accessKey={`${y}`} />
<div accessKey={accessKey} />
```

Examples of **correct** code for this rule:

```jsx
<div />
<div {...props} />
<div accessKey={undefined} />
```

## Resources

- [WebAIM — Keyboard Accessibility: Accesskey](https://webaim.org/techniques/keyboard/accesskey#spec)

## Original Documentation

- [eslint-plugin-jsx-a11y: no-access-key](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/v6.10.2/docs/rules/no-access-key.md)
- [Source code](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/v6.10.2/src/rules/no-access-key.js)
