doom-neovim / doom-nvim

A Neovim configuration for the advanced martian hacker
GNU General Public License v2.0
1k stars 108 forks source link

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

Open tuanbass opened 1 year ago

tuanbass commented 1 year ago

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