Files
nextcraft/eslint.config.mjs
CIAgent 4a6856711f fix(P06): final review — version literal to 0.6.5 + trailing newlines
Review verdict SHIP: purity gate PASS (22 commits: chore 8, verify 5,
docs 5, test 2, fix 1, decision 1 — zero feat:). P2-1 fixed: pyproject
+ package.json version 0.6.3 → 0.6.5 (the about-to-ship line),
reinstalled dist-info, version pins 3/3 green, ruff + mypy green.
P2-3 fixed: trailing newlines (eslint.config.mjs, helpers.ts).
P2-2 (session-sweep concurrency on shared hosts) recorded as post-hoc
note — not actionable this milestone.

---ci---
phase: 6
milestone: v0.7
status: review
---/ci---
2026-09-27 10:18:02 +00:00

80 lines
2.6 KiB
JavaScript

// ESLint flat config (v0.7 P4, D-048) — ONE config at repo root covers all
// TS workspaces; each workspace runs `eslint .` and resolves this file
// upward. Deliberately MINIMAL (the milestone goal is a working lint gate,
// not maximal strictness): js/recommended + typescript-eslint recommended
// (NON type-checked — no project-service, no type-aware rules) + the
// react-hooks CORE rules on React surfaces. Type-aware linting stays out:
// the 5 tsc projects already own that job (pnpm typecheck).
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
export default tseslint.config(
// ---- global ignores: build output + generated files only. Source,
// tests, and stories all stay in scope (stories are display-only but
// linting them is cheap).
{
ignores: [
'**/node_modules/',
'**/dist/',
'**/.next/',
'**/out/',
'**/.turbo/',
'**/coverage/',
'**/storybook-static/',
'**/.venv/',
'**/next-env.d.ts', // generated by `next dev/build`
'apps/web/css.d.ts', // generated by @tailwindcss/postcss
],
},
// ---- base: @eslint/js recommended for ALL linted files
{
...js.configs.recommended,
files: ['**/*.ts', '**/*.tsx', '**/*.mjs', '**/*.cjs'],
},
// ---- Node scripts (.mjs/.cjs): build scripts + tooling configs run in
// Node — they need process/console.
{
files: ['**/*.mjs', '**/*.cjs'],
languageOptions: {
globals: { ...globals.node },
},
},
// ---- TypeScript: recommended, non type-checked (fast — no program needed)
{
files: ['**/*.ts', '**/*.tsx'],
extends: [tseslint.configs.recommended],
languageOptions: {
globals: { ...globals.node },
},
},
// ---- React hooks: the CORE rules (rules-of-hooks, exhaustive-deps) on
// web + ui, ts AND tsx (hook files like use-sandbox-session.ts live in
// .ts). eslint-plugin-react-hooks v7's `recommended` preset additionally
// bundles the React-Compiler-era rules (purity, immutability,
// set-state-in-effect, ...) which fire on shipped components; this gate
// intentionally takes only the two core rules — the milestone goal is a
// working lint gate, not maximal strictness (D-048).
{
files: [
'apps/web/**/*.ts',
'apps/web/**/*.tsx',
'packages/ui/**/*.ts',
'packages/ui/**/*.tsx',
],
plugins: { 'react-hooks': reactHooks },
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
},
);