This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
token-gated-economy/eslint.config.ts
alexpaynex 74bec13886 feat: add TypeScript quality gates — ESLint, pre-commit, Gitea CI (#9)
Implements task #9 — TypeScript quality gates.

## What was built
- `eslint.config.ts` — flat config with typescript-eslint, ignores generated dirs
- `package.json` — added `pnpm run lint` script using ESLint 10
- `.githooks/pre-commit` + `.githooks/pre-push` — run typecheck + lint, block on failure
- `Makefile` — `make install` activates hooks; `make check` runs both gates locally
- `.gitea/workflows/ci.yml` — Gitea Actions CI on PR to main (node:22-alpine)
- `AGENTS.md` — documents hooks, push workflow, branch conventions, stub modes

## Bug fixes required (pre-existing failures blocked the gate)
1. `lib/integrations-anthropic-ai/src/batch/utils.ts` — `pRetry.AbortError` does not
   exist on the default import in p-retry@7.x. Fixed: named import `{ AbortError }`.
2. `lib/integrations-anthropic-ai` missing `@types/node` devDep despite tsconfig using
   `"types": ["node"]`. Added `"@types/node": "catalog:"` to its package.json.
3. `lib/api-client-react` removed from root `tsconfig.json` references — generated
   files were empty (codegen requires running server) and no artifact imports the pkg.
4. `artifacts/api-server/src/lib/agent.ts` — `@ts-ignore` → `@ts-expect-error` (ESLint rule).
5. `artifacts/api-server/src/routes/sessions.ts` — `let` → `const` for reassignment-free var.
6. Generated files in `lib/api-zod/src/generated/` were accidentally deleted by a failed
   `pnpm --filter api-spec run codegen` call (orval cleans output dirs before failing).
   Restored from git HEAD (`git show HEAD:...`).

## Verified
- `pnpm run typecheck` exits 0
- `pnpm run lint` exits 0
- `make install` activates hooks and makes them executable
- `make check` runs both gates cleanly
2026-03-18 23:16:49 +00:00

24 lines
545 B
TypeScript

import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/.cache/**",
"**/.local/**",
"**/lib/api-zod/src/generated/**",
"**/lib/api-client-react/src/generated/**",
"**/lib/integrations/**",
],
},
...tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-require-imports": "warn",
},
},
);