'Code pushed or uploaded to GitHub shows extra whitespace

Whenever I push or manually upload code to github extra whitespace will appear in the committed code. I'm using prettier and eslint, I've tried pushing with both enabled and disabled, and with prettier only enabled.

Code as shown on GitHub:

User Settings:

Workspace Settings:



Solution 1:[1]

Do you use tabs instead of spaces? Most editors allow you (like you’ve shown) to customize what a tab character shows as (e.g. 8 spaces). My assumption is that your setting is smaller than what GitHub uses for its display. GitHub doesn’t modify your code.

Solution 2:[2]

so setting "prettier.useTabs" to false resolves the issue, you would think that the code being pushed and code being displayed would be the same perhaps this is an issue to push to prettier's git repo but i digress, thanks for the feedback.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 apg
Solution 2 0xCourtney