Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | { |
| 2 | "$schema": "./node_modules/oxlint/configuration_schema.json", |
| 3 | // Ported from eslint.config.mjs (see git history). Native oxlint rules cover |
| 4 | // everything except no-restricted-syntax, which runs through the |
| 5 | // oxlint-plugin-eslint JS plugin as eslint-js/no-restricted-syntax. |
| 6 | "plugins": ["typescript", "unicorn", "oxc"], |
| 7 | "jsPlugins": [ |
| 8 | { "name": "eslint-js", "specifier": "oxlint-plugin-eslint" }, |
| 9 | { "name": "composio-effect", "specifier": "./tools/oxlint/effect/index.ts" } |
| 10 | ], |
| 11 | "categories": { |
| 12 | "correctness": "error" |
| 13 | }, |
| 14 | "env": { |
| 15 | "browser": true |
| 16 | }, |
| 17 | "ignorePatterns": [ |
| 18 | "**/.venv/**", |
| 19 | "**/.next/**", |
| 20 | "**/dist/**", |
| 21 | "**/site-packages/**", |
| 22 | // The docs site has its own Bun dependency tree and nested oxlint config. |
| 23 | "docs/**", |
| 24 | "ts/vendor/**", |
| 25 | "ts/packages/core/generated/**", |
| 26 | "ts/packages/core/pack/generated/**", |
| 27 | "ts/packages/slim/generated/**", |
| 28 | "ts/packages/**/.generated/**", |
| 29 | "node_modules/**", |
| 30 | "ts/examples/**/dist-worker/**", |
| 31 | "ts/examples/cloudflare-wrangler/worker-configuration.d.ts", |
| 32 | // ESLint only linted .ts/.tsx (--ext .ts,.tsx); keep that scope. |
| 33 | "**/*.js", |
| 34 | "**/*.mjs", |
| 35 | "**/*.cjs", |
| 36 | "**/*.jsx" |
| 37 | ], |
| 38 | "rules": { |
| 39 | // tseslint.configs.recommended rules that oxlint's correctness category |
| 40 | // does not enable by default; re-enabled explicitly to keep the migration |
| 41 | // behavior-preserving in this direction too. |
| 42 | "typescript/no-namespace": "error", |
| 43 | "no-array-constructor": "error", |
| 44 | "typescript/no-unnecessary-type-constraint": "error", |
| 45 | // Rules oxlint enables by default that the previous ESLint setup did not |
| 46 | // enforce. Turned off to keep the migration behavior-preserving; each is a |
| 47 | // candidate to enable (and burn down) in a follow-up. |
| 48 | "no-useless-escape": "off", |
| 49 | "no-control-regex": "off", |
| 50 | "no-useless-catch": "off", |
| 51 | "typescript/no-unnecessary-parameter-property-assignment": "off", |
| 52 | "unicorn/no-useless-spread": "off", |
| 53 | "unicorn/no-useless-fallback-in-spread": "off", |
| 54 | "unicorn/no-thenable": "off", |
| 55 | "unicorn/no-empty-file": "off", |
| 56 | "no-restricted-globals": ["error", "Buffer"], |
| 57 | "no-restricted-imports": [ |
| 58 | "error", |
| 59 | { |
| 60 | "paths": [ |
| 61 | { "name": "crypto", "message": "Use Web Crypto API instead." }, |
| 62 | { "name": "node:crypto", "message": "Use Web Crypto API instead." }, |
| 63 | { "name": "buffer", "message": "Use Uint8Array instead." }, |
| 64 | { "name": "node:buffer", "message": "Use Uint8Array instead." } |
| 65 | ] |
| 66 | } |
| 67 | ], |
| 68 | "typescript/no-require-imports": "warn", |
| 69 | "typescript/no-unsafe-function-type": "off", |
| 70 | "no-prototype-builtins": "off", |
| 71 | "max-lines-per-function": ["error", 250], |
| 72 | "typescript/ban-ts-comment": "warn", |
| 73 | "no-constant-condition": "off", |
| 74 | "no-ex-assign": "off", |
| 75 | "no-constant-binary-expression": "off", |
| 76 | "typescript/no-empty-object-type": "warn", |
| 77 | "typescript/no-non-null-asserted-optional-chain": "off", |
| 78 | "no-unsafe-optional-chaining": "off", |
| 79 | "no-extra-boolean-cast": "off", |
| 80 | "no-var": "warn", |
| 81 | "prefer-const": "warn", |
| 82 | "no-console": "warn", |
| 83 | "typescript/no-explicit-any": "error", |
| 84 | "no-unused-vars": [ |
| 85 | "warn", |
| 86 | { |
| 87 | "argsIgnorePattern": "^_", |
| 88 | "varsIgnorePattern": "^_", |
| 89 | "caughtErrorsIgnorePattern": "^_" |
| 90 | } |
| 91 | ] |
| 92 | }, |
| 93 | "overrides": [ |
| 94 | { |
| 95 | // These files still enforce the repository-wide no-any rule, but are |
| 96 | // exempt from source-only policies that do not fit test helpers, large |
| 97 | // suites, scripts, fixtures, or ambient declarations. |
| 98 | "files": [ |
| 99 | "**/__fixtures__/**/*.{ts,tsx,mts,cts}", |
| 100 | "**/__mocks__/**/*.{ts,tsx,mts,cts}", |
| 101 | "**/fixtures/**/*.{ts,tsx,mts,cts}", |
| 102 | "scripts/**/*.{ts,tsx,mts,cts}", |
| 103 | "test/**/*.{ts,tsx,mts,cts}", |
| 104 | "ts/e2e-tests/**/*.{ts,tsx,mts,cts}", |
| 105 | "ts/packages/**/test/**/*.{ts,tsx,mts,cts}", |
| 106 | "ts/packages/**/*.d.ts", |
| 107 | "ts/scripts/**/*.{ts,tsx,mts,cts}" |
| 108 | ], |
| 109 | "rules": { |
| 110 | "max-lines-per-function": "off", |
| 111 | "no-console": "off", |
| 112 | "no-restricted-globals": "off", |
| 113 | "no-restricted-imports": "off", |
| 114 | "no-unused-vars": "off", |
| 115 | "prefer-const": "off", |
| 116 | "require-yield": "off", |
| 117 | "typescript/ban-ts-comment": "off", |
| 118 | "typescript/no-empty-object-type": "off", |
| 119 | "typescript/no-namespace": "off" |
| 120 | } |
| 121 | }, |
| 122 | { |
| 123 | "files": ["ts/packages/cli/src/**/*.{ts,tsx}"], |
| 124 | "excludeFiles": [ |
| 125 | "**/*.test.*", |
| 126 | "**/*.spec.*", |
| 127 | "**/__tests__/**", |
| 128 | "**/test/**", |
| 129 | "**/tests/**", |
| 130 | "**/__fixtures__/**", |
| 131 | "**/fixtures/**", |
| 132 | "**/generated/**", |
| 133 | "**/.generated/**" |
| 134 | ], |
| 135 | "rules": { |
| 136 | "composio-effect/require-cause-when-narrowing": "error", |
| 137 | "composio-effect/no-ordie-in-service-construction": "error" |
| 138 | } |
| 139 | }, |
| 140 | { |
| 141 | "files": ["ts/packages/cli/src/**/*.{ts,tsx}"], |
| 142 | "rules": { |
| 143 | "no-restricted-imports": [ |
| 144 | "error", |
| 145 | { |
| 146 | "paths": [ |
| 147 | { "name": "crypto", "message": "Use Web Crypto API instead." }, |
| 148 | { "name": "node:crypto", "message": "Use Web Crypto API instead." }, |
| 149 | { "name": "buffer", "message": "Use Uint8Array instead." }, |
| 150 | { "name": "node:buffer", "message": "Use Uint8Array instead." }, |
| 151 | { |
| 152 | "name": "child_process", |
| 153 | "message": "Use ChildProcess from effect/process instead." |
| 154 | }, |
| 155 | { |
| 156 | "name": "node:child_process", |
| 157 | "message": "Use ChildProcess from effect/process instead." |
| 158 | }, |
| 159 | { |
| 160 | "name": "fs", |
| 161 | "message": "Use FileSystem from effect/FileSystem instead." |
| 162 | }, |
| 163 | { |
| 164 | "name": "node:fs", |
| 165 | "message": "Use FileSystem from effect/FileSystem instead." |
| 166 | }, |
| 167 | { |
| 168 | "name": "os", |
| 169 | "message": "Use an Effect service instead of importing node:os directly." |
| 170 | }, |
| 171 | { |
| 172 | "name": "node:os", |
| 173 | "message": "Use an Effect service instead of importing node:os directly." |
| 174 | }, |
| 175 | { "name": "path", "message": "Use Path from effect/Path instead." }, |
| 176 | { "name": "node:path", "message": "Use Path from effect/Path instead." }, |
| 177 | { |
| 178 | "name": "@effect/platform-bun", |
| 179 | "message": "Import the module by subpath, e.g. @effect/platform-bun/BunFileSystem; the package barrel is not part of the Effect v4 layout." |
| 180 | }, |
| 181 | { |
| 182 | "name": "@composio/client", |
| 183 | "allowTypeImports": true, |
| 184 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 185 | }, |
| 186 | { |
| 187 | "name": "@composio/client/pagination", |
| 188 | "allowTypeImports": true, |
| 189 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 190 | }, |
| 191 | { |
| 192 | "name": "@composio/client/pagination.js", |
| 193 | "allowTypeImports": true, |
| 194 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 195 | }, |
| 196 | { |
| 197 | "name": "@composio/client/pagination.mjs", |
| 198 | "allowTypeImports": true, |
| 199 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 200 | }, |
| 201 | { |
| 202 | "name": "@composio/client/effect", |
| 203 | "importNames": ["make", "layer", "layerConfig", "layerFetch"], |
| 204 | "message": "Get the client from ComposioClientSingleton, which scopes it to the user, org and project and counts its requests." |
| 205 | } |
| 206 | ], |
| 207 | "patterns": [ |
| 208 | { |
| 209 | "group": ["fs/*", "node:fs/*"], |
| 210 | "message": "Use FileSystem from effect/FileSystem instead." |
| 211 | } |
| 212 | ] |
| 213 | } |
| 214 | ], |
| 215 | "eslint-js/no-restricted-syntax": [ |
| 216 | "error", |
| 217 | { |
| 218 | "selector": "MemberExpression[property.name='Do']", |
| 219 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 220 | }, |
| 221 | { |
| 222 | "selector": "MemberExpression[object.name=/^(Effect|Arr|Array|Option|Result|Stream)$/][property.name=/^(bind|bindTo|let)$/]", |
| 223 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 224 | }, |
| 225 | { |
| 226 | "selector": "TryStatement", |
| 227 | "message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch." |
| 228 | }, |
| 229 | { |
| 230 | "selector": "MemberExpression[object.name='process'][computed=false][property.name='env']", |
| 231 | "message": "Read environment variables through effect/Config instead of process.env." |
| 232 | }, |
| 233 | { |
| 234 | "selector": "MemberExpression[object.name='process'][computed=true][property.value='env']", |
| 235 | "message": "Read environment variables through effect/Config instead of process.env." |
| 236 | }, |
| 237 | { |
| 238 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']", |
| 239 | "message": "Read environment variables through effect/Config instead of process.env." |
| 240 | }, |
| 241 | { |
| 242 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']", |
| 243 | "message": "Read environment variables through effect/Config instead of process.env." |
| 244 | }, |
| 245 | { |
| 246 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 247 | "message": "Read environment variables through effect/Config instead of process.env." |
| 248 | }, |
| 249 | { |
| 250 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 251 | "message": "Read environment variables through effect/Config instead of process.env." |
| 252 | }, |
| 253 | { |
| 254 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 255 | "message": "Read environment variables through effect/Config instead of process.env." |
| 256 | }, |
| 257 | { |
| 258 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 259 | "message": "Read environment variables through effect/Config instead of process.env." |
| 260 | }, |
| 261 | { |
| 262 | "selector": "MemberExpression[object.name='process'][property.name='stdout']", |
| 263 | "message": "Write output and read terminal capabilities through TerminalUI." |
| 264 | }, |
| 265 | { |
| 266 | "selector": "MemberExpression[object.name='process'][property.name='stderr']", |
| 267 | "message": "Write errors and read terminal capabilities through TerminalUI." |
| 268 | } |
| 269 | ] |
| 270 | } |
| 271 | }, |
| 272 | { |
| 273 | "files": ["ts/packages/cli/test/src/**/*.{ts,tsx}"], |
| 274 | "rules": { |
| 275 | "max-lines-per-function": "off", |
| 276 | "eslint-js/no-restricted-syntax": [ |
| 277 | "error", |
| 278 | { |
| 279 | "selector": "MemberExpression[property.name='Do']", |
| 280 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 281 | }, |
| 282 | { |
| 283 | "selector": "MemberExpression[object.name=/^(Effect|Arr|Array|Option|Result|Stream)$/][property.name=/^(bind|bindTo|let)$/]", |
| 284 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 285 | }, |
| 286 | { |
| 287 | "selector": ":matches(ForStatement, ForInStatement, ForOfStatement)", |
| 288 | "message": "No for loops in tests: parameterize with it.each/describe.each, and use array methods in helpers." |
| 289 | }, |
| 290 | { |
| 291 | "selector": "MemberExpression[object.name='Effect'][property.name=/^run/]", |
| 292 | "message": "Run Effects through @effect/vitest (it.effect, it.live) instead of Effect.run* in tests." |
| 293 | }, |
| 294 | { |
| 295 | "selector": "CallExpression[callee.object.name='Date'][callee.property.name='now']", |
| 296 | "message": "Tests must be deterministic: pin time with vi.setSystemTime / TestClock-relative fixtures, use crypto.randomUUID() for unique names." |
| 297 | } |
| 298 | ] |
| 299 | } |
| 300 | }, |
| 301 | { |
| 302 | "files": ["ts/packages/cli/src/services/tool-input-validation.ts"], |
| 303 | "rules": { |
| 304 | "no-restricted-imports": [ |
| 305 | "error", |
| 306 | { |
| 307 | "paths": [ |
| 308 | { "name": "crypto", "message": "Use Web Crypto API instead." }, |
| 309 | { "name": "node:crypto", "message": "Use Web Crypto API instead." }, |
| 310 | { "name": "buffer", "message": "Use Uint8Array instead." }, |
| 311 | { "name": "node:buffer", "message": "Use Uint8Array instead." }, |
| 312 | { |
| 313 | "name": "child_process", |
| 314 | "message": "Use ChildProcess from effect/process instead." |
| 315 | }, |
| 316 | { |
| 317 | "name": "node:child_process", |
| 318 | "message": "Use ChildProcess from effect/process instead." |
| 319 | }, |
| 320 | { |
| 321 | "name": "fs", |
| 322 | "message": "Use FileSystem from effect/FileSystem instead." |
| 323 | }, |
| 324 | { |
| 325 | "name": "node:fs", |
| 326 | "message": "Use FileSystem from effect/FileSystem instead." |
| 327 | }, |
| 328 | { |
| 329 | "name": "os", |
| 330 | "message": "Use an Effect service instead of importing node:os directly." |
| 331 | }, |
| 332 | { |
| 333 | "name": "node:os", |
| 334 | "message": "Use an Effect service instead of importing node:os directly." |
| 335 | }, |
| 336 | { "name": "path", "message": "Use Path from effect/Path instead." }, |
| 337 | { "name": "node:path", "message": "Use Path from effect/Path instead." }, |
| 338 | { |
| 339 | "name": "@effect/platform-bun", |
| 340 | "message": "Import the module by subpath, e.g. @effect/platform-bun/BunFileSystem; the package barrel is not part of the Effect v4 layout." |
| 341 | }, |
| 342 | { |
| 343 | "name": "@composio/client", |
| 344 | "allowTypeImports": true, |
| 345 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 346 | }, |
| 347 | { |
| 348 | "name": "@composio/client/pagination", |
| 349 | "allowTypeImports": true, |
| 350 | "message": "Call the API through the client from @composio/client/effect, obtained from ComposioClientSingleton. Type-only imports are allowed." |
| 351 | }, |
| 352 | { "name": "zod", "message": "Use Schema from effect for tool input validation." } |
| 353 | ], |
| 354 | "patterns": [ |
| 355 | { |
| 356 | "group": ["fs/*", "node:fs/*"], |
| 357 | "message": "Use FileSystem from effect/FileSystem instead." |
| 358 | }, |
| 359 | { "group": ["zod/*"], "message": "Use Schema from effect for tool input validation." } |
| 360 | ] |
| 361 | } |
| 362 | ], |
| 363 | "eslint-js/no-restricted-syntax": [ |
| 364 | "error", |
| 365 | { |
| 366 | "selector": "MemberExpression[property.name='Do']", |
| 367 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 368 | }, |
| 369 | { |
| 370 | "selector": "MemberExpression[object.name=/^(Effect|Arr|Array|Option|Result|Stream)$/][property.name=/^(bind|bindTo|let)$/]", |
| 371 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 372 | }, |
| 373 | { |
| 374 | "selector": "TryStatement", |
| 375 | "message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch." |
| 376 | }, |
| 377 | { |
| 378 | "selector": "MemberExpression[object.name='process'][computed=false][property.name='env']", |
| 379 | "message": "Read environment variables through effect/Config instead of process.env." |
| 380 | }, |
| 381 | { |
| 382 | "selector": "MemberExpression[object.name='process'][computed=true][property.value='env']", |
| 383 | "message": "Read environment variables through effect/Config instead of process.env." |
| 384 | }, |
| 385 | { |
| 386 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']", |
| 387 | "message": "Read environment variables through effect/Config instead of process.env." |
| 388 | }, |
| 389 | { |
| 390 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']", |
| 391 | "message": "Read environment variables through effect/Config instead of process.env." |
| 392 | }, |
| 393 | { |
| 394 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 395 | "message": "Read environment variables through effect/Config instead of process.env." |
| 396 | }, |
| 397 | { |
| 398 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 399 | "message": "Read environment variables through effect/Config instead of process.env." |
| 400 | }, |
| 401 | { |
| 402 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 403 | "message": "Read environment variables through effect/Config instead of process.env." |
| 404 | }, |
| 405 | { |
| 406 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 407 | "message": "Read environment variables through effect/Config instead of process.env." |
| 408 | }, |
| 409 | { |
| 410 | "selector": "MemberExpression[object.name='process'][property.name='stdout']", |
| 411 | "message": "Write output and read terminal capabilities through TerminalUI." |
| 412 | }, |
| 413 | { |
| 414 | "selector": "MemberExpression[object.name='process'][property.name='stderr']", |
| 415 | "message": "Write errors and read terminal capabilities through TerminalUI." |
| 416 | }, |
| 417 | { |
| 418 | "selector": "ImportExpression[source.value=/^zod(?:\\/|$)/]", |
| 419 | "message": "Use Schema from effect for tool input validation." |
| 420 | }, |
| 421 | { |
| 422 | "selector": "CallExpression[callee.name='require'][arguments.0.value=/^zod(?:\\/|$)/]", |
| 423 | "message": "Use Schema from effect for tool input validation." |
| 424 | } |
| 425 | ] |
| 426 | } |
| 427 | }, |
| 428 | { |
| 429 | "files": ["ts/packages/cli/src/services/terminal-ui.ts"], |
| 430 | "rules": { |
| 431 | // TerminalUI is the sole CLI boundary for Node's stdout and stderr streams. |
| 432 | "eslint-js/no-restricted-syntax": [ |
| 433 | "error", |
| 434 | { |
| 435 | "selector": "MemberExpression[property.name='Do']", |
| 436 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 437 | }, |
| 438 | { |
| 439 | "selector": "MemberExpression[object.name=/^(Effect|Arr|Array|Option|Result|Stream)$/][property.name=/^(bind|bindTo|let)$/]", |
| 440 | "message": "Do notation is banned: use Effect.gen, or plain map/flatMap." |
| 441 | }, |
| 442 | { |
| 443 | "selector": "TryStatement", |
| 444 | "message": "Use Effect.try, Effect.tryPromise, or typed Effect error recovery instead of try/catch." |
| 445 | }, |
| 446 | { |
| 447 | "selector": "MemberExpression[object.name='process'][computed=false][property.name='env']", |
| 448 | "message": "Read environment variables through effect/Config instead of process.env." |
| 449 | }, |
| 450 | { |
| 451 | "selector": "MemberExpression[object.name='process'][computed=true][property.value='env']", |
| 452 | "message": "Read environment variables through effect/Config instead of process.env." |
| 453 | }, |
| 454 | { |
| 455 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.name='env']", |
| 456 | "message": "Read environment variables through effect/Config instead of process.env." |
| 457 | }, |
| 458 | { |
| 459 | "selector": "VariableDeclarator[init.name='process'] > ObjectPattern > Property[key.value='env']", |
| 460 | "message": "Read environment variables through effect/Config instead of process.env." |
| 461 | }, |
| 462 | { |
| 463 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 464 | "message": "Read environment variables through effect/Config instead of process.env." |
| 465 | }, |
| 466 | { |
| 467 | "selector": "AssignmentExpression[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 468 | "message": "Read environment variables through effect/Config instead of process.env." |
| 469 | }, |
| 470 | { |
| 471 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.name='env']", |
| 472 | "message": "Read environment variables through effect/Config instead of process.env." |
| 473 | }, |
| 474 | { |
| 475 | "selector": "AssignmentPattern[right.name='process'] > ObjectPattern > Property[key.value='env']", |
| 476 | "message": "Read environment variables through effect/Config instead of process.env." |
| 477 | } |
| 478 | ] |
| 479 | } |
| 480 | }, |
| 481 | { |
| 482 | // The JSON Schema semantics of the Zod converter are written once over |
| 483 | // an opaque schema type. Only the backends, the public type aliases, and |
| 484 | // the two entry modules speak Zod. |
| 485 | "files": [ |
| 486 | "ts/packages/json-schema-to-zod/src/parsers/**/*.ts", |
| 487 | "ts/packages/json-schema-to-zod/src/utils/**/*.ts", |
| 488 | "ts/packages/json-schema-to-zod/src/convert.ts", |
| 489 | "ts/packages/json-schema-to-zod/src/context.ts", |
| 490 | "ts/packages/json-schema-to-zod/src/annotations.ts", |
| 491 | "ts/packages/json-schema-to-zod/src/whole-schema-validation.ts" |
| 492 | ], |
| 493 | "rules": { |
| 494 | "no-restricted-imports": [ |
| 495 | "error", |
| 496 | { |
| 497 | "paths": [ |
| 498 | { "name": "crypto", "message": "Use Web Crypto API instead." }, |
| 499 | { "name": "node:crypto", "message": "Use Web Crypto API instead." }, |
| 500 | { "name": "buffer", "message": "Use Uint8Array instead." }, |
| 501 | { "name": "node:buffer", "message": "Use Uint8Array instead." }, |
| 502 | { |
| 503 | "name": "zod", |
| 504 | "message": "Shared converter code calls the backend on the parse context; only src/backend/** may import Zod." |
| 505 | } |
| 506 | ], |
| 507 | "patterns": [ |
| 508 | { |
| 509 | "group": ["zod/*"], |
| 510 | "message": "Shared converter code calls the backend on the parse context; only src/backend/** may import Zod." |
| 511 | } |
| 512 | ] |
| 513 | } |
| 514 | ] |
| 515 | } |
| 516 | }, |
| 517 | { |
| 518 | // Examples are console-driven references. Keep type-safety rules |
| 519 | // (no-explicit-any, unused-vars) but drop console noise. The Buffer/crypto |
| 520 | // restrictions above target SDK/Workers source; Node example scripts may |
| 521 | // legitimately use Node built-ins, so relax them here (see KTD6). |
| 522 | "files": ["ts/examples/**/*.ts"], |
| 523 | "rules": { |
| 524 | "no-console": "off", |
| 525 | "no-restricted-globals": "off", |
| 526 | "no-restricted-imports": "off" |
| 527 | } |
| 528 | }, |
| 529 | { |
| 530 | // This factory intentionally assembles the complete pi session-tool surface |
| 531 | // in one closure so every hook shares the same normalized capabilities. |
| 532 | "files": ["ts/packages/experimental/src/pi/session-tools.ts"], |
| 533 | "rules": { |
| 534 | "max-lines-per-function": "off" |
| 535 | } |
| 536 | }, |
| 537 | { |
| 538 | // The Cloudflare Workers entry stays portable: no Node globals even though |
| 539 | // nodejs_compat is enabled. Re-apply the restriction dropped just above. |
| 540 | "files": ["ts/examples/**/cloudflare.ts"], |
| 541 | "rules": { |
| 542 | "no-restricted-globals": ["error", "Buffer"] |
| 543 | } |
| 544 | } |
| 545 | ] |
| 546 | } |