ukrbublik/react-awesome-query-builder

Type conflict in core package since v6.4.1

Closed this issue · 1 comments

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];

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.