-
Notifications
You must be signed in to change notification settings - Fork 321
Expand file tree
/
Copy patheslint.config.js
More file actions
136 lines (128 loc) · 3.23 KB
/
Copy patheslint.config.js
File metadata and controls
136 lines (128 loc) · 3.23 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
import eslintConfigPrettier from "eslint-config-prettier";
import globals from "globals";
export default tseslint.config(
// Global ignores
{
ignores: [
"**/node_modules/**",
"**/dist/**",
"**/.next/**",
"**/build/**",
"**/.wrangler/**",
"**/coverage/**",
"**/.venv/**",
"**/venv/**",
"opencode-reference/**",
"**/*.d.ts",
// Bundled/generated files
"packages/modal-infra/**/*.js",
// Sandbox runtime JS/TS files run inside sandboxes (Node.js), not part of the TS project
"packages/sandbox-runtime/**",
],
},
// Base JS/TS config for all TypeScript files
js.configs.recommended,
...tseslint.configs.recommended,
// TypeScript files configuration
{
files: ["packages/**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.node,
...globals.es2022,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", fixStyle: "separate-type-imports" },
],
// Allow console in backend/server code - disable per-file if needed
"no-console": "off",
},
},
// React-specific configuration for web package
{
files: ["packages/web/**/*.{ts,tsx}"],
plugins: {
react: reactPlugin,
"react-hooks": reactHooksPlugin,
},
languageOptions: {
globals: {
...globals.browser,
React: "readonly",
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
},
},
// Cloudflare Workers specific config
{
files: ["packages/control-plane/**/*.ts"],
languageOptions: {
globals: {
...globals.worker,
WebSocketPair: "readonly",
DurableObjectState: "readonly",
DurableObjectStorage: "readonly",
DurableObjectId: "readonly",
DurableObjectNamespace: "readonly",
ExecutionContext: "readonly",
ScheduledEvent: "readonly",
},
},
},
// Root maintenance scripts run in Node.js.
{
files: ["scripts/**/*.{js,mjs,cjs,ts}"],
languageOptions: {
globals: {
...globals.node,
...globals.es2022,
},
},
rules: {
"no-console": "off",
},
},
// Test files configuration
{
files: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"no-console": "off",
},
},
// Disable rules that conflict with Prettier
eslintConfigPrettier
);