aria-deprecated-role
它能做什么
这项技能找出过时的或不应在 HTML 中使用的 ARIA 角色。适合希望标记代码能在各种浏览器和辅助工具中良好运行的开发者。
适用场景
- ✓当你在代码中发现 directory 这样的角色时。
- ✓当你要把旧的标记更新到当前的无障碍标准时。
- ✓当原生 HTML 元素可以替代自定义角色时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-deprecated-role/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我的模板中搜索旧的 ARIA 角色,并告诉我应该改用什么。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在标记中搜索已弃用或抽象的角色,并将其替换为当前的角色,或更简单的原生 HTML 元素。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid using deprecated ARIA roles
Using deprecated roles can lead to inconsistent behavior across different browsers and screen readers as they transition to newer standards.
Quick Reference
- Deprecated ARIA roles should be replaced with modern equivalents
- Browsers may drop support for deprecated roles in future versions
- Ensures long-term compatibility with assistive technologies
Check
Search the codebase for deprecated ARIA roles like directory or abstract roles that shouldn't be used in HTML.
Fix
Update deprecated ARIA roles to their modern recommended equivalents or use native HTML elements.
Explain
Explain the risks of using deprecated ARIA roles and the benefits of moving to modern ARIA standards.
Code Review
Review the rendered markup and interactive states that affect Avoid using deprecated ARIA roles. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/aria-deprecated-role
常见问题
为什么已弃用的角色是个问题?
这项技能说明,浏览器和屏幕阅读器对它们的处理可能不一致,之后也可能不再支持。
什么是抽象角色?
这项技能指出,抽象角色仅用于规范说明,不应出现在 HTML 中。
有比 ARIA 更简单的选择吗?
有。这项技能建议,只要原生 HTML 元素能完成同样的工作,就优先使用它。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid using deprecated ARIA roles. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2725
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。