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
Currently in the docs, `@attr() declare name?` is typed as `string`, and no example of
`@attr('string')` is given. I'm not sure if showing in the documentation
that not passing a transform to `@attr()` should explicitly default to
string is the correct thing to do, but I definitely think we should
model the use of `@attr('string')` in the code examples.
@@ -47,7 +47,7 @@ One way to make this safer is to supply a default value using the `defaultValue`
47
47
importModel, { attr } from'@ember-data/model';
48
48
49
49
exportdefaultclassUserextendsModel {
50
-
@attr()
50
+
@attr('string')
51
51
declare name?:string;
52
52
53
53
@attr('number', { defaultValue: 13 })
@@ -62,7 +62,7 @@ export default class User extends Model {
62
62
63
63
Relationships between models in Ember Data rely on importing the related models, like `import User from './user';`. This, naturally, can cause a recursive loop, as `/app/models/post.ts` imports `User` from `/app/models/user.ts`, and `/app/models/user.ts` imports `Post` from `/app/models/post.ts`. Recursive importing triggers an [`import/no-cycle`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md) error from eslint.
64
64
65
-
To avoid these errors, use of [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html), available since TypeScript 3.8:
65
+
To avoid these errors, use [type-only imports](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html), available since TypeScript 3.8:
0 commit comments