Closed gossi closed 1 year ago
The comment needs to be within the template. I can't copy and paste your example since it's an inaccessible screenshot, but for instance:
await render(<template>
{{! @glint-expect-error }}
{{eq "hello" 123}}
</template>);
Oh sorry, my bad. The screenshot is there to show the squiggly lines.
It is actually the code above:
const fakeContextObject = EmberObject.create({
valueA: null,
valueB: null,
});
const contextChild = fakeContextObject;
So, within a gts file, there is no way to suppress error message in the ts/js part. I tried known ts directives, such as: @ts-ignore
- but glint doesn't know about them.
@ts-
directives should work as normal in .gts
files:
I pulled the branch you linked and looked at the file in question and can confirm that @ts-ignore
silences the error in the EmberObject.create
call, so I'm going to close this out.
If you're able to put together an isolated reproduction I'm happy to reopen and take a look
In my attempt to add glint support for
ember-truth-helpers
, see jmurphyau/ember-truth-helpers#176 the tests bombard the helpers with all sorts of data types. For example:I tried to suppress them with
@glint-ignore
(which I found is only for use within<template>
), then I tried@ts-ignore
and@ts-expect-error
but neither of them causesglint
to silence over these expected errors.I even got this response from glint:
Unused '@ts-expect-error' directive. glint(2578)
(from eslint extension in vscode - I guess?).So, I was wondering if this is missing or if I couldn't figure this out?