Implement ESLint and Prettier with a CI lint gate
Description
The repo has no linter or formatter: package.json defines only build, start, dev, and test scripts, and .github/workflows/ci.yml runs npm ci, build, and test but no lint step. Several issues in this campaign reference npm run lint, which does not yet exist. This issue establishes consistent linting and wires it into CI.
Requirements and context
- Repository scope:
Agentpay-Org/Agentpay-backend only.
- Add ESLint (typescript-eslint) and Prettier configs appropriate for the
NodeNext/ES2022/strict setup in tsconfig.json.
- Add
lint and format scripts to package.json (eslint . --ext .ts, prettier --check).
- Fix or annotate any existing violations in
src/index.ts and src/health.test.ts so the gate passes clean.
- Add a
lint step to .github/workflows/ci.yml before build/test.
Suggested execution
- Fork the repo and create a branch
git checkout -b feature/ci-30-eslint-prettier
- Implement changes
- Write code in: new
.eslintrc/eslint.config.js and .prettierrc; update package.json and .github/workflows/ci.yml.
- Write comprehensive tests in: the lint run itself serves as the gate; ensure
npm test stays green.
- Add documentation: document
npm run lint/npm run format in the Commands table of README.md.
- Keep rules pragmatic (no churn-only rules) and aligned with the existing style.
- Validate security assumptions: enable rules that catch unsafe patterns (no-floating-promises, no-explicit-any where avoidable).
- Test and commit
Test and commit
- Run
npm run lint, npm run build, and npm test.
- Confirm CI runs lint and fails on a deliberately introduced violation (then revert it).
- Include the full lint + test output in the PR description.
Example commit message
chore: add eslint and prettier with a ci lint gate
Guidelines
- Minimum 95 percent test coverage for impacted modules (where applicable).
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord for questions, reviews, and faster merges: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Implement ESLint and Prettier with a CI lint gate
Description
The repo has no linter or formatter:
package.jsondefines onlybuild,start,dev, andtestscripts, and.github/workflows/ci.ymlrunsnpm ci, build, and test but no lint step. Several issues in this campaign referencenpm run lint, which does not yet exist. This issue establishes consistent linting and wires it into CI.Requirements and context
Agentpay-Org/Agentpay-backendonly.NodeNext/ES2022/strict setup intsconfig.json.lintandformatscripts topackage.json(eslint . --ext .ts,prettier --check).src/index.tsandsrc/health.test.tsso the gate passes clean.lintstep to.github/workflows/ci.ymlbefore build/test.Suggested execution
git checkout -b feature/ci-30-eslint-prettier.eslintrc/eslint.config.jsand.prettierrc; updatepackage.jsonand.github/workflows/ci.yml.npm teststays green.npm run lint/npm run formatin the Commands table ofREADME.md.Test and commit
npm run lint,npm run build, andnpm test.Example commit message
chore: add eslint and prettier with a ci lint gateGuidelines
Community & contribution rewards