- Strict typing
- Use
typeinstead ofinterfacefor type definitions - Never cast types using
const x = y as unknown as SomeTypepatterns - Allow non-null assertions (
!), but document why it's justified - Do not add return type annotation to React components
- External libraries
@skybrushlibraries- Internal modules with
~/(alias for./src/*) - Relative imports
- Named exports for utilities and non-React components
- Default export for React components
- Use function components declared with
const Comp = () => {}pattern - Prop types defined as TypeScript types
- Redux-connected components: non-connected version with a standard name, connected component with "Connected" prefix
- Avoid complex UI sections within a component
- All UI text must be internationalized
- Never concatenate translated strings, use interpolation in the i18n resource
- Redux Toolkit patterns
- Non-trivial selectors with
createSelector
Never (unless told to):
- Build or run the project
- Run or add tests
- Output explanations or unnecessary code snippets
Always:
- Fully understand the task and the related code before getting to work
- If something is unclear, ask for input
- Follow clean code principles
- Be succint