3

I have some issues with my indentations on GitHub: It shows that I have an indent size of 8 on GitHub even after I changed it to indent size 2 and pushed it.

I have changed the settings on prettier so the code has a indent size 2, and look as it should in my VSCode, but when I commit it is still has a indent size 8.

Attached some photos below and a link to my repo: https://github.com/MT-dotse/project-mongo-api/blob/master/server.js

  • Code on VSCode: Code on VS code
  • Code on GitHub: Code on GitHub
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Madelene
  • 33
  • 3
  • Hi managed to solve the issue! I needed to uncheck the "use tabs" , and change the tab width to 2 in the prettier extention. – Madelene Jan 21 '22 at 09:13
  • Well done, good catch. I have included your comment in the answer for more visibility. – VonC Jan 21 '22 at 09:24

1 Answers1

1

I do see your code on GitHub with the expected tab size of 2, not 8.

But that is only because I have set my GitHub account setting "Tab Size" to 2.
Which means any tab is displayed (in my GitHub session on a browser page) as 2 spaces, not 8.


As the OP Madelene adds in the comments, as an alternative solution:

I needed to uncheck the "use tabs", and change the tab width to 2 in the prettier extension.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Why do you need to change the tab width if tabs are no more used ?? –  Jan 21 '22 at 09:27
  • @YvesDaoust On GitHub, this is just to make sure tabs are represented with the expected number of spaces. The OP went for an alternative solution. – VonC Jan 21 '22 at 09:29
  • MH, I don't get it. If there are no tabs in the original file, this is irrelevant. –  Jan 21 '22 at 09:35