Skip to content

Commit 1e1093a

Browse files
committed
refactor: rename 'isTypeOnlyExpression' to 'isTypeExpression'
1 parent 0edd720 commit 1e1093a

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-access-state-in-setstate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const RULE_FEATURES = [
1717
export type MessageID = CamelCase<typeof RULE_NAME>;
1818

1919
function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option<string> {
20-
if (AST.isTypeOnlyExpression(node)) {
20+
if (AST.isTypeExpression(node)) {
2121
return getName(node.expression);
2222
}
2323
if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) {

packages/plugins/eslint-plugin-react-x/src/rules/no-direct-mutation-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const RULE_FEATURES = [
1818
export type MessageID = CamelCase<typeof RULE_NAME>;
1919

2020
function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option<string> {
21-
if (AST.isTypeOnlyExpression(node)) {
21+
if (AST.isTypeExpression(node)) {
2222
return getName(node.expression);
2323
}
2424
if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) {

packages/plugins/eslint-plugin-react-x/src/rules/no-unused-class-component-members.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const LIFECYCLE_METHODS = new Set([
4242
// anywhere that a literal may be used as a key (e.g., member expressions,
4343
// method definitions, ObjectExpression property keys).
4444
function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option<string> {
45-
if (AST.isTypeOnlyExpression(node)) {
45+
if (AST.isTypeExpression(node)) {
4646
return getName(node.expression);
4747
}
4848
if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) {

packages/plugins/eslint-plugin-react-x/src/rules/no-unused-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const RULE_FEATURES = [
1818
export type MessageID = CamelCase<typeof RULE_NAME>;
1919

2020
function getName(node: TSESTree.Expression | TSESTree.PrivateIdentifier): O.Option<string> {
21-
if (AST.isTypeOnlyExpression(node)) {
21+
if (AST.isTypeExpression(node)) {
2222
return getName(node.expression);
2323
}
2424
if (node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier) {

packages/utilities/ast/src/get-function-identifier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { O } from "@eslint-react/eff";
1111
import type { TSESTree } from "@typescript-eslint/types";
1212
import { AST_NODE_TYPES } from "@typescript-eslint/types";
1313

14-
import { isOneOf, isTypeOnlyExpression } from "./is";
14+
import { isOneOf, isTypeExpression } from "./is";
1515
import type { TSESTreeFunction } from "./types";
1616

1717
export function getFunctionIdentifier(node: TSESTree.Expression | TSESTreeFunction): O.Option<TSESTree.Identifier> {
@@ -55,7 +55,7 @@ export function getFunctionIdentifier(node: TSESTree.Expression | TSESTreeFuncti
5555
// const MaybeComponent = (() => {})!;
5656
// const MaybeComponent = (() => {}) as FunctionComponent;
5757
// const MaybeComponent = (() => {}) satisfies FunctionComponent;
58-
case isTypeOnlyExpression(node.parent):
58+
case isTypeExpression(node.parent):
5959
return getFunctionIdentifier(node.parent);
6060
}
6161
return O.none();

packages/utilities/ast/src/is-this-expression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { TSESTree } from "@typescript-eslint/types";
22
import { AST_NODE_TYPES } from "@typescript-eslint/types";
33

4-
import { isTypeOnlyExpression } from "./is";
4+
import { isTypeExpression } from "./is";
55

66
export function isThisExpression(node: TSESTree.Expression) {
7-
if (isTypeOnlyExpression(node)) {
7+
if (isTypeExpression(node)) {
88
return isThisExpression(node.expression);
99
}
1010

packages/utilities/ast/src/is.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const isLeftHandSideExpressionType = isOneOf([
149149
AST_NODE_TYPES.TSTypeAssertion,
150150
]);
151151

152-
export const isTypeOnlyExpression = isOneOf([
152+
export const isTypeExpression = isOneOf([
153153
AST_NODE_TYPES.TSAsExpression,
154154
AST_NODE_TYPES.TSTypeAssertion,
155155
AST_NODE_TYPES.TSNonNullExpression,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { TSESTree } from "@typescript-eslint/types";
22

3-
import { isTypeOnlyExpression } from "./is";
3+
import { isTypeExpression } from "./is";
44

55
export function unwrapTypeExpression(node: TSESTree.Node): TSESTree.Node {
6-
if (isTypeOnlyExpression(node)) return unwrapTypeExpression(node.expression);
6+
if (isTypeExpression(node)) return unwrapTypeExpression(node.expression);
77
return node;
88
}

packages/utilities/var/src/construction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function inspectConstruction(
176176
}
177177
return Construction.None();
178178
})
179-
.when(AST.isTypeOnlyExpression, () => {
179+
.when(AST.isTypeExpression, () => {
180180
if (!("expression" in node) || !isObject(node.expression)) {
181181
return Construction.None();
182182
}

0 commit comments

Comments
 (0)