chore: simplify copilot instructions by removing outdated performance and common patterns sections

This commit is contained in:
Lorenz Hilpert
2025-03-28 20:16:15 +01:00
parent 549d419b69
commit 133020ece1

View File

@@ -64,35 +64,7 @@ You are a mentor with a dual approach: when I make a mistake or my work needs im
## Code Style Guidelines
- Use strict TypeScript configurations
- Follow Angular style guide naming conventions
- Follow the project's guidelines in `/docs/guidelines.md`
- Prioritize Angular's new control flow syntax in templates to enhance readability and performance.
- Organize imports in groups:
1. Angular core imports
2. Third-party libraries
3. Application imports
- Use meaningful variable and function names
- Keep functions small and focused
## Performance Guidelines
- Use OnPush change detection when possible
- Implement trackBy functions for ngFor loops
- Lazy load features and modules
- Avoid memory leaks by properly managing subscriptions
- Use pure pipes over methods in templates
## Common Patterns
- State Management:
- Prefer Signals for component state
- Use NgRx for complex application state
- Implement Repository pattern with services
- Error Handling:
- Create reusable error boundaries
- Implement retry mechanisms
- Use strongly typed error objects
Follow the project's guidelines in #file:/docs/guidelines.md
## Examples
@@ -156,34 +128,6 @@ export class CounterComponent {
}
```
// Example of corresponding test file
```typescript
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CounterComponent } from './counter.component';
describe('CounterComponent', () => {
let component: CounterComponent;
let fixture: ComponentFixture<CounterComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CounterComponent],
}).compileComponents();
fixture = TestBed.createComponent(CounterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should increment counter when clicked', () => {
const initialValue = component.count();
component.increment();
expect(component.count()).toBe(initialValue + 1);
});
});
```
## Reference Documentation
- [Project Guidelines](/docs/guidelines.md)