Instruction file imported from RKR-3442/innovation-study-guide (
.github/instructions/coding-standards.instructions.md). Copyright stays with the author.
Coding Standards
TypeScript / JavaScript
strict: truein tsconfig — no exceptions- No
any— if you must use it, add a comment:// eslint-disable-next-line @typescript-eslint/no-explicit-any — reason - Prefer
constoverlet; never usevar async/awaitalways — never raw.then()/.catch()chains- Explicit return types on all public functions
- Destructure objects at function parameters where ≥3 properties are used
- Named exports preferred over default exports (better refactoring support)
- No barrel files (
index.tsre-exporting everything) in deeply nested modules
Python
- Type hints on all function signatures (PEP 484)
- Docstrings: Google style for public functions
dataclassesorpydanticfor data containers — no plain dicts as function return valuespathlib.Pathnotos.path- f-strings not
.format()or%
Rust
clippymust pass with no warningsunwrap()only in tests — use?or explicit error handling in production code- Derive
Debugon all public structs
Universal Rules
- Functions: single responsibility, max ~50 lines — split if larger
- Naming: descriptive, intention-revealing (
getUserByIdnotgetUserorg) - Comments: explain why, never what
- No dead code: remove unused imports, variables, functions before committing
- No magic numbers: name your constants (
const MAX_RETRY_COUNT = 3) - No TODO without issue reference:
// TODO(#123): description - Conventional commits:
type(scope): description