accessibility-scan

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Audit a live page and report each violation and where it is. Locate; don't fix.
Shared grounding and honesty conventions:
../shared/methodology.md
.
$ARGUMENTS
is a URL, a config target name (
dev
,
storybook
, …), or empty to audit the default target from
accesslint.config.json
. If it's empty and no config exists, ask for a URL or suggest
npx @accesslint/cli init
.
检测在线页面并报告每个违规问题及其位置。仅定位问题,不修复。
通用准则与诚信规范:
../shared/methodology.md
$ARGUMENTS
可以是URL、配置目标名称(如
dev
storybook
等),或留空以检测
accesslint.config.json
中的默认目标。若留空且无配置文件,则会要求输入URL或建议执行
npx @accesslint/cli init

1. Audit

1. 检测

bash
PORT=$(npx -y @accesslint/chrome@latest ensure | node -e 'process.stdin.on("data",d=>process.stdout.write(""+JSON.parse(d).port))')
npx -y @accesslint/cli@latest scan <target> --port "$PORT" --format json
<target>
is the URL or config target name from
$ARGUMENTS
. Omit it (don't pass
""
) to audit the config's default target. Add flags as needed:
--selector
,
--wait-for "<selector>"
,
--include-aaa
,
--disable <rules>
, or pin them per-target in
accesslint.config.json
.
bash
PORT=$(npx -y @accesslint/chrome@latest ensure | node -e 'process.stdin.on("data",d=>process.stdout.write(""+JSON.parse(d).port))')
npx -y @accesslint/cli@latest scan <target> --port "$PORT" --format json
<target>
$ARGUMENTS
中的URL或配置目标名称。可省略该参数(不要传入
""
)以检测配置中的默认目标。可根据需要添加参数:
--selector
--wait-for "<selector>"
--include-aaa
--disable <rules>
,或在
accesslint.config.json
中为每个目标固定这些参数。

2. Report

2. 报告

Counts by impact, then one entry per violation:
  • where: selector verbatim, plus
    file:line (symbol)
    if
    source
    is present. Don't fabricate. If no violation has
    source
    , note "source mapping unavailable; located by selector only".
  • evidence: contrast ratio, missing attribute, empty name.
  • fix: mechanical change, or
    NEEDS HUMAN
    .
Don't edit. For fixes, apply the mechanical ones and re-run to verify; for bulk work hand off to
accesslint:accessibility-fix
.
按影响程度统计,然后每个违规问题对应一条记录:
  • 位置:直接显示选择器,若存在
    source
    则额外显示
    file:line (symbol)
    。请勿编造信息。若所有违规问题均无
    source
    ,需注明「源映射不可用;仅通过选择器定位」。
  • 证据:对比度、缺失属性、空名称等。
  • 修复方案:自动修复建议,或标记为
    NEEDS HUMAN
    (需人工处理)。
请勿编辑内容。对于可自动修复的问题,应用修复后重新运行检测以验证;批量修复工作可移交至
accesslint:accessibility-fix
处理。

3. Tear down

3. 清理

bash
npx -y @accesslint/chrome@latest stop --all  # skip if ensure reported "managed":false
bash
npx -y @accesslint/chrome@latest stop --all  # 若ensure返回"managed":false则可跳过此步骤

Notes

注意事项

  • ensure
    determines the port; don't hardcode 9222.
  • CLI exit 2 means a bad URL or target, or the page never loaded; check the dev server. An unknown target name makes the CLI list the available targets from
    accesslint.config.json
    .
  • 端口由
    ensure
    命令确定;请勿硬编码9222。
  • CLI退出码为2表示URL或目标无效,或页面未加载;请检查开发服务器。若目标名称未知,CLI会列出
    accesslint.config.json
    中的可用目标。