diff --git a/src/core-parts/finder.ts b/src/core-parts/finder.ts
index e3bea8be..f88ca9e3 100644
--- a/src/core-parts/finder.ts
+++ b/src/core-parts/finder.ts
@@ -148,6 +148,11 @@ export function findTargetClassNameNodes(ast: AST, options: ResolvedOptions): Cl
recursiveProps = ['body'];
break;
}
+ case 'AssignmentExpression':
+ case 'LogicalExpression': {
+ recursiveProps = ['right'];
+ break;
+ }
case 'BinaryExpression': {
recursiveProps = ['left', 'right'];
break;
@@ -190,10 +195,6 @@ export function findTargetClassNameNodes(ast: AST, options: ResolvedOptions): Cl
recursiveProps = ['attributes'];
break;
}
- case 'LogicalExpression': {
- recursiveProps = ['right'];
- break;
- }
case 'ObjectExpression': {
recursiveProps = ['properties'];
break;
diff --git a/tests/babel/issue-104/__snapshots__/absolute.test.ts.snap b/tests/babel/issue-104/__snapshots__/absolute.test.ts.snap
new file mode 100644
index 00000000..d98c13bd
--- /dev/null
+++ b/tests/babel/issue-104/__snapshots__/absolute.test.ts.snap
@@ -0,0 +1,25 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`'(1) JSX Assignment' > expectation 1`] = `
+"//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+"
+`;
diff --git a/tests/babel/issue-104/__snapshots__/relative.test.ts.snap b/tests/babel/issue-104/__snapshots__/relative.test.ts.snap
new file mode 100644
index 00000000..364ca4c2
--- /dev/null
+++ b/tests/babel/issue-104/__snapshots__/relative.test.ts.snap
@@ -0,0 +1,25 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`'(1) JSX Assignment' > expectation 1`] = `
+"//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+"
+`;
diff --git a/tests/babel/issue-104/absolute.test.ts b/tests/babel/issue-104/absolute.test.ts
new file mode 100644
index 00000000..12c96408
--- /dev/null
+++ b/tests/babel/issue-104/absolute.test.ts
@@ -0,0 +1,12 @@
+import { thisPlugin, testSnapshotEach } from '../../adaptor';
+import { baseOptions } from '../../settings';
+import { fixtures } from './fixtures';
+
+const options = {
+ ...baseOptions,
+ plugins: [thisPlugin],
+ parser: 'babel',
+ endingPosition: 'absolute',
+};
+
+testSnapshotEach(fixtures, options);
diff --git a/tests/babel/issue-104/fixtures.ts b/tests/babel/issue-104/fixtures.ts
new file mode 100644
index 00000000..4c95577b
--- /dev/null
+++ b/tests/babel/issue-104/fixtures.ts
@@ -0,0 +1,23 @@
+import type { Fixture } from '../../settings';
+
+export const fixtures: Omit[] = [
+ {
+ name: '(1) JSX Assignment',
+ input: `
+//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+`,
+ },
+];
diff --git a/tests/babel/issue-104/relative.test.ts b/tests/babel/issue-104/relative.test.ts
new file mode 100644
index 00000000..dc768c32
--- /dev/null
+++ b/tests/babel/issue-104/relative.test.ts
@@ -0,0 +1,12 @@
+import { thisPlugin, testSnapshotEach } from '../../adaptor';
+import { baseOptions } from '../../settings';
+import { fixtures } from './fixtures';
+
+const options = {
+ ...baseOptions,
+ plugins: [thisPlugin],
+ parser: 'babel',
+ endingPosition: 'relative',
+};
+
+testSnapshotEach(fixtures, options);
diff --git a/tests/typescript/issue-104/__snapshots__/absolute.test.ts.snap b/tests/typescript/issue-104/__snapshots__/absolute.test.ts.snap
new file mode 100644
index 00000000..d98c13bd
--- /dev/null
+++ b/tests/typescript/issue-104/__snapshots__/absolute.test.ts.snap
@@ -0,0 +1,25 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`'(1) JSX Assignment' > expectation 1`] = `
+"//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+"
+`;
diff --git a/tests/typescript/issue-104/__snapshots__/relative.test.ts.snap b/tests/typescript/issue-104/__snapshots__/relative.test.ts.snap
new file mode 100644
index 00000000..364ca4c2
--- /dev/null
+++ b/tests/typescript/issue-104/__snapshots__/relative.test.ts.snap
@@ -0,0 +1,25 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`'(1) JSX Assignment' > expectation 1`] = `
+"//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+"
+`;
diff --git a/tests/typescript/issue-104/absolute.test.ts b/tests/typescript/issue-104/absolute.test.ts
new file mode 100644
index 00000000..e90edbbd
--- /dev/null
+++ b/tests/typescript/issue-104/absolute.test.ts
@@ -0,0 +1,12 @@
+import { thisPlugin, testSnapshotEach } from '../../adaptor';
+import { baseOptions } from '../../settings';
+import { fixtures } from './fixtures';
+
+const options = {
+ ...baseOptions,
+ plugins: [thisPlugin],
+ parser: 'typescript',
+ endingPosition: 'absolute',
+};
+
+testSnapshotEach(fixtures, options);
diff --git a/tests/typescript/issue-104/fixtures.ts b/tests/typescript/issue-104/fixtures.ts
new file mode 100644
index 00000000..4c95577b
--- /dev/null
+++ b/tests/typescript/issue-104/fixtures.ts
@@ -0,0 +1,23 @@
+import type { Fixture } from '../../settings';
+
+export const fixtures: Omit[] = [
+ {
+ name: '(1) JSX Assignment',
+ input: `
+//-----------------------------------------------------------------------------| printWidth=80 (in snapshot)
+function Foo() {
+ let elem = (
+
+ content
+
+ );
+ elem = (
+
+ content
+
+ );
+ return elem;
+}
+`,
+ },
+];
diff --git a/tests/typescript/issue-104/relative.test.ts b/tests/typescript/issue-104/relative.test.ts
new file mode 100644
index 00000000..751e3f45
--- /dev/null
+++ b/tests/typescript/issue-104/relative.test.ts
@@ -0,0 +1,12 @@
+import { thisPlugin, testSnapshotEach } from '../../adaptor';
+import { baseOptions } from '../../settings';
+import { fixtures } from './fixtures';
+
+const options = {
+ ...baseOptions,
+ plugins: [thisPlugin],
+ parser: 'typescript',
+ endingPosition: 'relative',
+};
+
+testSnapshotEach(fixtures, options);