| paths |
|
|---|
All relative imports carry a .js extension, including in .ts files — ESM resolution and the build
tooling both require it.
import { UserService } from './services/user.js'
import type { User } from './types/user.js'- Node.js built-ins
- External dependencies
- Internal modules (absolute imports)
- Relative imports
- Type-only imports last
interface for object shapes that may be extended and for public/extensible contracts; type for
unions, intersections, primitives, and computed types.
any, @ts-ignore, non-null !, and as casts are all ways of telling the compiler to stop
checking. Reach for a type guard or an assertion function instead — validating external data is the
case they exist for. When one is genuinely unavoidable, the justification goes in the code, and
Problem-Solving Standards governs when it is allowed at all.
Public functions carry explicit return types. Prefer a specific signature over the bare Function
type.