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
I created a new ember TS project using --typescript and when I generate a new component using for example:
ember g component table1
I get this interface definition in the file:
interface Table1Signature {
// The arguments accepted by the component
Args: {}
// Any blocks yielded by the component
Blocks: {
default: []
}
// The element to which `...attributes` is applied in the component template
Element: null
}
My ide (vscode) gives me warning on the line Args: {} saying:
Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead.eslint[@typescript-eslint/ban-types](https://typescript-eslint.io/rules/ban-types)
Since I don't know ember internals I'm not sure if it's better to choose "object" or "unknown" (I would guess the former) as type for Args, but I suppose one of the two should be the default.
The text was updated successfully, but these errors were encountered:
I think in this case, the solution would be to, either define some argument types, or comment out / remove Args: {} from the signature, indicating that the component does not accept any arguments.
Output from
ember version --verbose && npm --version && yarn --version
:I created a new ember TS project using --typescript and when I generate a new component using for example:
I get this interface definition in the file:
My ide (vscode) gives me warning on the line Args: {} saying:
Since I don't know ember internals I'm not sure if it's better to choose "object" or "unknown" (I would guess the former) as type for Args, but I suppose one of the two should be the default.
The text was updated successfully, but these errors were encountered: