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

Type conflict in core package since v6.4.1 #1016

Closed
ChrisRast opened this issue Dec 11, 2023 · 1 comment · Fixed by #1034
Closed

Type conflict in core package since v6.4.1 #1016

ChrisRast opened this issue Dec 11, 2023 · 1 comment · Fixed by #1034

Comments

@ChrisRast
Copy link

ChrisRast commented Dec 11, 2023

Describe the bug
New types written in 4.6.1 create conflicts with TS 4.9.5.

I identified the source to be this PR #959.

The problem is we use skipLibCheck=false in tsconfig.json.

It looks like the new types are not properly checked in your CI maybe? It also seems they conflict with immutable v3 from which you depend, but in the core package.json you defined v4 ?

To Reproduce

  • Clone https://github.com/ChrisRast/raqb-fix-types
  • yarn install or your preferred package manager.
  • yarn typecheck.

Expected behavior
No type conflicts.


Let me know if you need anything more. I did not create a PR to fix it as I don't understand the context of these new types and not sure how to fix it. EDIT: Well, I created #1017 , tell me what you think.

Though one fix I tried was this:

diff --git a/packages/core/modules/index.d.ts b/packages/core/modules/index.d.ts
index e543012..f019c9f 100644
--- a/packages/core/modules/index.d.ts
+++ b/packages/core/modules/index.d.ts
@@ -173,7 +173,8 @@ interface _RulePropertiesI extends RuleProperties {
   valueError?: ImmutableList<string>,
   operatorOptions?: ImmMap,
 }
-interface _RuleGroupExtProperties extends _RulePropertiesI, RuleGroupExtProperties {}
+
+type _RuleGroupExtProperties = _RulePropertiesI & RuleGroupExtProperties;
 
 interface ObjectToImmOMap<P> extends ImmutableOMap<keyof P, any> {
   get<K extends keyof P>(name: K): P[K];
@ChrisRast
Copy link
Author

It seems like the issue appears because when you enable skipLibCheck the index.d.ts is totally skipped thus you don't know if your code is correct or not.

You need to enable it for packages that declare an additional .d.ts file.

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