# htmlhint attr-lowercase error breaks aria attribute parsing - how to fix it

## TL;DR

Lowercase all attribute names: ARIA-LABEL or Aria-Label in HTML source fails the attr-lowercase rule and risks inconsistent parsing. HTML attributes are case-insensitive in parsing but the ecosystem expects lowercase. One line of why: mixed-case attributes break tooling assumptions and XHTML-style strict parsing, and consistency is free.

## The error, verbatim

```text
   L45 | div element with ARIA-LABEL="Close menu"
         ^ The attribute name of [ ARIA-LABEL ] must be in lowercase

```

## Fix it step by step

### Step 1: Reproduce on one file

```bash
npx htmlhint --rules attr-lowercase=true src/index.html
```

Expected: HTMLHint prints the attr-lowercase error with the offending attribute.

### Step 2: Find every uppercase attribute

```bash
npx htmlhint --rules attr-lowercase=true 'src/**/*.html' | rg 'attr-lowercase' | head -20
```

Expected: Full list of mixed-case attributes.

### Step 3: Lowercase them

```bash
rg -n 'ARIA-|Aria-' src --glob '*.html' | head -20
```

Expected: Shows the offending attributes to fix.

### Step 4: Fix and re-lint

```bash
npx htmlhint --rules attr-lowercase=true 'src/**/*.html' | rg -c 'attr-lowercase' || echo 0
```

Expected: Prints 0. Attributes are consistently lowercase.

### Step 5: Enforce it in CI

```bash
npx eslint src --max-warnings 0 | tail -3
```

Expected: Clean output; add the lint command to CI with max-warnings 0 so the violation cannot come back.

## When to use this skill

- Your linter output names this exact jsx-a11y / a11y rule
- You want the violation fixed at author time so it never reaches axe or CI
- You are adding the rule to a shared eslint config and need the fix pattern

## When NOT to use this skill

- The failure comes from axe-core or lighthouse at runtime, not from lint
- You plan to disable the rule project-wide, this skill shows the fix, not the escape hatch

## Compatibility

HTMLHint 1.1+ with the attr-lowercase rule enabled. Relevant for plain HTML templates and server-rendered markup. Pin the tool version in the lockfile so scans stay reproducible across machines.

## Variant phrasings

### attribute name must be in lowercase

The default message, same fix.

### htmlhint uppercase aria attribute

The common shape: ARIA-LABEL pasted from a design tool.

### the rule fires in the editor too

With the eslint extension installed, the same error appears inline while typing; the fix is identical.

## Why it happens

HTML parsers lowercase attribute names before processing, so ARIA-LABEL technically works in browsers, but the inconsistency breaks string-based tooling, test selectors, and strict XML pipelines. It usually arrives via copy-paste from design tools or CMS editors that uppercase attributes. The htmlhint rule enforces the lowercase convention the whole ecosystem assumes. Linter rules catch the violation at author time, which is cheaper than any runtime fix. When this rule fires across many files, fix the shared component and mention it in team onboarding so new code does not reintroduce it.

## Edge cases

- In JSX, attribute names are case-sensitive and different rules apply, this skill is for plain HTML templates.
- Vue templates allow some uppercase in component props, but native HTML attributes including aria-* should stay lowercase.
- Run the fixer across templates once, then keep the rule on so it never regresses.
- After fixing, run the whole lint suite once; a11y rules interact and one fix can surface the next violation.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_c_eL-cRZak4Z1L3AITnf4g
