doom-nvim icon indicating copy to clipboard operation
doom-nvim copied to clipboard

[BUG] Formatting typescript file does not respect shiftwidth settings, hence tabSize is incorrect

Open tuanbass opened this issue 2 years ago • 0 comments
trafficstars

Current Behavior:

When I try to format my typescript code, even when my nvim "shiftwidth" is 4, the formatted code is always use tabsize of 2

Expected Behavior:

Tabsize for formatted code should be 4

Steps To Reproduce:

  1. open a typescript file
  2. change the nvim 's shiftwidth to 4 (or what ever ). In mycase, I use editorconfig setting.
  3. format the code
  4. Check the result tab size

Anything else:

I Performed some debug, and after awhile, it's seemed that eslint_d's formatter does not respect the setting. Nullls get the correct shiftwidth and pass correct value to eslint_d, but eslint_d just ignore it. It's possible that I have a misconfiguration, but I tried all ways but failed to force eslint_d to use correct shiftwidth

My Suggestion is to use prettierd for formatting typescript code (and maybe javascript code also) instead of eslint_d

tuanbass avatar Jan 31 '23 10:01 tuanbass