Skip to content

Commit 9542f0d

Browse files
committed
MOBILE-5004 ai: Rewrite negative sentences
1 parent a1b7f9f commit 9542f0d

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.github/copilot-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Services are NOT Angular-managed singletons. Use the `makeSingleton` pattern:
1212
export class MyService { }
1313
export const My = makeSingleton(MyService);
1414
```
15-
Import from `@singletons` for platform APIs, never directly from `@angular/core` or Ionic.
15+
Import from `@singletons` for platform APIs, only import directly from `@angular/core` or Ionic when necessary.
1616

1717
### Delegate Pattern for Extensibility
1818
The codebase uses delegates extensively to allow addons to register handlers:
@@ -154,10 +154,10 @@ Define tables with columns, indexes in site schemas. Version increments trigger
154154

155155
## Common Pitfalls
156156

157-
1. **Don't** inject Angular services directly - use singletons via `@singletons`
158-
2. **Don't** use `@NgModule({ declarations: [] })` for new modules - use standalone components
159-
3. **Don't** forget to register handlers in `provideAppInitializer`
160-
4. **Don't** import from barrel files that aren't configured in `tsconfig.json` paths
157+
1. Always use singletons via `@singletons` instead of injecting Angular services directly
158+
2. Use standalone components for new modules instead of `@NgModule({ declarations: [] })`
159+
3. Always register handlers in `provideAppInitializer`
160+
4. Import only from barrel files that are configured in `tsconfig.json` paths
161161
5. **Do** run `gulp` before testing to ensure lang files are built
162162
6. **Do** use `CoreSitesReadingStrategy` when fetching data to control cache vs network behavior
163163

.github/instructions/angular.instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Instructions for generating high-quality Angular applications with TypeScript, u
4848
### State Management
4949
- Use Angular Signals for reactive state management in components and services
5050
- Leverage `signal()`, `computed()`, and `effect()` for reactive state updates
51-
- We won't use any experimental features of Angular Signals such as `resource()`
51+
- Use only stable features of Angular Signals and exclude experimental features such as `resource()`
5252
- Use writable signals for mutable state and computed signals for derived state
5353
- Handle loading and error states with signals and proper UI feedback
5454
- Use Angular's `AsyncPipe` to handle observables in templates when combining signals with RxJS
@@ -64,7 +64,7 @@ Instructions for generating high-quality Angular applications with TypeScript, u
6464
- Sanitise user inputs using Angular's built-in sanitisation
6565
- Implement route guards for authentication and authorisation
6666
- Validate form inputs with Angular's reactive forms and custom validators
67-
- Follow Angular's security best practices (e.g., avoid direct DOM manipulation)
67+
- Follow Angular's security best practices by using Angular APIs instead of direct DOM manipulation
6868

6969
### Performance
7070
- Enable production builds with `npm run build:prod` for optimisation

.github/instructions/nodejs-ts-jest.instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ applyTo: '**/*.test.ts'
77

88
## Coding standards
99
- Use TypeScript with ES2022 features and Node.js (version defined in .nvmrc) ESM modules
10-
- Use Node.js built-in modules and avoid external dependencies where possible
11-
- Ask the user if you require any additional dependencies before adding them
10+
- Use Node.js built-in modules and minimise external dependencies where possible
11+
- Ask the user before adding any additional dependencies
1212
- Always use async/await for asynchronous code, and use 'node:util' promisify function to avoid callbacks
1313
- Keep the code simple and maintainable
1414
- Use descriptive variable and function names
15-
- Do not add comments unless absolutely necessary, the code should be self-explanatory
16-
- Never use `null`, always use `undefined` for optional values
15+
- Write code that is self-explanatory, so comments are only needed when absolutely necessary
16+
- Use `undefined` for optional values instead of `null`
1717
- Prefer functions over classes
1818

1919
## Testing
2020
- Use Jest for testing
2121
- It's recommended to write tests for all new features and bug fixes
2222
- Ensure tests cover edge cases and error handling
23-
- NEVER change the original code to make it easier to test, instead, write tests that cover the original code as it is
23+
- Always write tests that cover the original code as it is, without changing the original code for testability
2424

2525
## User interactions
2626
- Ask questions if you are unsure about the implementation details, design choices, or need clarification on the requirements

.github/instructions/typescript-5-es2021.instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ applyTo: '**/*.ts'
1515
## General Guardrails
1616

1717
- Target TypeScript 5.x / ES2021 and prefer native features over polyfills.
18-
- Use pure ES modules; never emit `require`, `module.exports`, or CommonJS helpers.
18+
- Use pure ES modules; always emit only ES module syntax, not `require`, `module.exports`, or CommonJS helpers.
1919
- Rely on the project's build, lint, and test scripts unless asked otherwise.
2020
- Note design trade-offs when intent is not obvious.
2121

@@ -25,7 +25,7 @@ applyTo: '**/*.ts'
2525
- Use kebab-case filenames (e.g., `user-session.ts`, `data-service.ts`) unless told otherwise.
2626
- Keep tests, types, and helpers near their implementation when it aids discovery.
2727
- Reuse or extend shared utilities when it reduces duplication and keeps responsibilities focused.
28-
- Create new utilities when they serve a distinct purpose; avoid bloated "Utils" classes that mix unrelated concerns.
28+
- Create new utilities when they serve a distinct purpose; keep "Utils" classes focused on related concerns only.
2929

3030
## Naming & Style
3131

@@ -46,7 +46,7 @@ applyTo: '**/*.ts'
4646
- Use discriminated unions for real-time events and state machines.
4747
- Centralise shared contracts instead of duplicating shapes.
4848
- Express intent with TypeScript utility types (e.g., `Readonly`, `Partial`, `Record`).
49-
- Prefer `type` over `interface` for defining shapes; use `interface` only when a class must implement it.
49+
- Prefer `type` over `interface` for defining shapes; use `interface` when a class must implement it.
5050

5151
## Async, Events & Error Handling
5252

@@ -68,13 +68,13 @@ applyTo: '**/*.ts'
6868
## External Integrations
6969

7070
- Instantiate clients outside hot paths and inject them for testability.
71-
- Never hardcode secrets; load them from secure sources.
71+
- Always load secrets from secure sources instead of hardcoding them.
7272
- Normalise external responses and map errors to domain shapes.
7373

7474
## Security Practices
7575

7676
- Validate and sanitise external input with schema validators or type guards.
77-
- Avoid dynamic code execution and untrusted template rendering except on plugins.
77+
- Permit dynamic code execution and untrusted template rendering only on plugins.
7878
- Encode untrusted content before rendering HTML; use framework escaping or trusted types.
7979
- Use parameterised queries or prepared statements to block injection.
8080
- Favor immutable flows and defensive copies for sensitive data.
@@ -96,7 +96,7 @@ applyTo: '**/*.ts'
9696

9797
- Add or update unit tests with the project's framework and naming style.
9898
- Expand integration or end-to-end suites when behavior crosses modules or platform APIs.
99-
- Avoid brittle timing assertions; prefer fake timers or injected clocks.
99+
- Use fake timers or injected clocks instead of brittle timing assertions.
100100

101101
## Performance & Reliability
102102

0 commit comments

Comments
 (0)