diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-access-state-in-setstate.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-access-state-in-setstate.ts index 96a99c6a6..54a31b98b 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-access-state-in-setstate.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-access-state-in-setstate.ts @@ -17,7 +17,7 @@ export const RULE_FEATURES = [ export type MessageID = CamelCase; function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option { - if (AST.isTypeOnlyExpression(node)) { + if (AST.isTypeExpression(node)) { return getName(node.expression); } if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) { diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-direct-mutation-state.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-direct-mutation-state.ts index 7fc7c3acb..1e94db9dd 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-direct-mutation-state.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-direct-mutation-state.ts @@ -18,7 +18,7 @@ export const RULE_FEATURES = [ export type MessageID = CamelCase; function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option { - if (AST.isTypeOnlyExpression(node)) { + if (AST.isTypeExpression(node)) { return getName(node.expression); } if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) { diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-class-component-members.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-class-component-members.ts index cb8fda5be..5baadf07d 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-class-component-members.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-class-component-members.ts @@ -42,7 +42,7 @@ const LIFECYCLE_METHODS = new Set([ // anywhere that a literal may be used as a key (e.g., member expressions, // method definitions, ObjectExpression property keys). function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option { - if (AST.isTypeOnlyExpression(node)) { + if (AST.isTypeExpression(node)) { return getName(node.expression); } if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) { diff --git a/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-state.ts b/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-state.ts index e7e53e03a..623983105 100644 --- a/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-state.ts +++ b/packages/plugins/eslint-plugin-react-x/src/rules/no-unused-state.ts @@ -18,7 +18,7 @@ export const RULE_FEATURES = [ export type MessageID = CamelCase; function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option { - if (AST.isTypeOnlyExpression(node)) { + if (AST.isTypeExpression(node)) { return getName(node.expression); } if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) { diff --git a/packages/utilities/ast/src/get-function-identifier.ts b/packages/utilities/ast/src/get-function-identifier.ts index bc583d8ec..e93a7cbc3 100644 --- a/packages/utilities/ast/src/get-function-identifier.ts +++ b/packages/utilities/ast/src/get-function-identifier.ts @@ -11,7 +11,7 @@ import { O } from "@eslint-react/eff"; import type { TSESTree } from "@typescript-eslint/types"; import { AST_NODE_TYPES } from "@typescript-eslint/types"; -import { isOneOf, isTypeOnlyExpression } from "./is"; +import { isOneOf, isTypeExpression } from "./is"; import type { TSESTreeFunction } from "./types"; export function getFunctionIdentifier(node: TSESTree.Expression | TSESTreeFunction): O.Option { @@ -55,7 +55,7 @@ export function getFunctionIdentifier(node: TSESTree.Expression | TSESTreeFuncti // const MaybeComponent = (() => {})!; // const MaybeComponent = (() => {}) as FunctionComponent; // const MaybeComponent = (() => {}) satisfies FunctionComponent; - case isTypeOnlyExpression(node.parent): + case isTypeExpression(node.parent): return getFunctionIdentifier(node.parent); } return O.none(); diff --git a/packages/utilities/ast/src/is-this-expression.ts b/packages/utilities/ast/src/is-this-expression.ts index 727d1339a..ce94ee99c 100644 --- a/packages/utilities/ast/src/is-this-expression.ts +++ b/packages/utilities/ast/src/is-this-expression.ts @@ -1,10 +1,10 @@ import type { TSESTree } from "@typescript-eslint/types"; import { AST_NODE_TYPES } from "@typescript-eslint/types"; -import { isTypeOnlyExpression } from "./is"; +import { isTypeExpression } from "./is"; export function isThisExpression(node: TSESTree.Expression) { - if (isTypeOnlyExpression(node)) { + if (isTypeExpression(node)) { return isThisExpression(node.expression); } diff --git a/packages/utilities/ast/src/is.ts b/packages/utilities/ast/src/is.ts index f961f6365..589defd1d 100644 --- a/packages/utilities/ast/src/is.ts +++ b/packages/utilities/ast/src/is.ts @@ -149,7 +149,7 @@ export const isLeftHandSideExpressionType = isOneOf([ AST_NODE_TYPES.TSTypeAssertion, ]); -export const isTypeOnlyExpression = isOneOf([ +export const isTypeExpression = isOneOf([ AST_NODE_TYPES.TSAsExpression, AST_NODE_TYPES.TSTypeAssertion, AST_NODE_TYPES.TSNonNullExpression, diff --git a/packages/utilities/ast/src/unwrap-type-expression.ts b/packages/utilities/ast/src/unwrap-type-expression.ts index 26bffe8a3..9547a7799 100644 --- a/packages/utilities/ast/src/unwrap-type-expression.ts +++ b/packages/utilities/ast/src/unwrap-type-expression.ts @@ -1,8 +1,8 @@ import type { TSESTree } from "@typescript-eslint/types"; -import { isTypeOnlyExpression } from "./is"; +import { isTypeExpression } from "./is"; export function unwrapTypeExpression(node: TSESTree.Node): TSESTree.Node { - if (isTypeOnlyExpression(node)) return unwrapTypeExpression(node.expression); + if (isTypeExpression(node)) return unwrapTypeExpression(node.expression); return node; } diff --git a/packages/utilities/var/src/construction.ts b/packages/utilities/var/src/construction.ts index d1d8ce9b1..0c9282bcf 100644 --- a/packages/utilities/var/src/construction.ts +++ b/packages/utilities/var/src/construction.ts @@ -176,7 +176,7 @@ export function inspectConstruction( } return Construction.None(); }) - .when(AST.isTypeOnlyExpression, () => { + .when(AST.isTypeExpression, () => { if (!("expression" in node) || !isObject(node.expression)) { return Construction.None(); }