total-typescript / ts-reset

A 'CSS reset' for TypeScript, improving types for common JavaScript API's
https://www.totaltypescript.com/ts-reset
MIT License
7.74k stars 117 forks source link

Incompatible with immer-yjs #181

Open Crisfole opened 6 months ago

Crisfole commented 6 months ago

Love this project. Unfortunately, I tried installing this on a project at work and it collided with immer-yjs:

https://github.com/sep2/immer-yjs/blob/main/packages/immer-yjs/src/immer-yjs.ts#L39C78-L39C78

../node_modules/immer-yjs/src/immer-yjs.ts:39:64 - error TS2345: Argument of type '(v: JSONValue | YMap<any> | YArray<any>) => JSONValue' is not assignable to parameter of type '(value: unknown, index: number, array: unknown[]) => JSONValue'.
  Types of parameters 'v' and 'value' are incompatible.
    Type 'unknown' is not assignable to type 'JSONValue | YMap<any> | YArray<any>'.

39                     arr.splice(retain, 0, ...change.insert.map(toPlainValue))
                                                                  ~~~~~~~~~~~~

Found 1 error in ../node_modules/immer-yjs/src/immer-yjs.ts:39

I have "skipLibCheck": true, in my tsConfig and "exclude": [ ..., "node_modules", "../node_modules" ...]

Is there something I'm missing here. For now I can't use it as is, which is a pity since it's super great!

tylerlaprade commented 5 months ago

I'm having a similar problem with reduxjs. Even with "skipLibCheck": true, I'm getting tsc errors from inside my node_modules/ folder.

Crisfole commented 5 months ago

@tylerlaprade In the case of immer it's because immer releases typescript directly and so 'skipping' the lib check isn't really an option... I think.