Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
48 lines (45 loc) · 2.18 KB
/
Copy patheslint.config.mjs
File metadata and controls
48 lines (45 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
{
rules: {
// A leading underscore is this codebase's existing way of saying "this
// parameter exists to satisfy a signature and is deliberately unread" —
// a mock's `(_url, _init)`, a destructure that drops a field. Honour the
// convention rather than reporting each one.
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],
// The React Compiler rule set (eslint-plugin-react-hooks 7.x, new with
// eslint-config-next 16) flags 17 sites across 11 files. Every one of them
// is a deliberate pattern carrying its own written rationale — reading
// `window` after mount so a component server-renders, writing a ref during
// render to keep an effect's deps stable, a capture fixture patching
// `window.fetch` before the first request can escape. None is a bug, and
// restructuring working components to satisfy the compiler is its own
// piece of work rather than a side effect of turning the linter on.
//
// Warnings, not "off", is the deliberate middle: these rules do catch real
// cascading-render bugs, so new code still gets told. They just do not
// block CI on a backlog that predates the linter ever running — and while
// they were errors, `npm run lint` could not become a CI gate at all.
"react-hooks/set-state-in-effect": "warn",
"react-hooks/refs": "warn",
"react-hooks/immutability": "warn",
},
},
// `.codeyam/` holds capture and scenario scripts generated by codeyam-editor,
// not project source. They are CommonJS by design and are rewritten by the
// tool, so linting them reports errors nobody can act on.
globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts", ".codeyam/**"]),
]);
export default eslintConfig;