Skip to content
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

Breaking change introduced #64

Closed
person1123 opened this issue Oct 3, 2023 · 6 comments
Closed

Breaking change introduced #64

person1123 opened this issue Oct 3, 2023 · 6 comments

Comments

@person1123
Copy link

person1123 commented Oct 3, 2023

Hi - looks like this commit broke these types: 3f8e31d

[!] (plugin typescript) RollupError: @rollup/plugin-typescript TS1139: Type parameter declaration expected.
../../../../node_modules/@types/ramda/node_modules/types-ramda/es/index.d.ts (4453:22)
4453 export function pick<const Names extends readonly [PropertyKey, ...PropertyKey[]]>(names: Names): <U extends Record<ElementOf<Names>, any>>(obj: U) => string extends keyof U ? Record<string, U[keyof U]> : Pick<U, ElementOf<Names>>;
@person1123 person1123 changed the title Breaking changed introduced Breaking change introduced Oct 3, 2023
@Harris-Miller
Copy link
Collaborator

This error is because you are on typescript < 5

@types/ramda, which is backed by types-ramda is labeled that min support is typescript 5.0

Specifically, the const Type Parameter syntax is being used here

@y-a-v-a
Copy link

y-a-v-a commented Oct 9, 2023

Fixable by adding

"resolutions": {
    "types-ramda": "0.29.4",
}

to package.json

@Harris-Miller
Copy link
Collaborator

@y-a-v-a if you do need to not consume the latest, that is a valid work-around for yarn. The npm equivalent is overrides

"overrides": {
    "types-ramda": "0.29.4"
}

@stevenKirill
Copy link

Hello ! I have the same problem, my linter shows me error from this library, how can I disabled linter not to check this types ?

@Harris-Miller
Copy link
Collaborator

This MR should fix ts4 incompatibilities: #80

@whoisYeshua
Copy link

whoisYeshua commented Mar 16, 2024

This MR should fix ts4 incompatibilities: #80

We still have issue on "typescript": "4.9.5".

Looks like typesVersions should solve this problem (I saw it in your PR, but it didn't get into the result branch):

  "types": "es/index.d.ts",
  "typesVersions": {
    "<5.0": { "*": ["ts4/es/index.d.ts"] },
    "*": { "*": ["es/index.d.ts"] }
  },

because now types still point to ts5 source types.

By now we use overrides method, but we live in an monorepo and only one package uses ramda (and in npm monorepo overrides only work in a root package - so its not best solution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants