-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
79 lines (73 loc) · 2.26 KB
/
Copy patheslint.config.mjs
File metadata and controls
79 lines (73 loc) · 2.26 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
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import prettier from "eslint-config-prettier";
/** @type {import('eslint').Linter.Config[]} */
export default [
// Global ignores
{ignores: ["infrastructure/**", "scripts/**", "dist/**", "node_modules/**"]},
// Main source files
{
files: ["src/**/*.{ts,js}"],
ignores: ["src/__tests__/**", "**/*.test.ts", "src/mcp/**"],
languageOptions: { globals: {...globals.browser, ...globals.node} },
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
files: ["src/**/*.{ts,js}"],
ignores: ["src/__tests__/**", "**/*.test.ts", "src/mcp/**"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error"
}
},
// Test files - separate tsconfig
{
files: ["src/__tests__/**/*.ts", "**/*.test.ts"],
languageOptions: {
globals: {...globals.node},
parserOptions: {
project: "./tsconfig.test.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
// Disable unsafe rules for test files due to Node.js test runner lacking proper types
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/require-await": "off"
}
},
// MCP servers - separate tsconfig
{
files: ["src/mcp/**/*.ts"],
languageOptions: {
globals: {...globals.node},
parserOptions: {
project: "./tsconfig.mcp.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-misused-promises": "error",
"@typescript-eslint/require-await": "off"
}
},
prettier, // Must be last to disable conflicting formatting rules
];