Search code examples
githubrepositoryindentationbracketsadobe-brackets

Indentation issue after pushing code from Brackets Editor to Github


For my code I'm using Brackets. In editor, code looks proper but after pushing it to github repository, indentations are messed up. I'm using tab key to make indentation but in preferences there is set "use 2 spaces" after pressing tab key.

I've find out that Github is using 8 spaces for recognised tab keys. But still, it does not give me anything. The biggest problem is when I use "one var statement". I've also used jsbeautifier and it doesn't help me at all. Here you can find an example: My Github code example

Does anybody had such a problem with brackets and github indentations?


Solution

  • Yes I had such problems.

    These problems did not reappear when we moved to eslint inside of our IDE. The setup varies for each IDE. You can refer https://eslint.org/docs/rules/indent

    If setting eslint is hard for you. Try bracket extensions like https://github.com/brackets-beautify/brackets-beautify . When used correctly it will beautify on save. Caution: Dont beautify code written by others or a team.