File tree Expand file tree Collapse file tree 3 files changed +217
-429
lines changed Expand file tree Collapse file tree 3 files changed +217
-429
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,15 @@ export class CodeTransformer {
28
28
*/
29
29
#project: Project
30
30
31
+ /**
32
+ * Settings to use when persisting files
33
+ */
34
+ #editorSettings = {
35
+ indentSize : 2 ,
36
+ convertTabsToSpaces : true ,
37
+ trimTrailingWhitespace : true ,
38
+ }
39
+
31
40
constructor ( cwd : URL ) {
32
41
this . #cwd = cwd
33
42
this . #project = new Project ( {
@@ -139,7 +148,7 @@ export class CodeTransformer {
139
148
}
140
149
}
141
150
142
- file . formatText ( )
151
+ file . formatText ( this . #editorSettings )
143
152
await file . save ( )
144
153
}
145
154
@@ -187,7 +196,7 @@ export class CodeTransformer {
187
196
} )
188
197
}
189
198
190
- file . formatText ( )
199
+ file . formatText ( this . #editorSettings )
191
200
await file . save ( )
192
201
}
193
202
}
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ export class RcFileTransformer {
18
18
#cwd: URL
19
19
#project: Project
20
20
21
+ /**
22
+ * Settings to use when persisting files
23
+ */
24
+ #editorSettings = {
25
+ indentSize : 2 ,
26
+ convertTabsToSpaces : true ,
27
+ trimTrailingWhitespace : true ,
28
+ }
29
+
21
30
constructor ( cwd : URL , project : Project ) {
22
31
this . #cwd = cwd
23
32
this . #project = project
@@ -326,7 +335,7 @@ export class RcFileTransformer {
326
335
*/
327
336
save ( ) {
328
337
const file = this . #getRcFileOrThrow( )
329
- file . formatText ( )
338
+ file . formatText ( this . #editorSettings )
330
339
return file . save ( )
331
340
}
332
341
}
You can’t perform that action at this time.
0 commit comments