4

Added @types/ramda

Now I get typescript errors from @types/ramda

Failed to compile.

/Users/xx/WebstormProjects/xx/frontend/node_modules/@types/ramda/index.d.ts
TypeScript error: ',' expected.  TS1005

    81 |  * function: the current index, and the entire list.
    82 |  */
  > 83 | export function addIndex<T, U>(fn: (f: (item: T) => U, list: readonly T[]) => U[]): _.F.Curry<(a: (item: T, idx: number, list?: T[]) => U, b: readonly T[]) => U[]>;
       |                                                                       ^
    84 | /* Special case for forEach */
    85 | export function addIndex<T>(fn: (f: (item: T) => void, list: readonly T[]) => T[]): _.F.Curry<(a: (item: T, idx: number, list?: T[]) => void, b: readonly T[]) => T[]>;
    86 | /* Special case for reduce */

I have many other @types and none is giving any errors except this.

My tsconfig.json:

"include": [
    "./typings/**/*",
    "./src/**/*",
    "./test/**/*"
  ],
  "exclude": [
    "node_modules"
  ]
Joe
  • 4,274
  • 32
  • 95
  • 175

1 Answers1

1

I resolved this issue by using the typings here: https://github.com/types/npm-ramda/.

The repo claims the following versions are supported.

  • ramda@0.25.0
  • typescript@~2.9.2

However I've not yet had an issue with this combination:

  • ramda@0.26.1
  • typescript@3.9.10
Kildareflare
  • 4,590
  • 5
  • 51
  • 65