Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

tabs changed to spaces #464

Closed
benmccann opened this issue Jul 2, 2024 · 4 comments · Fixed by #467
Closed

tabs changed to spaces #464

benmccann opened this issue Jul 2, 2024 · 4 comments · Fixed by #467
Labels

Comments

@benmccann
Copy link
Collaborator

Topic

mdsvex

Version

2.3.2

Expected behavior

leave the tabs in place

it looks like there's a utility function we can use for this now: #463 (comment)

Actual behavior

the mdsvex adder changes all of the tabs to spaces in svelte.config.js

@benmccann benmccann added the bug label Jul 2, 2024
@AdrianGonz97
Copy link
Collaborator

i sense that preserving formats is going to be an never ending game of whack-a-mole 😅

i do want to point out that this is only the case if the user doesn't have prettier installed, which is probably an uncommon occurrence. in any case, once #463 is merged, we can reuse that utility function to fix this as well

@manuel3108
Copy link
Member

I think in the past I made sure that this worked as expected. We might need to try to remove this method for a second to see if this might already fix this.

export function stripAst<T>(node: T, propToRemove: string): T {

@benmccann
Copy link
Collaborator Author

i sense that preserving formats is going to be an never ending game of whack-a-mole 😅

I haven't looked at the code that closely, but was hoping if we got the functionality to live in the core functions that it would handle it for most cases

I think in the past I made sure that this worked as expected.

Yeah, I think that's the case with most of the stuff found in the past day or so. Understandable since there's been a lot of refactoring. I think with some tests hopefully we can avoid having to deal with too many regressions (#461)

@AdrianGonz97
Copy link
Collaborator

I think in the past I made sure that this worked as expected. We might need to try to remove this method for a second to see if this might already fix this.

You're correct, it is the removal of the locations causing this! Rather than removing stripAst altogether, we can just strip a copy of the AST during comparisons, preserving the original tree

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants