-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EmberData's native types don't compile with glint #9446
Comments
haven't had time to poke through the project you posted; however, this seems almost certainly to be a config issue. We use glint within EmberData itself already, and use it at work with EmberData's native types. |
ok I pulled this down and confirmed a suspicion: the problem here is that neither the project's tsconfig nor the There's no way for libraries to avoid shipping errors in types to consumers (literally), so skipLibCheck should always be used. cc @NullVoxPopuli / @wagenet / @gitKrystan |
idk, it falls back to I would decline PRs to |
@NullVoxPopuli then the default for Ember apps will be that typechecking fails 🤷🏻♂️ its literally impossible to not ship broken types. tsc strips |
also its just literally never a good idea to have |
why is a library shipping with expect/ignore error tho? or trying to? I feel like there is some context I don't understand where there are broken types somewhere in the dep graph, and a library is trying to paper over the problem with those directives? My main concern is silent fallback to |
this is both something no app can ever fix and will happen anyway regardless, so its not worth it even yelling at you by default. tsc by-default produces |
also because good libraries care about shipping correct-for-consumer types, which means they have to use ts-expect-error in order to produce the correct type. |
you probably want to cast to |
Reproduction
You can simply reproduce these errors by creating an empty
embroider
project withglint
andtemplate-imports
enabled:import 'ember-source/types';
totypes/<your-app>/index.d.ts
@ember-data-types@5.4.0-alpha.64
as described in the guidesglint
withtemplate-imports
This example repo can be found here: https://github.com/pieter-v/test-types
Running
ember build
gives no errors.Running
glint
(ortsc
) gives a large list of errors.Description
The role for running
glint
in such a project is crucial as the error and type checking is done byglint
and not byember build
.Versions
The text was updated successfully, but these errors were encountered: