Skip to content

Add static checks for editor endpoint clients - #1041

Merged
nonprofittechy merged 4 commits into
mainfrom
1040-static-correctness-checks
Aug 24, 2026
Merged

Add static checks for editor endpoint clients#1041
nonprofittechy merged 4 commits into
mainfrom
1040-static-correctness-checks

Conversation

@nonprofittechy

Copy link
Copy Markdown
Member

Summary

  • add reproducible Prettier, ESLint/SonarJS, and JavaScript checkJs tooling for the maintained editor endpoint clients
  • add a tracked local pre-commit hook that formats staged JavaScript and runs the complete npm run check suite
  • add GitHub Actions coverage for the same checks on pushes and pull requests
  • fix the existing formatting, lint, SonarJS, and type-check findings without converting the browser code to TypeScript

Verification

  • npm ci && npm run check
  • commit hook completed successfully during commit
  • Node syntax and JavaScript tests passed
  • frontend regression tests: 46 passed, 29 subtests passed
  • GitHub Actions workflow: .github/workflows/static_checks.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces reproducible static-check tooling (Prettier, ESLint + SonarJS, and TypeScript checkJs) for the maintained browser “editor endpoint client” JavaScript modules, and wires those checks into both local development (pre-commit hook) and GitHub Actions.

Changes:

  • Added Node-based formatting/linting/typecheck configuration (package.json, package-lock.json, eslint.config.mjs, tsconfig.json, Prettier config).
  • Added local pre-commit hook (.githooks/pre-commit) and automated installation via npm prepare.
  • Added CI workflow to run the same checks on pushes/PRs, and applied formatting/typecheck-driven fixes across the targeted editor client JS files.

Reviewed changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsconfig.json Enables checkJs typechecking for the maintained editor endpoint client JS files.
package.json Defines format, lint, typecheck, and check scripts plus hook installation via prepare.
package-lock.json Locks the dev-tooling dependency graph for reproducible installs in CI and locally.
eslint.config.mjs Adds ESLint + SonarJS configuration scoped to the maintained endpoint client files.
docassemble/ALWeaver/data/static/editor_validation_source.js Formatting / checkJs-driven edits (no functional intent).
docassemble/ALWeaver/data/static/editor_runtime_inspector.js Formatting / checkJs-driven edits (no functional intent).
docassemble/ALWeaver/data/static/editor_module_restart.js Formatting / checkJs-driven edits (no functional intent).
docassemble/ALWeaver/data/static/editor_dirty_state.js Formatting / checkJs-driven edits (no functional intent).
docassemble/ALWeaver/data/static/editor_api_client.js checkJs-driven refactors and error handling adjustments.
docassemble/ALWeaver/data/static/editor_agent_chat.js Formatting / checkJs-driven edits (no functional intent).
.prettierrc.json Establishes consistent formatting rules for the JS tooling.
.prettierignore Excludes node_modules from formatting.
.gitignore Stops ignoring package*.json and ignores node_modules/ instead.
.github/workflows/static_checks.yml Adds CI coverage for npm ci + npm run check.
.githooks/pre-commit Formats staged JS and runs the full check suite before committing.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +45 to +49
function requestKey(method, path) {
try {
return method + ':' + new URL(path, 'http://editor.invalid').pathname;
} catch (_error) {
return method + ':' + String(path).split('?')[0];
return method + ':' + new URL(path, 'https://editor.invalid').pathname;
} catch (error) {
if (error instanceof TypeError) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in ab88180.

Comment thread package.json
Comment thread package.json
Comment thread package.json
Comment thread .githooks/pre-commit Outdated
nonprofittechy and others added 2 commits August 24, 2026 17:50
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@nonprofittechy
nonprofittechy merged commit c4250bb into main Aug 24, 2026
1 check passed
@nonprofittechy
nonprofittechy deleted the 1040-static-correctness-checks branch August 24, 2026 22:07
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.

3 participants