Skip to content

fix: add spell checking#467

Merged
LuLaValva merged 3 commits intomainfrom
spell-check
Mar 14, 2026
Merged

fix: add spell checking#467
LuLaValva merged 3 commits intomainfrom
spell-check

Conversation

@LuLaValva
Copy link
Copy Markdown
Member

Add spell checking as a pre-commit hook, and correct some spelling mistakes

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: 28712fb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 054c3845-4300-442e-8223-e92028903eb0

📥 Commits

Reviewing files that changed from the base of the PR and between 3e134cd and 28712fb.

⛔ Files ignored due to path filters (3)
  • package-lock.json is excluded by !**/package-lock.json and included by **
  • packages/language-server/src/__tests__/fixtures/script/class-api-basic/__snapshots__/class-api-basic.expected/index.html is excluded by !**/__snapshots__/** and included by **
  • packages/language-server/src/__tests__/fixtures/script/tags-api-basic/__snapshots__/tags-api-basic.expected/index.html is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (2)
  • package.json
  • packages/language-tools/src/extractors/script/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Walkthrough

Adds a cspell configuration file and registers cspell as a devDependency, extending the lint script. Renames the test service import from MarkoLangaugeService to MarkoLanguageService and updates test callsites (doHover, doValidate, command lookups). Updates fixture HTML classes from "subnote" to "sub-note". Corrects identifier spelling for an attribute constant (ATTR_UNNAMED) across script extractor code. Adds a cspell disable comment in a regex file and fixes typographical errors in NOTICE files. Changes are limited to tests, configs, comments, and identifier/name fixes; no behavioral or public API changes.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding spell checking to the project.
Description check ✅ Passed The description is directly related to the changeset, explaining the addition of spell checking and correction of spelling mistakes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch spell-check
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 30: The pre-commit wiring is incomplete: the "lint" script in
package.json now runs cspell, but .lintstagedrc.json still only invokes eslint
and prettier on staged files; update .lintstagedrc.json to add rules for the
file patterns you want spell-checked (e.g., "*.md", "*.ts" or the existing
staged globs) that run the cspell command (matching the same cspell invocation
in package.json), ensuring the cspell task is executed for staged files at
pre-commit alongside eslint and prettier.

In
`@packages/language-server/src/__tests__/fixtures/script/class-api-basic/index.marko`:
- Around line 57-60: The emitted HTML for the class-api-basic fixture changed
(the <span class="sub-note"> lines with isSmartPhone: ${isSmartOnly} and
phoneType: ${type}), so the Jest snapshots are out of date; run the test suite
for packages/language-server (or run jest for the class-api-basic test) with
snapshot update (e.g., jest -u or your repo's test:update script), verify the
updated output in __tests__/__snapshots__ for the class-api-basic fixture, and
commit the regenerated __snapshots__ file so CI uses the new snapshot.

In
`@packages/language-server/src/__tests__/fixtures/script/tags-api-basic/index.marko`:
- Around line 26-29: The fixture HTML changed in the tags-api-basic fixture
(index.marko) causing snapshot failures; regenerate the Jest/fixture snapshots
for the tags-api-basic test suite (run the test command with snapshot update,
e.g., jest -u or your project's equivalent) so the updated rendered output (the
modified class/name lines) are captured, then commit the updated snapshot files
alongside the modified fixture; ensure the snapshot files corresponding to the
tags-api-basic fixture are included in the commit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28f832b9-b593-4bad-b456-3945e093edad

📥 Commits

Reviewing files that changed from the base of the PR and between 47ffeca and 3e134cd.

⛔ Files ignored due to path filters (6)
  • package-lock.json is excluded by !**/package-lock.json and included by **
  • packages/language-server/src/__tests__/fixtures/script/class-api-basic/__snapshots__/class-api-basic.expected/index.html is excluded by !**/__snapshots__/** and included by **
  • packages/language-server/src/__tests__/fixtures/script/class-api-basic/__snapshots__/class-api-basic.expected/index.ts is excluded by !**/__snapshots__/** and included by **
  • packages/language-server/src/__tests__/fixtures/script/tags-api-basic/__snapshots__/tags-api-basic.expected/index.html is excluded by !**/__snapshots__/** and included by **
  • packages/language-server/src/__tests__/fixtures/script/tags-api-basic/__snapshots__/tags-api-basic.expected/index.md is excluded by !**/__snapshots__/** and included by **
  • packages/language-server/src/__tests__/fixtures/script/tags-api-basic/__snapshots__/tags-api-basic.expected/index.ts is excluded by !**/__snapshots__/** and included by **
📒 Files selected for processing (11)
  • cspell.json
  • package.json
  • packages/language-server/NOTICE
  • packages/language-server/src/__tests__/fixtures/script/class-api-basic/index.marko
  • packages/language-server/src/__tests__/fixtures/script/tags-api-basic/index.marko
  • packages/language-server/src/__tests__/index.test.ts
  • packages/language-tools/src/extractors/html/keywords.ts
  • packages/language-tools/src/extractors/script/index.ts
  • packages/language-tools/src/extractors/script/util/attach-scopes.ts
  • packages/language-tools/src/processors/marko.ts
  • packages/vscode/NOTICE

"change": "npm exec changeset add",
"format": "npm run build && eslint -f unix --fix . && prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\" --write",
"lint": "npm run build && eslint -f unix . && prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\" --check --log-level=warn",
"lint": "npm run build && eslint -f unix . && prettier \"./**/*{.ts,.js,.json,.md,.yml,rc}\" --check --log-level=warn && cspell \"**/*.{md,ts,marko}\"",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== package.json hook-related config ==="
jq '{scripts, "lint-staged": .["lint-staged"]}' package.json

