Accessibility

autocomplete-attribute

Require autocomplete on identity and payment form fields.

Flags identity, address, and payment inputs that lack an autocomplete attribute. The rule protects autofill UX (a power-user expectation) and the WCAG criterion that browsers rely on autocomplete to assist cognitively-impaired users.

Behavior

  • Fixable: No.
  • Suggestions: Yes — proposes the correct autocomplete value per input.
  • Maps to: WCAG 1.3.5 (Identify Input Purpose).

Examples

Bad:

<input type="email" name="email" />

Good:

<input type="email" name="email" autoComplete="email" />

Related rules

Use it

Enable autocomplete-attribute in your eslint.config.js:

import deslint from '@deslint/eslint-plugin';

export default [
  {
    plugins: { deslint },
    rules: {
      'deslint/autocomplete-attribute': 'error',
    },
  },
];

Found a false positive? Report it on GitHub →

Back to all rules