Skip to content

Add ESLint and Prettier configuration files for backend and frontend #167

Description

@Josie123-Dev

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

  • backend/.eslintrc.js exists and npm run lint passes in backend/
  • backend/.prettierrc exists and npm run format produces consistent output
  • frontend/.eslintrc.js exists and npm run lint passes in frontend/
  • frontend/.prettierrc exists and npm run format produces consistent output
  • Both configs use consistent rules (same print width, tab width, trailing commas)
  • Pre-commit hook runs lint-staged on staged files (if husky is added)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaigndifficulty:hardHard difficulty issuespriority:highHigh priority issuesqualityCode quality improvementstoolingDeveloper tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions