Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Conversation

@shovon
Copy link
Contributor

@shovon shovon commented Feb 10, 2025

No description provided.

@jagnani73
Copy link
Member

We should not be pushing the vscode settings file, plus the 4 indentation is already active via prettier. Why is this needed?

@shovon
Copy link
Contributor Author

shovon commented Feb 10, 2025

We should not be pushing the vscode settings file, plus the 4 indentation is already active via prettier. Why is this needed?

I'll answer this in two parts.

Why?

It's because it's incredibly annoying seeing VS Code (and derivatives) show me 2-character indents, while files are 4 characters.

Depending on the IDE's mood, I have to update the indentation for every single file that I have open, so that what VS Code shows me, and the indent policy are aligned.

The only way to have things be consistent is that I either change my global VS Code settings, or I update the workspace settings, which creates a .vscode folder in the current workspace.

The latter option keeps things consistent, for everyone.

Why not just Prettier?

Read the above section.

Like, yes, with the Prettier plugin, hitting save causes the files to be formatted to 4-space indent, but that IDE-level inconsistency is still there, and Prettier is just not able to solve that annoyance.

This is a common problem

You might be thinking that this is an isolated problem.

But that's not true.

If that were the case, then several open source projects wouldn't include some .vscode folder in addition to a .prettierrc file.

I mean, just look at the laundry list of open source projects that include .vscode, some of which include both a .vscode and .pretterrc:

@jagnani73
Copy link
Member

We should not be pushing the vscode settings file, plus the 4 indentation is already active via prettier. Why is this needed?

I'll answer this in two parts.

Why?

It's because it's incredibly annoying seeing VS Code (and derivatives) show me 2-character indents, while files are 4 characters.

Depending on the IDE's mood, I have to update the indentation for every single file that I have open, so that what VS Code shows me, and the indent policy are aligned.

The only way to have things be consistent is that I either change my global VS Code settings, or I update the workspace settings, which creates a .vscode folder in the current workspace.

The latter option keeps things consistent, for everyone.

Why not just Prettier?

Read the above section.

Like, yes, with the Prettier plugin, hitting save causes the files to be formatted to 4-space indent, but that IDE-level inconsistency is still there, and Prettier is just not able to solve that annoyance.

This is a common problem

You might be thinking that this is an isolated problem.

But that's not true.

If that were the case, then several open source projects wouldn't include some .vscode folder in addition to a .prettierrc file.

I mean, just look at the laundry list of open source projects that include .vscode, some of which include both a .vscode and .pretterrc:

Prettier at its core is a javascript code, it runs fine for any IDE
The problem you're facing is because even though there's a prettier devdep at the root level, it also needs to be added individually for the packages. It can then work done without annoying you (directly accessing the same root level config)

@shovon
Copy link
Contributor Author

shovon commented Feb 10, 2025

Prettier at its core is a javascript code, it runs fine for any IDE
The problem you're facing is because even though there's a prettier devdep at the root level, it also needs to be added individually for the packages. It can then work done without annoying you (directly accessing the same root level config)

I don't think you addressed my point.

Prettier works perfectly, perfectly fine when hitting save, even if Prettier file is not in any node_modules folder.

It works horribly, horribly bad with the IDE. The IDE wants to show me 2-space indents; it indents with 2-space indents—as long as I don't save. Which is annoying. And it's not always guaranteed that whatever heuristic that the IDE uses to determine indent will pick up that a particular file is 4-space indent, and will default to 2-space.

Just look at the screenshot below.

2-space indent shown in a 4-space indent file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants