tslint-eslint-rules icon indicating copy to clipboard operation
tslint-eslint-rules copied to clipboard

Implement smart tabs for indent rule

Open jez9999 opened this issue 6 years ago • 3 comments

Smart tabs allows the use of tabs for indentation, spaces for alignment. This is a crucial feature that there is basically no alternative to, if you're using tabs for indentation. Please implement this. I used it with ESLint and didn't come across any issues.

jez9999 avatar Sep 16 '17 08:09 jez9999

Not a priority for this project, but feel free to fork it and open a PR, I'll be glad to help you.

buzinas avatar Oct 17 '17 08:10 buzinas

The solution for this is to implement a new rule to give a TSLine equivalent to no-mixed-spaces-and-tabs. I have implemented this rule and I will submit a pull request.

jez9999 avatar Oct 20 '17 17:10 jez9999

@jez9999 , I've tried these rules and, given a tab followed by a space, am still getting a lint Error of "indentation has mixed tabs and spaces (ter-no-mixed-spaces-and-tabs)" when smartTabs is set to true. I have tried both "ter-no-mixed-spaces-and-tabs": { "smartTabs": true } and "ter-no-mixed-spaces-and-tabs": { "type": "tabs", "smartTabs": true }, although I'm not sure what the difference ought to be between those two options.

mscottnelson avatar Jun 14 '18 16:06 mscottnelson