-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy patheslint.config.mjs
More file actions
32 lines (29 loc) · 996 Bytes
/
eslint.config.mjs
File metadata and controls
32 lines (29 loc) · 996 Bytes
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
import next from "eslint-config-next";
const customRules = {
"@typescript-eslint/no-explicit-any": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-unused-vars": "off",
"react/no-unknown-property": "off",
"@typescript-eslint/no-empty-interface": [
"error",
{ allowSingleExtends: true },
],
"@typescript-eslint/no-empty-object-type": "error",
// TanStack Table / React Hook Form return non-memoizable APIs; allow at project level
"react-hooks/incompatible-library": "off",
// Preserve manual memoization when deps use optional chaining
"react-hooks/preserve-manual-memoization": "warn",
};
const configs = [...next];
const tsConfigIndex = configs.findIndex(
(c) => c.plugins && c.plugins["@typescript-eslint"]
);
if (tsConfigIndex >= 0) {
configs[tsConfigIndex] = {
...configs[tsConfigIndex],
rules: { ...configs[tsConfigIndex].rules, ...customRules },
};
} else {
configs.push({ rules: customRules });
}
export default configs;