What
Create .eslintrc.js and .prettierrc configuration files for both the backend and frontend packages. Add lint-staged and husky pre-commit hooks to enforce formatting on commit.
Why
Both backend/package.json and frontend/package.json have lint and format scripts, but no actual ESLint or Prettier configuration files exist. This means:
npm run lint either fails or uses unpredictable defaults
- Code style is not enforced across contributors
- PRs can introduce inconsistent formatting without any check catching it
The smart contracts enforce cargo fmt and cargo clippy in CI with -D warnings. The JS packages should have equivalent enforcement.
Scope
In scope:
backend/.eslintrc.js — NestJS-appropriate config (extends @typescript-eslint/recommended)
backend/.prettierrc — consistent formatting rules
frontend/.eslintrc.js — Next.js-appropriate config (extends next/core-web-vitals)
frontend/.prettierrc — consistent formatting rules
lint-staged + husky pre-commit hook (optional, in root or per-package)
- Fix any existing lint errors so
npm run lint passes cleanly
Out of scope:
- Monorepo-level ESLint config (no root package.json yet)
- Custom ESLint plugins
- Refactoring code to fix lint warnings (only fix errors)
Acceptance Criteria
Technical Context
- Backend deps already installed:
eslint, prettier, @typescript-eslint/eslint-plugin, @typescript-eslint/parser
- Frontend deps already installed:
eslint, eslint-config-next
- NestJS recommended ESLint config: https://docs.nestjs.com/linting
- Frontend should extend
next/core-web-vitals and @typescript-eslint/recommended
What
Create
.eslintrc.jsand.prettierrcconfiguration files for both the backend and frontend packages. Add lint-staged and husky pre-commit hooks to enforce formatting on commit.Why
Both
backend/package.jsonandfrontend/package.jsonhavelintandformatscripts, but no actual ESLint or Prettier configuration files exist. This means:npm run linteither fails or uses unpredictable defaultsThe smart contracts enforce
cargo fmtandcargo clippyin CI with-D warnings. The JS packages should have equivalent enforcement.Scope
In scope:
backend/.eslintrc.js— NestJS-appropriate config (extends@typescript-eslint/recommended)backend/.prettierrc— consistent formatting rulesfrontend/.eslintrc.js— Next.js-appropriate config (extendsnext/core-web-vitals)frontend/.prettierrc— consistent formatting ruleslint-staged+huskypre-commit hook (optional, in root or per-package)npm run lintpasses cleanlyOut of scope:
Acceptance Criteria
backend/.eslintrc.jsexists andnpm run lintpasses inbackend/backend/.prettierrcexists andnpm run formatproduces consistent outputfrontend/.eslintrc.jsexists andnpm run lintpasses infrontend/frontend/.prettierrcexists andnpm run formatproduces consistent outputTechnical Context
eslint,prettier,@typescript-eslint/eslint-plugin,@typescript-eslint/parsereslint,eslint-config-nextnext/core-web-vitalsand@typescript-eslint/recommended