Skip to content

Commit baac8ef

Browse files
authored
fix: the requested module 'ts-api-utils' does not provide an export named 'unionConstituents', closes #1009 (#1010)
1 parent ff9a0aa commit baac8ef

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, unionConstituents } from "ts-api-utils";
13+
import { isFalseLiteralType, isTrueLiteralType, isTypeFlagSet, unionTypeParts } 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(unionConstituents(leftType));
238+
const leftTypeVariants = inspectVariantTypes(unionTypeParts(leftType)); // eslint-disable-line @typescript-eslint/no-deprecated
239239
const isLeftValid = Array
240240
.from(leftTypeVariants.values())
241241
.every((type) => allowedVariants.some((allowed) => allowed === type));

0 commit comments

Comments
 (0)