- Always use explicit types for function arguments, return values, and variables.
- Avoid using
any
. Useunknown
or proper generics if type is uncertain. - Prefer interfaces over types for object shapes, especially for props and state.
- Use enums or union types for fixed sets of values.
- Use functional components and React hooks. Avoid class components unless necessary.