-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
79 lines (69 loc) · 1.83 KB
/
Copy path.eslintrc.cjs
File metadata and controls
79 lines (69 loc) · 1.83 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* Minimal ESLint configuration for a TypeScript + React (Vite) project.
Lint script already exists in package.json:
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
*/
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2021: true,
},
ignorePatterns: [
"dist/**",
"node_modules/**",
"bun.lockb",
// generated assets and build outputs
"**/*.d.ts",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
// If you later want type-aware rules, add:
// project: ['./tsconfig.json'],
// tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint", "react-hooks", "react-refresh"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
rules: {
// Keep console noise down in production, but allow warnings/errors
"no-console": "off",
// Prefer TS-aware unused checks
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
// React hooks deps warnings are too noisy for this codebase; handled manually
"react-hooks/exhaustive-deps": "off",
},
overrides: [
// JavaScript/CommonJS files (e.g., scripts/*.cjs)
{
files: ["**/*.cjs", "**/*.js"],
parser: "espree",
env: {
node: true,
},
rules: {
// JS files don't use TS rules
"@typescript-eslint/no-unused-vars": "off",
},
},
// Allow limited 'any' usage in specific utility files
{
files: [
"client/interface/utils/scrolling.ts",
"client/interface/components/StoryMinimap.tsx",
],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
],
};