You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/generic/ember.instructions.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,12 @@ The application uses modern Ember Octane patterns, Handlebars templates, and SCS
33
33
-**Build System**: Ember CLI with Webpack for bundling and asset management
34
34
-**Development**: ESLint for code linting, Prettier for code formatting
35
35
36
+
## File Naming and TypeScript Adoption
37
+
-**New Files**: All new JavaScript files must use `.ts` extension for TypeScript
38
+
-**Legacy File Migration**: When editing existing `.js` files, assess the effort required to convert to `.ts` and prioritize conversion if time permits
39
+
-**Component Structure**: Components should have matching `.ts` and `.hbs` files in the same directory
40
+
-**Gradual Migration**: The codebase is transitioning from JavaScript to TypeScript - contribute to this effort when possible
41
+
36
42
## Build and Deployment Structure
37
43
-**Development Build**: `ember serve` creates development server with live reload
38
44
-**Production Build**: `ember build --environment=production` generates optimized assets in `dist/`
@@ -57,6 +63,8 @@ The application uses modern Ember Octane patterns, Handlebars templates, and SCS
57
63
- Update comments when code changes to maintain accuracy
58
64
59
65
## TypeScript Guidelines
66
+
-**File Naming**: All new files should use `.ts` extension instead of `.js`
67
+
-**Migration Strategy**: When modifying existing `.js` files, evaluate the effort required to convert to `.ts` and prioritize conversion if time permits
60
68
- Use explicit types instead of `any` - prefer `unknown` for truly dynamic content
61
69
- Define interfaces for object shapes and function signatures
62
70
- Use type guards and discriminated unions for runtime type checking
@@ -66,7 +74,7 @@ The application uses modern Ember Octane patterns, Handlebars templates, and SCS
66
74
- Replace `Route.extend`, `Model.extend`, or `Component.extend` with native JavaScript classes
67
75
- Use Ember Octane conventions: tracked properties, decorators, and native class syntax
68
76
- Create reusable components rather than one-off implementations
69
-
- Co-locate component templates (`.hbs`) with their JavaScript/TypeScript files
77
+
- Co-locate component templates (`.hbs`) with their TypeScript files (`.ts` preferred over `.js`)
70
78
- Prioritize reusability and maintainability when creating components - avoid overly complex or one-off implementations
71
79
72
80
## Asynchronous Programming
@@ -97,7 +105,7 @@ The application uses modern Ember Octane patterns, Handlebars templates, and SCS
97
105
- Use `@tracked` only for internal component state that changes over time
98
106
- Never use `@tracked` on component arguments (properties passed from parent components)
99
107
- Component class names must match their file names exactly
100
-
- Place `.hbs` templates in the same directory as their `.js`or `.ts`files within `vault/ui/app/components/`
108
+
- Place `.hbs` templates in the same directory as their `.ts` files (or `.js` for legacy files) within `vault/ui/app/components/`
101
109
- Organize new components in logical subdirectories by feature or domain
102
110
- Remove quotes around dynamic data attributes: `data-test-id={{value}}` not `data-test-id="{{value}}"`
0 commit comments