Add static checks for editor endpoint clients - #1041
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 npmprepare. - 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) { |
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>
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.
Summary
checkJstooling for the maintained editor endpoint clientsnpm run checksuiteVerification
npm ci && npm run check.github/workflows/static_checks.yml