Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs vs spaces and single vs double quotes in existing files #118

Open
benmccann opened this issue Oct 14, 2024 · 4 comments
Open

Tabs vs spaces and single vs double quotes in existing files #118

benmccann opened this issue Oct 14, 2024 · 4 comments
Labels
bug Something isn't working pkg:add sv add

Comments

@benmccann
Copy link
Member

We now default to tabs and single quotes in new files

We have guessIndentString, but it's only used for JSON. Can we use guessIndentString for JS/TS as well? Barring that, can we set the formatting for existing files to match the default for new files?

@benmccann benmccann mentioned this issue Oct 14, 2024
24 tasks
@manuel3108
Copy link
Member

I don't think this is possible in a reasonable manner. If this would work then as post-processing step after serializing the ast. In that case i think we should rather spend effort in solving the problem once and for all via #100

@benmccann
Copy link
Member Author

Wouldn't we need to do roughly the same thing in either case? Whether we're using recast or esrap to print the file, I'd expect we would need to tell it whether to use tabs/spaces and single/double quotes. Or does esrap have built-in detection for that already?

@manuel3108
Copy link
Member

Fair point, looks like you are right. esrap seems to always use tabs and single quotes. Does not look like it has any detection for it, or any options regarding this...

@benmccann
Copy link
Member Author

Interesting. Maybe we can do the same and see if people complain. If so, then we'll know we need to add an option to esrap

@manuel3108 manuel3108 added bug Something isn't working pkg:add sv add labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:add sv add
Projects
None yet
Development

No branches or pull requests

2 participants