echo
echo "=== .husky contents (if present) ==="
if [ -d .husky ]; then
  fd . .husky -t f -x sh -c 'echo "--- $1"; sed -n "1,160p" "$1"' sh {}
else
  echo "No .husky directory found"
fi

echo
echo "=== references to cspell / lint / pre-commit ==="
rg -n --glob '!**/node_modules/**' --glob '!**/dist/**' 'pre-commit|lint-staged|npm run lint|cspell'

Repository: marko-js/language-server

Length of output: 24177


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Looking for lint-staged configuration files ==="
fd -H '\.(lintstagedrc|lintstagedrc\.(js|json|mjs|cjs))$|lint-staged\.config\.(js|json|mjs|cjs)$' . --type f

echo
echo "=== Checking if cspell.json exists ==="
if [ -f cspell.json ]; then
  head -20 cspell.json
fi

echo
echo "=== Full .husky/pre-commit content ==="
if [ -f .husky/pre-commit ]; then
  cat .husky/pre-commit
fi

Repository: marko-js/language-server

Length of output: 662


🏁 Script executed:

cat .lintstagedrc.json

Repository: marko-js/language-server

Length of output: 170


Pre-commit wiring is incomplete.

Adding cspell to npm run lint doesn't enable pre-commit checks without corresponding changes to the lint-staged configuration. The .lintstagedrc.json file only runs eslint and prettier on staged files—cspell is not included. Update .lintstagedrc.json to trigger spell checking on the appropriate file patterns (e.g., add "*.md" and "*.ts" rules that include the cspell command) so spell checking actually runs on pre-commit.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 30, The pre-commit wiring is incomplete: the "lint"
script in package.json now runs cspell, but .lintstagedrc.json still only
invokes eslint and prettier on staged files; update .lintstagedrc.json to add
rules for the file patterns you want spell-checked (e.g., "*.md", "*.ts" or the
existing staged globs) that run the cspell command (matching the same cspell
invocation in package.json), ensuring the cspell task is executed for staged
files at pre-commit alongside eslint and prettier.

Comment on lines +57 to +60
<span class="sub-note">isSmartPhone: ${isSmartOnly}</span>
</if>

<span class="subnote">phoneType: ${type}</span>
<span class="sub-note">phoneType: ${type}</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Regenerate the matching snapshots.

Line 57 and Line 60 change the emitted HTML for this fixture, and CI is already failing on the class-api-basic snapshot. Please include the updated __snapshots__ output in this PR.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/language-server/src/__tests__/fixtures/script/class-api-basic/index.marko`
around lines 57 - 60, The emitted HTML for the class-api-basic fixture changed
(the <span class="sub-note"> lines with isSmartPhone: ${isSmartOnly} and
phoneType: ${type}), so the Jest snapshots are out of date; run the test suite
for packages/language-server (or run jest for the class-api-basic test) with
snapshot update (e.g., jest -u or your repo's test:update script), verify the
updated output in __tests__/__snapshots__ for the class-api-basic fixture, and
commit the regenerated __snapshots__ file so CI uses the new snapshot.

Comment on lines +26 to +29
<span class="sub-note">isSmartPhone: ${isSmartOnly}</span>
</if>

<span class="subnote">phoneType: ${type}</span>
<span class="sub-note">phoneType: ${type}</span>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Update the fixture snapshots with this HTML change.

Line 26 and Line 29 modify the rendered class name, and CI is already failing on the tags-api-basic snapshot. The regenerated snapshot files should be committed alongside this fixture update.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/language-server/src/__tests__/fixtures/script/tags-api-basic/index.marko`
around lines 26 - 29, The fixture HTML changed in the tags-api-basic fixture
(index.marko) causing snapshot failures; regenerate the Jest/fixture snapshots
for the tags-api-basic test suite (run the test command with snapshot update,
e.g., jest -u or your project's equivalent) so the updated rendered output (the
modified class/name lines) are captured, then commit the updated snapshot files
alongside the modified fixture; ensure the snapshot files corresponding to the
tags-api-basic fixture are included in the commit.

@LuLaValva LuLaValva merged commit f85d358 into main Mar 14, 2026
5 checks passed
@LuLaValva LuLaValva deleted the spell-check branch March 14, 2026 06:30
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.

1 participant