Skip to content

Commit 6453cf2

Browse files
rdlabogithub-actions[bot]
authored andcommitted
chore: prettier formatting
1 parent d265b8c commit 6453cf2

File tree

3 files changed

+43
-37
lines changed

3 files changed

+43
-37
lines changed

packages/cli/src/angular/migrations/standalone/0002-generate-use-icons.test.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import dedent from "ts-dedent";
44
import { cwd } from "node:process";
55

66
import { generateUseIcons } from "./0002-generate-use-icons";
7-
import {createTestIconFile} from './test-helper';
7+
import { createTestIconFile } from "./test-helper";
88

99
describe("migrateComponents", () => {
1010
describe("standalone angular components", () => {
@@ -22,9 +22,9 @@ describe("migrateComponents", () => {
2222

2323
const useIconFile = await createTestIconFile([
2424
{
25-
filePath: 'foo.component.ts',
26-
sourceFileText: dedent(component)
27-
}
25+
filePath: "foo.component.ts",
26+
sourceFileText: dedent(component),
27+
},
2828
]);
2929

3030
expect(dedent(useIconFile.getText())).toBe(
@@ -46,9 +46,9 @@ describe("migrateComponents", () => {
4646

4747
const useIconFile = await createTestIconFile([
4848
{
49-
filePath: 'foo.component.ts',
50-
sourceFileText: dedent(component)
51-
}
49+
filePath: "foo.component.ts",
50+
sourceFileText: dedent(component),
51+
},
5252
]);
5353

5454
expect(dedent(useIconFile.getText())).toBe(
@@ -72,9 +72,9 @@ describe("migrateComponents", () => {
7272

7373
const useIconFile = await createTestIconFile([
7474
{
75-
filePath: 'foo.component.ts',
76-
sourceFileText: dedent(component)
77-
}
75+
filePath: "foo.component.ts",
76+
sourceFileText: dedent(component),
77+
},
7878
]);
7979

8080
expect(dedent(useIconFile.getText())).toBe(
@@ -91,9 +91,9 @@ describe("migrateComponents", () => {
9191

9292
const useIconFile = await createTestIconFile([
9393
{
94-
filePath: 'foo.component.html',
95-
sourceFileText: dedent(html)
96-
}
94+
filePath: "foo.component.html",
95+
sourceFileText: dedent(html),
96+
},
9797
]);
9898

9999
expect(dedent(useIconFile.getText())).toBe(
@@ -113,9 +113,9 @@ describe("migrateComponents", () => {
113113

114114
const useIconFile = await createTestIconFile([
115115
{
116-
filePath: 'foo.component.html',
117-
sourceFileText: dedent(html)
118-
}
116+
filePath: "foo.component.html",
117+
sourceFileText: dedent(html),
118+
},
119119
]);
120120

121121
expect(dedent(useIconFile.getText())).toBe(
@@ -135,9 +135,9 @@ describe("migrateComponents", () => {
135135

136136
const useIconFile = await createTestIconFile([
137137
{
138-
filePath: 'foo.component.html',
139-
sourceFileText: dedent(html)
140-
}
138+
filePath: "foo.component.html",
139+
sourceFileText: dedent(html),
140+
},
141141
]);
142142

143143
expect(dedent(useIconFile.getText())).toBe(
@@ -165,9 +165,9 @@ describe("migrateComponents", () => {
165165

166166
const useIconFile = await createTestIconFile([
167167
{
168-
filePath: 'foo.component.ts',
169-
sourceFileText: dedent(component)
170-
}
168+
filePath: "foo.component.ts",
169+
sourceFileText: dedent(component),
170+
},
171171
]);
172172

173173
expect(dedent(useIconFile.getText())).toBe(
@@ -194,9 +194,9 @@ describe("migrateComponents", () => {
194194

195195
const useIconFile = await createTestIconFile([
196196
{
197-
filePath: 'foo.component.ts',
198-
sourceFileText: dedent(component)
199-
}
197+
filePath: "foo.component.ts",
198+
sourceFileText: dedent(component),
199+
},
200200
]);
201201

202202
expect(dedent(useIconFile.getText())).toBe(

packages/cli/src/angular/migrations/standalone/0002-generate-use-icons.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,20 @@ function detectIonicComponentsAndIcons(htmlAsString: string, filePath: string) {
103103
}
104104

105105
if (node.name === "ion-icon") {
106-
for (const attribute of ['name', 'icon', 'ios', 'md']) {
107-
const staticNameAttribute = node.attributes.find((a: any) => a.name === attribute);
106+
for (const attribute of ["name", "icon", "ios", "md"]) {
107+
const staticNameAttribute = node.attributes.find(
108+
(a: any) => a.name === attribute,
109+
);
108110

109111
if (staticNameAttribute) {
110112
const iconName = staticNameAttribute.value;
111113
if (!ionIcons.includes(iconName)) {
112114
ionIcons.push(iconName);
113115
}
114116
} else {
115-
const boundNameAttribute = node.inputs.find((a: any) => a.name === attribute);
117+
const boundNameAttribute = node.inputs.find(
118+
(a: any) => a.name === attribute,
119+
);
116120

117121
if (boundNameAttribute) {
118122
const skippedIcon = node.sourceSpan.toString();
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import {Project, SourceFile} from 'ts-morph';
2-
import dedent from 'ts-dedent';
3-
import {generateUseIcons} from './0002-generate-use-icons';
4-
import {cwd} from 'node:process';
1+
import { Project, SourceFile } from "ts-morph";
2+
import dedent from "ts-dedent";
3+
import { generateUseIcons } from "./0002-generate-use-icons";
4+
import { cwd } from "node:process";
55

6-
export const createTestIconFile = async (fileSource: {
7-
filePath: string;
8-
sourceFileText: string
9-
}[]): Promise<SourceFile> => {
6+
export const createTestIconFile = async (
7+
fileSource: {
8+
filePath: string;
9+
sourceFileText: string;
10+
}[],
11+
): Promise<SourceFile> => {
1012
const project = new Project({ useInMemoryFileSystem: true });
1113
for (const file of fileSource) {
1214
project.createSourceFile(file.filePath, dedent(file.sourceFileText));
@@ -22,4 +24,4 @@ export const createTestIconFile = async (fileSource: {
2224
});
2325

2426
return useIconFile;
25-
}
27+
};

0 commit comments

Comments
 (0)