Skip to content

Commit a3b5776

Browse files
committed
fix: update import from ts-api-utils to use unionConstituents for type inspection
1 parent d65c027 commit a3b5776

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-leaked-conditional-rendering.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ESLintUtils } from "@typescript-eslint/utils";
1010
import type { ReportDescriptor, RuleListener } from "@typescript-eslint/utils/ts-eslint";
1111
import { compare } from "compare-versions";
1212
import type { CamelCase } from "string-ts";
13-
import { isFalseLiteralType, isTrueLiteralType, isTypeFlagSet, unionTypeParts } from "ts-api-utils";
13+
import { isFalseLiteralType, isTrueLiteralType, isTypeFlagSet, unionConstituents } from "ts-api-utils";
1414
import { isMatching, match, P } from "ts-pattern";
1515
import ts from "typescript";
1616

@@ -235,7 +235,7 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
235235
} as const;
236236
}
237237
const leftType = getConstrainedTypeAtLocation(services, left);
238-
const leftTypeVariants = inspectVariantTypes(unionTypeParts(leftType));
238+
const leftTypeVariants = inspectVariantTypes(unionConstituents(leftType));
239239
const isLeftValid = Array
240240
.from(leftTypeVariants.values())
241241
.every((type) => allowedVariants.some((allowed) => allowed === type));

0 commit comments

Comments
 (0)