Repository navigation
docs(config): document the rule options rules actually read #496 - #513
Merged
Merged
Conversation
nc9
marked this pull request as ready for review
October 6, 2026 23:33
The rule-options reference configured keys no rule reads (min_external_links,
exclude_patterns, lists, required, threshold, allow_*), rule ids that do not
exist (performance/ttfb, performance/dom-size) and a fractional keyword density
the rule reads as a percent. Every table now names a real rule id and only
options it reads, verified against each optionsSchema and by audits run from
source.
Also: URL patterns have no globs ("/lp/*" matched nothing), config validate
does not check rule options, core/og-* matches no rule, and content/quality and
ai/ai-content never load, so their disable entries are gone. cli/init shows the
config squirrel init writes today.
Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
docs/rule-options-496
branch
from
October 6, 2026 23:36
ab3fcf7 to
ca9ad87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #496
Cause
docs/configuration/rule-options.mdxconfigured options no rule reads, so copying them changed nothing. Rule options are looked up by exact rule id (getRuleOptionsinpackages/rules/src/runner.ts), and each rule's zodoptionsSchemadrops keys it does not know, without a warning. A few other pages had disable entries and a pattern that match nothing.Fix
configuration/rule-options.mdx, every table checked against the rule'soptionsSchema(or its raw option reads):content/article-links:min_external_links→ the realshort_/medium_/long_min_external,*_min_internal,short_max_words,long_min_words. The page also says the rule only runs on article pages.links/orphan-pages,links/dead-end-pages:exclude_patterns→excludePatterns, plus the options they also read (minInboundLinks,minLinks,countAnchorLinks). It notes that setting dead-end'sexcludePatternsreplaces its five defaults.performance/ttfb,performance/dom-size→perf/ttfb(good_threshold/poor_threshold) andperf/dom-size(plusmax_depth,max_children).content/keyword-stuffing:min_word_count→min_occurrencesandwhitelist.density_thresholdis a percent (default3), not0.03. The density section now says how words are counted.security/http-to-https:allow_localhost/allow_patterns→sampleLimit. The section now describes what the rule does (it probeshttp://URLs for a redirect).adblock/element-hiding,adblock/blocked-links:listsremoved. These are cloud rules matched against EasyList server-side, withmaxMatchesToReportonly.a11y/skip-link: therequiredsection is removed (the rule takes no options), and the page says to disable the rule instead.crawl/all-noindex-pages:threshold→warnOnPatterns/errorOnPatterns."/lp/*"and"/.well-known/*"matched nothing. A new section gives the three real forms (substring,/segment/,regex:). Regexes need TOML single quotes: the CLI's TOML parser rejects"regex:^/blog/\d{4}/".links/internal-linksdefaults (min1, max100), and the word-count band (thin content warns, it does not fail). The nonexistentsquirrel rules show/rules list --with-optionscommands are replaced by the rule pages' Options tables. The validation section now says what really happens to a mistake (next section).Other pages:
configuration/rules.mdx:core/og-*matches no rule (only*andcategory/*are supported), so the page now says so and lists the rules instead. The defaultdisableis[], not the three-rule list.content/qualityandai/ai-contentare dropped from every disable list, with a note that both are retired and never load.cli/analyze.mdx,cli/config.mdx:content/qualitydropped from their disable lists.cli/init.mdx: the "Default config" block is now the filesquirrel initactually writes (run from source). It had a staledisablelist andmax_pages = 500(the default is 100).rules/content/quality.mdx,rules/ai/ai-content.mdx: their enable/disable sections (which do nothing) are replaced by a note that the rule never loads. Two claims are fixed: that enablingai/ai-contentproduces a skip, and thatcontent/quality"runs on a cloud audit".configuration/examples.mdx: two**glob patterns fixed ("/api/deprecated/","/.well-known/").Evidence
Static check of every docs page: a script parses every TOML block under
docs/, then checks each[rule_options."…"]table againstloadAllRules()and the rule's schema, and each[rules]pattern againstmatchesRulePattern.[rules]patterns that match no loaded rule (core/og-*and the retiredcontent/quality/ai/ai-content).Audits from source (
bun apps/cli/src/cli.ts audit, scratch HOME,--offline --refresh) against a local fixture: a noindexed/blog/post/with a repeated word, a dead-end/landing/, and an unlinked/hidden/in the sitemap. Three configs:squirrel.toml, audit cleanly (exit 0, no option error).config validatesaysConfig validformin_length = "thirty"and for[rule_options."performance/ttfb"], and the audit then fails with✗ Audit failed:/Invalid input: expected number, received string. It catchescrawler.max_pages = "lots"(Invalid config: crawler.max_pages: Expected number, received string).Gates
bun x [email protected] check --strictindocs/: all checks passed (416 pages).crawl/all-noindex-pages, how keyword density counts words, and the all-noindex output being capped lists, not every page. All three are fixed, and the second pass's two wording nits are fixed too.Follow-ups filed
config validatepasses rule options no rule can use, and a wrong type fails the whole audit without naming the rule.crawl/all-noindex-pagesdeclaresoptionsSchemaoutsidemeta.configuration/rules.mdxhas stale per-category rule counts and AI section.