-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Compilation error on index.d.cts #488
Comments
`deepmerge-ts` seems to have an [issue](RebeccaStevens/deepmerge-ts#488) with a type file. Skipping lib check in `tsconfig.json` ([doc](https://www.typescriptlang.org/tsconfig/#skipLibCheck)) works around that and will increase compile time without drawbacks.
could you reproduce the problem with code example? |
sometimes what you need to do is using casting types for merging object with different types, types ObjectTypeA {
prop_a: boolean
}
types ObjectTypeB {
prop_b: boolean
}
types ObjectTypeC {
prop_a?: boolean
prop_b?: boolean
}
let someobject_a: ObjectTypeA = {
prop_a: false
}
let someobject_b: ObjectTypeA = {
prop_b: false
}
// dont ❌
let someobject_c = deepmerge(someobject_a, someobject_b) // may throw type error, since the type between the two object not the same.
// todo ✅
let someobject_c: ObjectTypeC = deepmerge(someobject_a as ObjectTypeC, someobject_b as ObjectTypeC) // will fix it, and still get the correct type. |
I've updated how the types are compiled for this project. Hopefully, as a consequence, this has also fixed this issue. Let me know if you still have to issue. Also, sorry for the long delay in my reply. |
Bug Report
On a project with
deepmerge-ts
as a depency andskipLibCheck
tofalse
, this error pops at compile timeExpected behavior
It should compile
Actual behavior
It does not
Steps to reproduce
npm i deepmerge-ts@latest
(7.0.3
is also affected)tsconfig.json
that you have"skipLibCheck": false
Proposed changes
Adding
"skipLibCheck": false
on the main project is a workaround, but I find it a bit hacky, thus this reportThe text was updated successfully, but these errors were encountered: