File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/svelte2tsx/src/svelte2tsx/nodes Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -337,16 +337,20 @@ export class HoistableInterfaces {
337
337
for ( const [ name , node ] of hoistable ) {
338
338
let pos = node . pos + astOffset ;
339
339
340
- // node.pos includes preceeding whitespace, which could mean we accidentally also move stuff appended to a previous node
341
- if ( name !== '$$ComponentProps' ) {
340
+ if ( name === '$$ComponentProps' ) {
341
+ // So that organize imports doesn't mess with the types
342
+ str . prependRight ( pos , '\n' ) ;
343
+ } else {
344
+ // node.pos includes preceeding whitespace, which could mean we accidentally also move stuff appended to a previous node
342
345
if ( str . original [ pos ] === '\r' ) {
343
346
pos ++ ;
344
347
}
345
348
if ( / \s / . test ( str . original [ pos ] ) ) {
346
349
pos ++ ;
347
350
}
348
351
349
- // jsdoc comments would be ignored if they are on the same line as the ;, so we add a newline, too
352
+ // jsdoc comments would be ignored if they are on the same line as the ;, so we add a newline, too.
353
+ // Also helps with organize imports not messing with the types
350
354
str . prependRight ( pos , ';\n' ) ;
351
355
str . appendLeft ( node . end + astOffset , ';' ) ;
352
356
}
You can’t perform that action at this time.
0 commit comments