Skip to content

[DX]: Add format scripts and align linting with the OSS repo standards #149

@Fermionic-Lyu

Description

@Fermionic-Lyu

Summary

The CLI repo has an ESLint gate, but it does not yet have the formatter scripts and Prettier integration that the OSS repo uses. It also overloads npm run lint to run the full Vitest suite before ESLint, which makes linting slower/noisier and makes it harder to apply a consistent cross-repo quality contract.

This matters because we want every InsForge repo to expose the same basic developer gates: format, format check, lint, typecheck, test, and build.

Validation

Valid. The current CLI repo has no format or format:check script, no Prettier dependency, and no dedicated typecheck script. The lint script currently runs tests first, then ESLint.

Local checks on main@8f913e120e3d6cffecc435a4c9b8a7aebaec45be:

  • npm run lint passed, but ran Vitest before ESLint and reported 39 @typescript-eslint/no-explicit-any warnings.
  • npm run build passed.

Relevant Code

  • package.json:10 - script block only defines build, dev, lint, lint:fix, prepublishOnly, and test scripts.
  • package.json:13 - lint is vitest run --passWithNoTests && eslint src/.
  • package.json:46 - dev dependencies do not include Prettier or Prettier ESLint integration.
  • eslint.config.js:1 - ESLint config uses @eslint/js and typescript-eslint, but does not include Prettier config/rules.
  • .github/workflows/ci.yml:22 - CI has a single "Test & lint" step that runs npm run lint.
  • .github/workflows/publish.yml:22 - publish uses the same combined npm run lint gate.

Proposed Solution

Align the CLI repo's quality gates with InsForge/InsForge:

  • Add Prettier and the same practical Prettier/ESLint integration used by the OSS repo.
  • Add format and format:check scripts.
  • Add a dedicated typecheck script.
  • Consider making lint only run ESLint, with CI/publish running test, typecheck, format:check, lint, and build as separate named steps.
  • Decide whether warnings should be allowed in CI or whether to use --max-warnings=0 after the current test-only any warnings are cleaned up or explicitly exempted.

Acceptance Criteria

  • npm run format and npm run format:check exist and behave consistently with the OSS repo.
  • npm run lint, npm run test, npm run typecheck, and npm run build are separately runnable.
  • CI and publish workflows run the intended checks as explicit steps.
  • The formatter/linter setup is documented or obvious from package.json.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions