Files
HealthLog/eslint.config.mjs
T
Marc-André Bombeck 812a8f287e chore(lint): ignore .claude/** worktrees and align check-user mock with RateLimitResult
Two small follow-ups to the v1.4.41 inline-QA reconcile:

- eslint.config.mjs gains `.claude/**` in the globalIgnores list so a
  mid-marathon Claude Code worktree on an older base commit can no
  longer poison `pnpm lint` locally with pre-fix warnings. CI never
  walks that path; the change is purely for the dev environment.

- The check-user route test mock objects for `checkRateLimit` carried
  a stray `limit: 30` field that does not exist on `RateLimitResult`
  (the real type is `{ allowed, remaining, resetAt }`). The literal
  was harmless at runtime but flagged by `tsc --noEmit` on the
  test-file declarations. Drops the field at all three mock sites.
2026-05-21 18:15:59 +02:00

35 lines
1.3 KiB
JavaScript

import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import healthlogPlugin from "./eslint-plugins/healthlog/queryKey-factory.js";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
// v1.4.41 — ignore Claude Code session worktrees so a mid-marathon
// worktree on an older commit can't poison `pnpm lint` locally.
// CI never sees this path; the rule is for the dev environment.
".claude/**",
]),
// v1.4.41 W-PROCESS-DOCS — custom rule that flags any bare-array
// `queryKey: [ … ]` / `mutationKey: [ … ]` declaration inside the
// files the queryKeys factory currently guards. Promotes the
// test-guard substitute from v1.4.40 W-RSC to a real ESLint rule
// so IDE + CI both fail fast on a factory bypass. See
// `eslint-plugins/healthlog/queryKey-factory.js` for the
// whitelist + rationale.
{
plugins: { healthlog: healthlogPlugin },
rules: { "healthlog/queryKey-factory": "error" },
},
]);
export default eslintConfig;