Common rules¶
Copy of
sumaris-app/.agents/rules/common.md(rule written for AI coding agents, always applied). Do not edit here: runnpm run site:sync-rulesto update it.
- Write comments and console log in English;
- Write unit test when possible, using Jasmine;
- Write components without the
.components.<extension>suffix. Use functional suffix instead:.page.<extension>for a page (should extendAppEntityEditoror subclasses);.form.<extension>for a reusable reactive form component (should extendAppForm- or subclasses);.table.<extension>for a reusable table component (should extendAppTableorAppSyncTabke- or subclasses);.service.tsfor services;.class.tsfor abstract classes;.utils.tsfor helper classes or useful functions;.config.tsfor enumerations (configuration option, ...);
- Use Ionic components when possible, or Angular Material components;
- Use Ionic icons (
<ion-icon>or Material icons (mat-icon- old version); - Use
changeDetection: ChangeDetectionStrategy.OnPushfor components; - By default, use standard Angular 21 conventions (e.g. prefer modern conditions like
@ifor@for, instead of*ngIfor*ngFor); - Prefer
inject()(as a class field, declared above the constructor) over constructor-parameter injection for services and other dependencies — this is the convention used across the codebase since the Angular 21 migration;