How have you configured indentation for TypeScript/JavaScript files? #999
-
There are 2 ways to configure indentation when editing files: through Neither of them could generate the same indentation which So I'm curious how have you guys configured your indentation rules? Is there a good reason that we didn't enable treesitter's indent by default? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
dont we already have prettier formatter installed? why dont just use prettier? we let formatter to deal with all that kind of things to keep related things in one place. |
Beta Was this translation helpful? Give feedback.
-
In my experience |
Beta Was this translation helpful? Give feedback.
-
I agree with that. So far my solution is adding e.g. -- /lua/user/event.lua
local definitions = {
ft = {
{ "FileType", "javascript", "set shiftwidth=2" },
{ "FileType", "javascriptreact", "set shiftwidth=2" },
{ "FileType", "typescript", "set shiftwidth=2" },
{ "FileType", "typescriptreact", "set shiftwidth=2" },
} |
Beta Was this translation helpful? Give feedback.
dont we already have prettier formatter installed? why dont just use prettier?
we let formatter to deal with all that kind of things to keep related things in one place.