You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading @babel/types to 7.10.0+ breaks typings. For example:
functionfoo(path: NodePath){if(nodePath.isMemberExpression()){// nodePath used to be of type "NodePath<MemberExpression>" here.// But now is "NodePath<Node> & NodePath<MemberExpression>".// As a result, obj has a loose type: "NodePath<Node> | NodePath<Node>[]"// Used to be "NodePath<Expression>".constobj=path.get('object');// And then this breaks:obj.isIdentifier();}}
Hard to figure out a proper fix and understand why this happens. The only workaround I found so far is too cumbersome to be acceptable:
functionfoo(path: NodePath){if(nodePath.isMemberExpression()){constobj=(pathasNodePath<MemberExpression>).get('object');// now obj has expected type, we can do:obj.isIdentifier();}}
Argument of type 'NodePath<CallExpression>' is not assignable to parameter of type 'NodePath<Node>'.
Type 'Node' is not assignable to type 'CallExpression'.
Type 'AnyTypeAnnotation' is missing the following properties from type 'CallExpression': callee, arguments, optional, typeArguments, typeParametersts(2345)
Waiting for a proper fix, #170 pinned @babel/types to the latest version that works: 7.9.6. Starting at 7.10.0 the breaking change occurs 🤷♂️ .
How to reproduce
remove yarn.lock and node_modules
upgrade all the dependencies
yarn run types
Expected behavior
Types should be strong and not break.
What actually happens
Lot of typing errors, mostly related to the aforementioned issue. For example:
src/extractors/withTranslationHOC.ts:293:62 - error TS2345: Argument of type 'NodePath<Node> | NodePath<Node>[]' is not assignable to parameter of type 'NodePath<Node>'.
Type 'NodePath<Node>[]' is not assignable to type 'NodePath<Node>'.
293 result.push(...findTFunctionCallsFromPropsAssignment(id));
~~
Your environment
irrelevant
Additional context
None
The text was updated successfully, but these errors were encountered:
Describe the bug
Upgrading @babel/types to 7.10.0+ breaks typings. For example:
Hard to figure out a proper fix and understand why this happens. The only workaround I found so far is too cumbersome to be acceptable:
Another problem:
Now fails with the following error:
Waiting for a proper fix, #170 pinned
@babel/types
to the latest version that works: 7.9.6. Starting at 7.10.0 the breaking change occurs 🤷♂️ .How to reproduce
yarn.lock
andnode_modules
yarn run types
Expected behavior
Types should be strong and not break.
What actually happens
Lot of typing errors, mostly related to the aforementioned issue. For example:
Your environment
irrelevant
Additional context
None
The text was updated successfully, but these errors were encountered: