Skip to content

Commit 89e61b1

Browse files
committed
🆙 update: disable formatting for SFC
1 parent 3e88c18 commit 89e61b1

File tree

3 files changed

+117
-119
lines changed

3 files changed

+117
-119
lines changed

src/infuser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function format (source: string, lang: string): string {
127127

128128
switch (lang) {
129129
case 'vue':
130-
return prettier.format(source, { parser: 'vue' })
130+
return source
131131
case 'yaml':
132132
case 'yml':
133133
return prettier.format(source, { parser: 'yaml', tabWidth: 2 })

test/__snapshots__/infuser.test.ts.snap

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exports[`json: /path/to/project1/src/App.vue 1`] = `
66
</template>
77
88
<script>
9-
export default {};
9+
export default {}
1010
</script>
1111
1212
<i18n>
@@ -18,8 +18,7 @@ export default {};
1818
\\"title\\": \\"アプリケーション\\"
1919
}
2020
}
21-
</i18n>
22-
"
21+
</i18n>"
2322
`;
2423

2524
exports[`json: /path/to/project1/src/components/Modal.vue 1`] = `
@@ -28,7 +27,7 @@ exports[`json: /path/to/project1/src/components/Modal.vue 1`] = `
2827
</template>
2928
3029
<script>
31-
export default {};
30+
export default {}
3231
</script>
3332
3433
<i18n locale=\\"en\\">
@@ -43,8 +42,7 @@ export default {};
4342
\\"ok\\": \\"OK\\",
4443
\\"cancel\\": \\"キャンセル\\"
4544
}
46-
</i18n>
47-
"
45+
</i18n>"
4846
`;
4947
5048
exports[`json: /path/to/project1/src/components/nest/RankingTable.vue 1`] = `
@@ -53,7 +51,7 @@ exports[`json: /path/to/project1/src/components/nest/RankingTable.vue 1`] = `
5351
</template>
5452
5553
<script>
56-
export default {};
54+
export default {}
5755
</script>
5856
5957
<i18n locale=\\"en\\">
@@ -74,8 +72,7 @@ export default {};
7472
\\"score\\": \\"スコア\\"
7573
}
7674
}
77-
</i18n>
78-
"
75+
</i18n>"
7976
`;
8077
8178
exports[`json: /path/to/project1/src/pages/Login.vue 1`] = `
@@ -84,7 +81,7 @@ exports[`json: /path/to/project1/src/pages/Login.vue 1`] = `
8481
</template>
8582
8683
<script>
87-
export default {};
84+
export default {}
8885
</script>
8986
9087
<i18n>
@@ -105,8 +102,7 @@ export default {};
105102
\\"confirm\\": \\"Confirm Password\\",
106103
\\"button\\": \\"Login\\"
107104
}
108-
</i18n>
109-
"
105+
</i18n>"
110106
`;
111107
112108
exports[`json5: /path/to/project1/src/components/Modal.vue 1`] = `
@@ -115,7 +111,7 @@ exports[`json5: /path/to/project1/src/components/Modal.vue 1`] = `
115111
</template>
116112
117113
<script>
118-
export default {};
114+
export default {}
119115
</script>
120116
121117
<i18n lang=\\"json5\\" locale=\\"en\\">
@@ -130,8 +126,7 @@ export default {};
130126
\\"ok\\": \\"OK\\",
131127
\\"cancel\\": \\"キャンセル\\"
132128
}
133-
</i18n>
134-
"
129+
</i18n>"
135130
`;
136131
137132
exports[`not full localitation: /path/to/project1/src/App.vue 1`] = `
@@ -140,7 +135,7 @@ exports[`not full localitation: /path/to/project1/src/App.vue 1`] = `
140135
</template>
141136
142137
<script>
143-
export default {};
138+
export default {}
144139
</script>
145140
146141
<i18n>
@@ -152,8 +147,7 @@ export default {};
152147
\\"title\\": \\"アプリケーション\\"
153148
}
154149
}
155-
</i18n>
156-
"
150+
</i18n>"
157151
`;
158152
159153
exports[`not full localitation: /path/to/project1/src/components/Modal.vue 1`] = `
@@ -162,7 +156,7 @@ exports[`not full localitation: /path/to/project1/src/components/Modal.vue 1`] =
162156
</template>
163157
164158
<script>
165-
export default {};
159+
export default {}
166160
</script>
167161
168162
<i18n locale=\\"en\\">
@@ -177,8 +171,7 @@ export default {};
177171
\\"ok\\": \\"OK\\",
178172
\\"cancel\\": \\"キャンセル\\"
179173
}
180-
</i18n>
181-
"
174+
</i18n>"
182175
`;
183176
184177
exports[`not full localitation: /path/to/project1/src/components/nest/RankingTable.vue 1`] = `
@@ -187,7 +180,7 @@ exports[`not full localitation: /path/to/project1/src/components/nest/RankingTab
187180
</template>
188181
189182
<script>
190-
export default {};
183+
export default {}
191184
</script>
192185
193186
<i18n locale=\\"en\\">
@@ -208,8 +201,7 @@ export default {};
208201
\\"score\\": \\"スコア\\"
209202
}
210203
}
211-
</i18n>
212-
"
204+
</i18n>"
213205
`;
214206
215207
exports[`not full localitation: /path/to/project1/src/pages/Login.vue 1`] = `
@@ -218,7 +210,7 @@ exports[`not full localitation: /path/to/project1/src/pages/Login.vue 1`] = `
218210
</template>
219211
220212
<script>
221-
export default {};
213+
export default {}
222214
</script>
223215
224216
<i18n>
@@ -230,8 +222,7 @@ export default {};
230222
\\"button\\": \\"ログイン\\"
231223
}
232224
}
233-
</i18n>
234-
"
225+
</i18n>"
235226
`;
236227
237228
exports[`yaml: /path/to/project1/src/components/Modal.vue 1`] = `
@@ -240,7 +231,7 @@ exports[`yaml: /path/to/project1/src/components/Modal.vue 1`] = `
240231
</template>
241232
242233
<script>
243-
export default {};
234+
export default {}
244235
</script>
245236
246237
<i18n lang=\\"yaml\\" locale=\\"en\\">
@@ -251,6 +242,5 @@ cancel: Cancel
251242
<i18n lang=\\"yml\\" locale=\\"ja\\">
252243
ok: OK
253244
cancel: キャンセル
254-
</i18n>
255-
"
245+
</i18n>"
256246
`;

0 commit comments

Comments
 (0)