Repository navigation
feat(rules): add content/common-misspellings #709 - #720
Conversation
|
Review of the
Test coverage: |
Maintainer review (2026-10-12)Verdict: needs fixes (medium to high). I reviewed head 34005fb against main 2dca3b9. Main CI is green at that sha, so the red checks come from this PR. This branch also carries #714's first commit ( Acceptance criteria (#709)All 11 boxes are ticked, and 10 are fully met. AC2 is only partly met: the check status is The licence decision is recorded in the maintainer comment on #709. The NOTICES entries ( Fixes
PR hygiene
Merge order |
34005fb to
801bcee
Compare
|
Review of
I found nothing critical or high-risk. The URL and email handling avoids regex backtracking, and the streamed and legacy paths share one scan function. 🤖 Generated with Claude Code |
801bcee to
152726d
Compare
|
Replies to the review of 801bcee. Both mediums are fixed in 152726d; the PR body section "Changes from the claude-review on 801bcee" has the details.
|
|
Review of the new The rule is well bounded. It has per-page quotas, a finding cap and a per-token URL/email check that avoids a regex backtracking problem. The tests cover exclusions as well as detections. The streamed and legacy paths share
I found no critical or high-severity problems. 🤖 Generated with Claude Code |
152726d to
a60fcbd
Compare
|
Review of
Positives:
I found no high or critical issues. |
Site-scope rule that reports known misspellings and doubled function words
in the visible English text of pages whose <html lang> is en. A lookup in a
bundled map of 523 common misspellings written for squirrelscan (MIT),
grouped by kind of slip: ie/ei swaps, doubled or single consonants, confused
suffixes, wrong unstressed vowels, dropped or added letters, and swapped
letters in very common words. Nothing is copied or derived from a published
misspelling list (Wikipedia's, and codespell, misspell, typos and cspell,
which trace back to it, are CC BY-SA or derived from it).
- scripts/check-common-misspellings.ts checks the list against SCOWL
(wordlist-english 1.2.1) and an-array-of-english-words 2.0.0, which are
used only by the check and not shipped. Every correction is a common word
(SCOWL size 60 or below, US, British, Canadian or Australian spelling), and
every misspelling is no word in either list, so a valid spelling in any
variant is never reported. Surnames and brands that look like typos,
words that are real in other languages, and misspellings one letter from
two different words are left out. The data README records the method, the
input versions and their licences.
- The data is a TypeScript module exporting one plain string, so it loads the
same in every runtime that imports the rules, with no JSON import or
import attribute.
- A misspelling in the title, meta description or a heading warns (meta
severity warning); body-copy misspellings and doubled words are info.
Doubled words skip as, at, in, is, it and on, which can repeat correctly.
- A word the page's prose capitalises mid-sentence is a name ("the actor
Kelsey Grammer"), so it is not judged in a title, a heading or at a sentence
start either. Links, buttons, menus and breadcrumbs that echo a title in
Title Case are not prose and never mark a name. An opening bracket no longer
counts as a sentence start.
- Per page, each distinct word counts once. The title, description and
headings (25) and the body (25) have separate quotas, the body scan leaves
headings out, and a spent quota stops the scan.
- URL and email tokens are blanked per whitespace-separated token, not by a
regex over the whole text: `\S+@\S+` backtracked quadratically on one long
unbroken run (80k characters took 11 s, and the rule time budget cannot
interrupt a regex). 160 KB with no space now scans well under a second.
- A <title> in another language (or translate="no") is skipped, and headings
are read like body copy (code, kbd and foreign spans inside them skipped).
- Past the 50-finding cap, an info check counts the findings not listed.
- Streamed audits read the page-time scan from collectedSignals; the legacy
pass re-scans the stored DOM. Both call scanPageForMisspellings.
- ignore_words option, matched case-insensitively (misspellings only).
- Docs page under docs/rules/content/, wired into docs.json and the content index.
- .gitignore: the data/ rule would have excluded the bundled data file.
No network requests.
Golden gate: findings 101742 -> 101743 and tally rows 307 -> 308 (a pass on
the synthetic copy); healthScore.overall stays 51.
Signed-off-by: Nik Cubrilovic <[email protected]>
a60fcbd to
f7f009c
Compare
|
Review of No critical or high issues found. The design holds up. The scan runs once per page at collection time, so a streamed crawl keeps small bounded records instead of parsed DOMs. The legacy and streamed paths share
|
Summary
content/common-misspellings. It looks each word of English pages up in a bundled map of known misspellings and reports the correction, the number of pages and capped examples. It also reports doubled function words ("the the").<html lang>has primary subtagen. These are skipped: code, pre, samp, kbd, templates,translate="no",spellcheck="false"and non-Englishlangsubtrees. These are never judged: URLs, emails, handles, ALL CAPS, mixed case, mid-sentence capitals, and any word the page's body uses as a name.meta.severityiswarning, so the report shows them as warnings. Body prose and doubled words are info.ignore_wordsoption, matched case-insensitively (misspellings only).docs/rules/content/common-misspellings.mdx, wired intodocs/docs.jsonand the content index..gitignorehad adata/rule that would have excluded the bundled data file, sopackages/rules/src/content/data/(and only it) is now un-ignored.Licence: our own list, MIT
The first version of this PR bundled data derived from Wikipedia's "Lists of common misspellings" (CC BY-SA 4.0). ShareAlike data inside the MIT binary needs a licence decision, so the maintainer chose a list of our own instead. This PR's single commit contains none of that data.
packages/rules/src/content/data/common-misspellings-data.tsholds 523 misspellings written for squirrelscan. It is MIT, like the rest of the package.It is not copied or derived from any published misspelling list. Every list of useful size we checked traces back to the Wikipedia list or carries copyleft or non-commercial terms:
words.csv: imported from misspell and codespell.None of them was used as a source, a candidate list or a filter.
Method (recorded in the data README): entries were written by typo class.
ie/eiswaps, doubled or single consonants, confused suffixes, wrong unstressed vowels, dropped or added letters, swapped letters in very common words, and words often misspelt on websites.ie/eiand suffix candidates came from a throwaway script, whose exact rule the README states. It applied those swaps to common SCOWL words and kept only the results that are not words. Each entry was chosen individually.sargent,greif);posible,profesional);eigth,preceed).Check:
scripts/check-common-misspellings.tsreplaces the old Wikipedia build script. It is run by hand and needs two word lists, which are used only by the check and never shipped:wordlist-englishan-array-of-english-wordsEach line must be two lowercase words, sorted, with no duplicates.
colour,organise,judgement) is never reported.THIRD_PARTY_NOTICES.md,npm/THIRD_PARTY_NOTICES.mdandscripts/generate-third-party-notices.tsare unchanged from main. Nothing third-party ships.Size
Measured on the compiled CLI with the same flags as
apps/cli(bun build src/cli.ts --compile --splitting --minify):The data module is 10,392 bytes. Growth is the data plus the rule's code, rounded up to the binary's 16 KB layout.
Changes from the claude-review on 152726d
as,in,isanditare dropped from the list. The delta review then found thatonandatrepeat correctly too ("turn it on on startup", "look at at least two"), so those are dropped as well. A test pins all six.^[a-z]+ [a-z]+$. The info status for body-only findings was already tested.Opus delta review: licence and false positives on real pages
sargentis dropped.navor breadcrumb containers. Tests cover breadcrumb, inline link, button-row andnavechoes.Changes from the earlier reviews (2026-10-12 and 801bcee)
"recieve" → "receive"as a warning.bun testimports the module directly.\b(?:https?:\/\/|www\.)\S+|\S+@\S+over the whole text. That regex backtracked quadratically on one unbroken run: 80k characters took 11 s, and the rule time budget cannot interrupt a regex. A timing test scans 160 KB with no space well under a second.common-misspellings-truncatedinfo check counts the rest.<title lang>in another language is skipped.healthScore.overallstays 51.[Unreleased]/### Added.Agent skill: yes, the squirrelscan agent skill (squirrelscan/skills) should learn the new rule; the maintainer files that as a private issue. Per-category counts are left for the maintainer's batched docs PR.
Known gaps and decisions for review
info, and onlyfailandwarnchecks are listed as issues. The docs say so.misspellingsfield on their collected signal. They read as no findings, the same as the other collected fields.siteQuerypath. It readscollectedSignalswhen present, and the legacysite.pagesotherwise.Verification
The rule, test, check script and data files are oxfmt- and oxlint-clean.
Checklist
Signed-off-byline (git commit -s).Acceptance criteria
recieve → receivewith the page URL and a context snippet. This is rule-level only; see the report gap above.<title>or anh2produces a warning, not info.lang="de", nolang, and a<span lang="fr">block on an English page produce no findings.<code>,<pre>,<kbd>, a URL, an email address, an ALL CAPS word and a mid-sentence capitalised word produce no findings.colourandorganiseproduce no findings.ignore_wordsis never reported.docs/rules/content/, wired intodocs.jsonand the content index.Closes #709