Skip to content

docs(config): point example rule options at real rule ids and options #478 - #498

Merged
nc9 merged 1 commit into
mainfrom
fix/docs-478
Oct 6, 2026
Merged

nc9 merged 1 commit into
mainfrom
fix/docs-478

Conversation

@nc9

@nc9 nc9 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Closes #478

Cause

docs/configuration/examples.mdx set rule options under ids and keys that no rule reads. Options are looked up by exact rule id (getRuleOptions in packages/rules/src/runner.ts) and parsed by the rule's zod optionsSchema, which drops unknown keys without a word, so every one of these was a silent no-op. docs/quickstart.mdx showed --rule-include ax,performance, which the CLI rejects before crawling.

Fix

docs/configuration/examples.mdx:

  • performance/* → perf/*; performance/cls-hints → perf/cls-hints
  • [rule_options."performance/ttfb"] → perf/ttfb, with warn_threshold/error_threshold → good_threshold/poor_threshold (the rule warns at good_threshold and fails at poor_threshold, so each example keeps its numbers)
  • [rule_options."performance/dom-size"] → perf/dom-size (its keys were already right)
  • content/article-links: min_external_links = N → short_min_external, medium_min_external, long_min_external all = N
  • links/orphan-pages, links/dead-end-pages: exclude_patterns → excludePatterns
  • content/keyword-stuffing: density_threshold = 0.05 → 5. It is a percentage (default 3), so 0.05 meant 0.05% and made the docs example stricter, the opposite of its comment. (Found by the codex pass.)
  • Removed content/quality from a disable list. It is disabled: true in code and never loads.

docs/quickstart.mdx: --rule-include ax,performance → ax,perf.

Proof

Every TOML block on the page was parsed and checked against the rule registry and each rule's optionsSchema with a scratch script (smol-toml, loadAllRules, matchesRulePattern):

before: 15 toml blocks, 15 problem(s)
  block 3: rules.enable "performance/*" matches no rule
  block 4: rule_options."performance/ttfb" names no rule
  block 0: rule_options."content/article-links".min_external_links is not an option
  block 0: rule_options."links/orphan-pages".exclude_patterns is not an option (has: minInboundLinks, excludePatterns)
  ...
after:  15 toml blocks, 0 problem(s)

CLI from source, against a local fixture:

$ squirrel audit http://127.0.0.1:18474/ --rule-include ax,performance --http --offline -m 1
--rule-include "performance": unknown category. Valid categories: crawl, core, security, integrity, links, content, schema, images, perf, ...

$ squirrel audit http://127.0.0.1:18474/ --rule-include ax,perf --http --offline -m 1 -f json -o q.json
score.groups: performance (25 checks), ai (2 checks); issue rule ids: ax/*, perf/* only

The "Performance audit" example, run as squirrel.toml (output format switched to json) against a page of about 1,200 elements, which sits between the example's warn_threshold = 1000 and the default 1,500:

before (performance/dom-size): perf/dom-size checks reported: dom-max-children only
after  (perf/dom-size):        perf/dom-size checks reported: dom-max-children, dom-total-nodes "Large DOM (1208 nodes)" (warn)

bun x [email protected] check --strict passes.

Left open

Running the same check over every docs page turned up the same problems in docs/configuration/rule-options.mdx (options reference) and an unsupported core/og-* pattern in docs/configuration/rules.mdx. Filed as #496 rather than widening this XS fix.

Changelog suggestion

  • Docs: the configuration examples now use real rule ids and option names (perf/ttfb, good_threshold, excludePatterns, ...), so copying them actually changes the audit.

…478

The configuration examples set options under ids and keys no rule reads, so
copying them changed nothing: performance/* is perf/*, ttfb takes
good_threshold/poor_threshold, article-links has per-length external minimums,
orphan-pages and dead-end-pages read excludePatterns, keyword-stuffing's
density_threshold is a percentage, and content/quality is disabled in code.
The quickstart's --rule-include ax,performance failed with an unknown
category; it is ax,perf.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 marked this pull request as ready for review October 6, 2026 13:11
@nc9
nc9 merged commit 2bf3e5c into main Oct 6, 2026
14 checks passed
@nc9
nc9 deleted the fix/docs-478 branch October 6, 2026 13:12
@nc9 nc9 mentioned this pull request Oct 6, 2026
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.

docs: configuration examples set rule_options under ids that match no rule (performance/*)

1 participant