Skip to content

Add ESLint and Prettier with a lint gate in CI #60

@mikewheeleer

Description

@mikewheeleer

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.

Metadata

Metadata

Assignees

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions