Skip to content

Codebase cleanup: strict ESLint, CLI refactoring, versioned installer#7

Merged
MelbourneDeveloper merged 8 commits into
mainfrom
cleanup
Mar 15, 2026
Merged

Codebase cleanup: strict ESLint, CLI refactoring, versioned installer#7
MelbourneDeveloper merged 8 commits into
mainfrom
cleanup

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR;

Comprehensive cleanup pass: strict ESLint rules across the VsCode extension, CLI refactoring for maintainability, versioned CLI installer, and expanded test coverage.

Details

  • ESLint overhaul: New shared eslint-rules.cjs with all TypeScript-ESLint rules set to error. Updated eslint.config.mjs to use it. Fixed all violations across every extension source file (sorted imports, const declarations, removed type assertions, array-simple style, explicit member accessibility).
  • CLI (F#) refactoring: Extracted printNdjson, formatAndExit, runDirectory, mergeVars helpers in Program.fs. Cleaned up Runner.fs and Output.fs.
  • Versioned CLI installer: CLI now has --version flag. Extension checks installed version against CLI_REQUIRED_VERSION constant and re-downloads on mismatch. Download URLs pinned to version tag.
  • Build scripts: Rewrote build-vsix.sh (universal VSIX, no bundled CLI), updated build-cli.sh and build-all.sh with version verification, cleaned up clean-install.sh.
  • Tests: Added 907-line htmlUtils.test.ts unit test suite. Improved e2e tests with additional assertions and lint compliance. Added ecommerce-spec.json test fixture.
  • New files: watchers.ts for file watcher setup, LICENSE (MIT), docs/vsix-binary-audit.md audit document.
  • CLAUDE.md: Refined coding guidelines (regex policy, named params threshold, logging, testing rules).
  • Removed: Deleted unused scripts/package.sh.

How do the tests prove the change works

  • htmlUtils.test.ts validates all HTML utility functions (report generation, escaping, formatting) with comprehensive assertions
  • E2e tests updated to pass under strict lint rules while maintaining all existing behavioral assertions
  • Build scripts include version verification steps that fail the build if CLI version doesn't match

- Add async keyword to getCliVersion in cliInstaller.ts
- Extract isVersionMatch helper from ensureCliInstalled in extension.ts to stay under 20-line limit
@MelbourneDeveloper MelbourneDeveloper merged commit cafd1cf into main Mar 15, 2026
3 checks passed
@MelbourneDeveloper MelbourneDeveloper deleted the cleanup branch March 15, 2026 21:27
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