Instruction file imported from marvinified/startzero (
.cursor/rules/typescript-imports.mdc). Copyright stays with the author.
description: TypeScript relative imports must not use .js extensions globs: **/*.{ts,tsx} alwaysApply: true
TypeScript imports
This is a TypeScript monorepo. Use extensionless relative import paths.
Do not add .js, .ts, or .mjs suffixes to local/relative imports — even in ESM "type": "module" packages or when copying Mastra/Node ESM docs.
// ❌ BAD
import { env } from "../../env.js"
import { greetingAgent } from "./agents/greeting/agent.js"
// ✅ GOOD
import { env } from "../../env"
import { greetingAgent } from "./agents/greeting/agent"
npm package imports are unchanged (zod, @mastra/core, wavesurfer.js).
Match existing workspace packages (@workspace/db, @workspace/shared): "./client", not "./client.js".
No inline type imports
Do not reference types via inline import("module").Type syntax. Use a top-level import instead.
// ❌ BAD
properties: value as import("@workspace/db").Prisma.InputJsonValue
// ✅ GOOD
import type { Prisma } from "@workspace/db"
properties: value as Prisma.InputJsonValue
This applies to workspace packages (@workspace/*) and npm packages alike. Exception: generated codegen output (e.g. packages/background/.background/, packages/ai/.ai/) may emit inline imports — do not hand-edit those files.