diff --git a/CLAUDE.md b/CLAUDE.md index 11af543bb..17199c0f3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -118,6 +118,8 @@ Yarn provides "prefixed" scripts using the `:` pattern. Scripts l - **No `any` or `as` casts**: Don't use `any` types or `as` type assertions as an escape hatch. Instead use patterns the repo already follows: import types directly from external packages (e.g. `import type { UserConfig } from 'vite'`), use `typeof`/`instanceof`/`in` guards for narrowing (see `wrapPlugins.ts`), derive types from constants with `(typeof MY_CONST)[number]`, or use constrained generics (``). If you think you need `any`, something is wrong. - **No TypeScript suppression comments**: Don't use `@ts-ignore`, `@ts-expect-error`, or `@ts-nocheck` to suppress type errors. Fix the underlying type issue instead. +- **No same-line comments**: Don't put comments on the same line as code. Put comments on the line above the code they describe so code and explanation stay visually separate. +- **No inlined function-call arguments**: Don't pass a function call directly as an argument to another function call. Assign the inner call to a well-named local variable first, then pass that variable to the outer call. - **Use existing repo utilities**: Before writing new helpers, check what already exists: - HTTP requests: `@dd/core/helpers/request` (not raw `fetch`) - File operations: `@dd/core/helpers/fs` (not `fs/promises` directly)