Skip to main content
Ganesh Joshi
Back to AI Rules

Explicit types and names

Updated 2026-02-13

Prefer clear names and explicit types; avoid `any` and ambiguous abbreviations; document non-obvious parameters. Use in any AI-assisted editor.

Use in Cursor, Windsurf, Codeium, or any AI-assisted editor.

Rule
# Explicit types and names

Prefer clear, explicit types and names so that code is easy to understand and maintain.

- **Types:** Use explicit types for function parameters and return values; avoid `any` and unnecessary type assertions. Place shared types in a dedicated types directory or module.
- **Names:** Use descriptive names for variables, functions, and props; avoid ambiguous abbreviations unless they are project-standard (e.g. `id`, `ctx`).
- **Documentation:** Document non-obvious parameters, return values, or invariants (e.g. units, valid ranges) in JSDoc or comments when the type system alone is not enough.
Explicit types and names | AI Rules | Ganesh Joshi