Skip to content

feat: add configurable accessibility presets#57

Open
mrharispe wants to merge 2 commits intomillionco:mainfrom
mrharispe:feat/accessibility-presets
Open

feat: add configurable accessibility presets#57
mrharispe wants to merge 2 commits intomillionco:mainfrom
mrharispe:feat/accessibility-presets

Conversation

@mrharispe
Copy link

@mrharispe mrharispe commented Feb 19, 2026

Summary

Adds configurable accessibility presets for jsx-a11y rules, allowing users to choose the level of accessibility linting that fits their project.

Motivation

Previously, react-doctor included a fixed set of 15 accessibility rules. This PR enables users to choose from three presets based on their accessibility requirements:

Preset Rules Description
minimal (default) 15 Curated high-impact rules (original behavior)
recommended 31 Matches jsx-a11y/recommended preset
strict 33 Matches jsx-a11y/strict preset (all rules as errors)

Users can also disable accessibility checks entirely by setting accessibility: false.

Usage

Via config file (react-doctor.config.json)

{
  "accessibility": "recommended"
}

Via package.json

{
  "reactDoctor": {
    "accessibility": "strict"
  }
}

Programmatically

import { diagnose } from "react-doctor";

const result = await diagnose("/path/to/project", {
  accessibility: "recommended"
});

Changes

  • Added AccessibilityPreset type ("minimal" | "recommended" | "strict")
  • Added accessibility field to ReactDoctorConfig and DiagnoseOptions
  • Created preset rule sets in oxlint-config.ts
  • Updated runOxlint, diagnose, and scan to pass accessibility preset
  • Added 12 unit tests for the new configuration
  • Updated README to include the accessibility option

Testing

All 137 tests pass, including new tests covering:

  • Plugin inclusion/exclusion based on preset
  • Correct rule counts per preset (15, 31, 33)
  • Severity differences between recommended (warn) and strict (error)
  • Disabling accessibility with false

@vercel
Copy link

vercel bot commented Feb 19, 2026

Someone is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

Add accessibility option with three presets:
- minimal (default): 15 curated high-impact rules
- recommended: matches jsx-a11y/recommended preset (31 rules)
- strict: matches jsx-a11y/strict preset (33 rules, all as errors)

Can be disabled with `accessibility: false`.
@mrharispe mrharispe force-pushed the feat/accessibility-presets branch from ce65144 to 81fa830 Compare February 21, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant