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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more type saftey for vega-lite fixme #1947

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/NodeParser/CallExpressionParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
const type = this.typeChecker.getTypeAtLocation(node);

// FIXME: remove special case
if ((type as any)?.typeArguments) {
if (Array.isArray((type as any)?.typeArguments?.[0]?.types)) {

Check warning on line 23 in src/NodeParser/CallExpressionParser.ts

View workflow job for this annotation

GitHub Actions / Test

Unsafe member access .typeArguments on an `any` value
return new TupleType([
new UnionType((type as any).typeArguments[0].types.map((t: any) => new LiteralType(t.value))),

Check warning on line 25 in src/NodeParser/CallExpressionParser.ts

View workflow job for this annotation

GitHub Actions / Test

Unsafe argument of type `any` assigned to a parameter of type `readonly BaseType[]`

Check warning on line 25 in src/NodeParser/CallExpressionParser.ts

View workflow job for this annotation

GitHub Actions / Test

Unsafe call of an `any` typed value
]);
}

Expand Down