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

Library can't be used by applications that uses the noUncheckedIndexedAccess TS compiler option #10

Closed
johannes-lindgren opened this issue Jun 14, 2024 · 0 comments · Fixed by #11

Comments

@johannes-lindgren
Copy link
Collaborator

johannes-lindgren commented Jun 14, 2024

immer-yjs can't be used in application that uses noUncheckedIndexedAccess: true.

The library distributes type declaration files (.d.ts) that imports .ts files from the src/ directory:

dist/immer-yjs.es.d.ts/dist/immer-yjs.umd.d.ts:

export * from "../src/index"

Even if you have "skipLibCheck": true, TypeScript will still check the types within node_modules.

When you set noUncheckedIndexedAccess: true, you get a type error in src/immer-yjs.ts on line 77:

                target.set(k, toYDataType(value[k]))
@johannes-lindgren johannes-lindgren changed the title Distribute .d.ts files instead of src folder Distribute .d.ts files instead of the src folder Jun 14, 2024
@johannes-lindgren johannes-lindgren changed the title Distribute .d.ts files instead of the src folder immer-yjs can't be used by applications that uses the noUncheckedIndexedAccess TS compiler option Jun 14, 2024
@johannes-lindgren johannes-lindgren changed the title immer-yjs can't be used by applications that uses the noUncheckedIndexedAccess TS compiler option Library can't be used by applications that uses the noUncheckedIndexedAccess TS compiler option Jun 14, 2024
@sep2 sep2 closed this as completed in #11 Jun 20, 2024
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

Successfully merging a pull request may close this issue.

1 participant