typed-typings / npm-ramda

TypeScript's type definitions for Ramda
MIT License
384 stars 64 forks source link

Typescript 2.9 compatibility #391

Closed jethrolarson closed 6 years ago

jethrolarson commented 6 years ago

Looks like TS 2.9 changed the way keyofworks and now a bunch of errors like the below are showing up:

node_modules/@types/ramda/src/mergeWithKey.d.ts:78:61 - error TS2344: Type 'keyof T' does not satisfy the constraint 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.
jethrolarson commented 6 years ago

https://blogs.msdn.microsoft.com/typescript/2018/05/31/announcing-typescript-2-9/#breaking-changes has the deets.

treybrisbane commented 6 years ago

Ran into this over the weekend; it's stalling our ability to upgrade to TS 2.9 in a few of our microservices 🙁

strax commented 6 years ago

It's possible to use the previous behavior of keyof and get rid of these warnings until typings are updated by adding the following configuration to tsconfig.json:

{
    "compilerOptions": {
        "keyofStringsOnly": true
    }
}
ikatyang commented 6 years ago

It should be possible, unless you used some tuple types. The fixed length tuple is another incompatible part and it couldn't be disabled. I've opened #399 to address these issues but I'm not sure if it addressed all the TS 2.9 issues, at least there's no warning in generated definitions now and tests are passed.

KiaraGrouwstra commented 6 years ago

The fixed length tuple is another incompatible part and it couldn't be disabled.

That one is my fault. You're welcome. :D