Skip to content

chore: add eslint and prettier with a ci lint gate#61

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Chigybillionz:feature/ci-30-eslint-prettier
Jun 19, 2026
Merged

chore: add eslint and prettier with a ci lint gate#61
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Chigybillionz:feature/ci-30-eslint-prettier

Conversation

@Chigybillionz

Copy link
Copy Markdown
Contributor

Close #60

Summary of the issue


The repository did not have a linter or formatter configured. package.json only exposed build/start/dev/test scripts, and CI ran install, build, and tests without a lint gate. As a result, campaign issues referencing npm run lint could not pass because the script and supporting tooling did not exist.

Root cause

There was no ESLint or Prettier dependency/configuration layer, no lint or format npm scripts, and no GitHub Actions step enforcing linting before build/test.

Solution implemented

Added ESLint and Prettier for the existing TypeScript NodeNext/ES2022 setup, wired linting into CI before build/test, documented the new commands, and cleaned up current source/test formatting so the new gate passes.

Key changes made

  • Added eslint.config.js using ESLint flat config with typescript-eslint.
  • Enabled type-aware linting with pragmatic safety rules, including:
    • @typescript-eslint/no-floating-promises
    • @typescript-eslint/no-explicit-any
  • Added .prettierrc and .prettierignore.
  • Added npm scripts:
    • npm run lint
    • npm run format
  • Added a CI lint step before build/test.
  • Updated README command and CI documentation.
  • Annotated Node test registrations in src/health.test.ts with void so intentional test registration promises are explicit.
  • Applied Prettier formatting to checked files.
  • Updated the Node engine floor to >=18.18, matching ESLint 9/typescript-eslint requirements.

Trade-offs or considerations

The ESLint config uses strict type-aware presets but disables high-churn rules that would require a broader Express request-body and Supertest response typing refactor. This keeps the initial lint gate useful and production-ready without turning the PR into an unrelated application typing rewrite.

Testing steps

npm run format
npm run lint
npm run build
npm test

validationn results 
npm run format
Checking formatting...
All matched files use Prettier code style!

npm run lint
eslint . --ext .ts

npm run build
tsc

npm test
TAP version 13
# Subtest: dist
ok 1 - dist
1..1
# tests 1
# pass 1
# fail 0
---
 please kindly review and let me know about any feedback regarding the task! thank you!!

@mikewheeleer

Copy link
Copy Markdown
Contributor

nice, a proper lint gate is exactly what this repo was missing. lgtm 👍

@mikewheeleer mikewheeleer merged commit 9985706 into Agentpay-Org:main Jun 19, 2026
1 check failed
@Chigybillionz

Chigybillionz commented Jun 19, 2026 via email

Copy link
Copy Markdown
Contributor Author

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.

Add ESLint and Prettier with a lint gate in CI

2 participants