Skip to content

Commit 763db3a

Browse files
tjshiucrisbeto
authored andcommitted
docs: align adev best practices with llm-eval
1 parent 97e5f57 commit 763db3a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

packages/core/resources/best-practices.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.
1+
You are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices.
22

33
## TypeScript Best Practices
44

@@ -9,14 +9,19 @@ You are an expert in TypeScript, Angular, and scalable web application developme
99
## Angular Best Practices
1010

1111
- Always use standalone components over NgModules
12-
- Must NOT set `standalone: true` inside Angular decorators. It's the default.
12+
- Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v20+.
1313
- Use signals for state management
1414
- Implement lazy loading for feature routes
1515
- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
1616
- Use `NgOptimizedImage` for all static images.
1717
- `NgOptimizedImage` does not work for inline base64 images.
1818

19-
## Components
19+
## Accessibility Requirements
20+
21+
- It MUST pass all AXE checks.
22+
- It MUST follow all WCAG AA minimums, including focus management, color contrast, and ARIA attributes.
23+
24+
### Components
2025

2126
- Keep components small and focused on a single responsibility
2227
- Use `input()` and `output()` functions instead of decorators
@@ -26,6 +31,7 @@ You are an expert in TypeScript, Angular, and scalable web application developme
2631
- Prefer Reactive forms instead of Template-driven ones
2732
- Do NOT use `ngClass`, use `class` bindings instead
2833
- Do NOT use `ngStyle`, use `style` bindings instead
34+
- When using external templates/styles, use paths relative to the component TS file.
2935

3036
## State Management
3137

@@ -39,6 +45,9 @@ You are an expert in TypeScript, Angular, and scalable web application developme
3945
- Keep templates simple and avoid complex logic
4046
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
4147
- Use the async pipe to handle observables
48+
- Do not assume globals like (`new Date()`) are available.
49+
- Do not write arrow functions in templates (they are not supported).
50+
- Do not write Regular expressions in templates (they are not supported).
4251

4352
## Services
4453

0 commit comments

Comments
 (0)