Skip to content

Conversation

@sidhsharma1992
Copy link
Collaborator

@sidhsharma1992 sidhsharma1992 commented Sep 22, 2025

This PR implements comprehensive auto-fix functionality across multiple FluentUI accessibility rules, enabling developers to automatically resolve common accessibility issues with eslint --fix. The enhancement significantly improves developer experience while teaching proper accessibility patterns.

🚀 Key Features
Enhanced Rule Factory with Auto-Fix Support
4 Auto-fix Strategies:
aria-label-placeholder: Adds aria-label="" for developer completion
aria-label-suggestion: Provides contextual label suggestions
add-required-prop: Adds missing required properties with defaults
custom: Supports complex custom fix logic
Backward Compatible: Existing rules continue working unchanged
Type Safe: Full TypeScript support with proper type definitions

Rules Enhanced with Auto-Fix

InfoLabel → Adds aria-label="Info"
MenuButton → Adds aria-label="Open menu"
Card → Adds aria-label="Card"
Image → Adds alt="" placeholder
Spinner → Adds complete ARIA live region pattern:

  • aria-label="Loading"
  • aria-live="polite"
  • aria-busy="true"

ProgressBar → Adds full ARIA progressbar pattern:

  • aria-label="Progress"
  • aria-describedby=""
  • aria-valuemin="0"
  • aria-valuemax="100"
  • aria-valuenow="0"

Auto-fix all accessibility issues

npx eslint --fix src/

Fix specific files

npx eslint --fix src/components/InfoLabel.tsx

@sidhsharma1992 sidhsharma1992 linked an issue Sep 22, 2025 that may be closed by this pull request
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.

Auto-fix capabilities for multiple high-value rules

3 participants