Comments (9)
ok I pulled this down and confirmed a suspicion: the problem here is that neither the project's tsconfig nor the @tsconfig/ember
base specifies skipLibCheck: true
, which it ought to.
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
from data.
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.
from data.
skipLibCheck: true, which it ought to.
idk, it falls back to any
when library code goes wrong, which hides problems π
I would decline PRs to @tsconfig/ember
for this change, as I think it's not something library authors should ever enable, and something appdevs could enable, knowing the risks.
from data.
@NullVoxPopuli then the default for Ember apps will be that typechecking fails π€·π»ββοΈ
its literally impossible to not ship broken types. tsc strips @ts-expect-error
and @ts-ignore-error
from dts files, and it creates dts files for untyped code that are horribly broken when you generate the types for what code actually is typed.
from data.
also its just literally never a good idea to have skipLibCheck: false
, tbh its shocking typescript hasn't removed the feature. Setting it to false tanks your performance, doesn't work with monorepos, and leaves you highly susceptible to semver drift breaking builds while offering no improved type safety or checks.
from data.
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 any
from libraries and libraries' internal types (some deep library types are wrong). as long as that doesn't happen, I'm happy with whatever the config ends up being.
from data.
My main concern is silent fallback to any from libraries and libraries' internal types (some deep library types are wrong). as long as that doesn't happen, I'm happy with whatever the config ends up being.
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 any
or types that resolve to any
for tons of types. Especially if you use jsdoc, it prefers jsdoc to actual type information and creates non-existent symbols for non-existent types.
from data.
why is a library shipping with expect/ignore error tho?
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.
from data.
you probably want to cast to unknown as TheTypeYouReallyWant
as ts-expect-error has never worked for libraries -- just not an option π
from data.
Related Issues (20)
- Request can't handle `null` as response HOT 3
- Overridden `Model` methods have incorrect `this` type HOT 1
- Custom model instancesβ type is not assignable to `Model` HOT 1
- @ember-data/debug/data-adapter.js: Cannot read properties of undefined (reading 'env') HOT 2
- The kind `collection` is missing in schema-record HOT 2
- "Cannot supply a different store via context than was used to create the request" on autorefresh HOT 2
- Error `Cannot read properties of undefined (reading 'env')` after updating to 5.3.4 (extending `@ember-data/store`) HOT 12
- [5.3.4] EmberData deprecation for `ember-inflector` is incorrect HOT 1
- inspector cannot inspect ember-data - ember-data/debug is missing app-reexports HOT 10
- [5.3.7] Issue with use in nested addon HOT 4
- [5.3.7] when using ember-cli-mirage `ember-inflector` must be a installed, otherwise production build is broken HOT 2
- [5.4.0-alpha.91] Incorrect/Missing typings HOT 4
- Error: Could not find module `@ember-data/adapter/rest` HOT 1
- [5.3.4+] `polyfillUUID` isn't anymore working when there was added over `@embroider/macros` option HOT 1
- Descendants of 'Model' cannot be upcast HOT 1
- 'options' is undefined for 'attr<BooleanTransform>'
- Cannot get the Identifier of the record HOT 10
- spec: cache v3 exploration
- `npx warp-drive retrofit types@canary` doesn't removed DT packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data.