aria-valid-attr
它能做什么
这项技能检查页面上每个 aria 属性名称是否真实且属于标准。适合手动编写无障碍标记的开发者。
适用场景
- ✓当你在 HTML 或模板中输入 aria 属性时。
- ✓当屏幕阅读器忽略了你添加的某个属性时。
- ✓当你审查他人编写的代码,检查其中的 ARIA 错误时。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-valid-attr/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在我网站的导航标记中找出拼写错误的 aria 属性,并加以修复。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会列出每个元素上使用的 aria 属性,并替换所有拼写错误或未在 WAI-ARIA 规范中定义的属性。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Ensure ARIA attributes are valid
Invalid ARIA attributes are ignored by browsers and screen readers, potentially leaving users with disabilities unable to navigate or understand the interface.
Quick Reference
- Use only valid, standard-defined ARIA attributes
- Avoid misspelled or non-existent aria-* properties
- Ensure screen readers correctly interpret element roles and states
Check
Identify any invalid or misspelled ARIA attributes on HTML elements.
Fix
Replace invalid ARIA attributes with their correct names as defined in the WAI-ARIA specification.
Explain
Explain how valid ARIA attributes enable assistive technologies to communicate element state and behavior to users.
Code Review
Review the rendered markup and interactive states that affect Ensure ARIA attributes are valid. 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-valid-attr
常见问题
无效的 ARIA 属性会怎样?
这项技能说明,浏览器和屏幕阅读器会忽略它,因此原本想提供的帮助不会到达用户。
正确的名称来自哪里?
这项技能以 WAI-ARIA 规范作为参考依据。
它也检查属性值吗?
不检查。属性值由单独的检查负责。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure ARIA attributes are valid. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2743
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。