Skip to content

bug: Formatting edge cases #24

@ieedan

Description

@ieedan

Going to list any edge cases here so I can come back and solve them.

1. Incorrect formatting behavior when above node doesn't have additional whitespace

Original:

<script lang="ts" module>
    import { x } from 'y';
    type Foo = number;
    
    export const foo: Foo = 5;

    type Bar = string;
</script>

✔️ Expected:

<script module>
    import { x } from 'y';
    
    export const foo = 5;
</script>

❌ Got:

<script module>
    import { x } from 'y';
    export const foo = 5;
</script>

The problem with this one is to know if we should remove whitespace in this situation it would seem that we would need the context of whether the next node will be removed or not.

Let me know if you have any ideas!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions