google / eslint-config-google

ESLint shareable config for the Google JavaScript style guide
Apache License 2.0
1.74k stars 140 forks source link

are tabs allowed? #40

Closed reklatsmasters closed 7 years ago

reklatsmasters commented 7 years ago

Google JavaScript Style Guide says:

2.3.1 Whitespace characters ...

  1. Tab characters are not used for indentation.

but rule indent works incorrectly. As a result, I can write like this: image And it will not cause an error.

philipwalton commented 7 years ago

Tabs are not allowed, but unfortunately the eslint options for the indent rule are not flexible enough to enforce all of Google's rules around indentation. You can see I have a TODO to fix this: https://github.com/google/eslint-config-google/blob/master/index.js#L198-L199

That explains why there's not currently a warning for tabs (though you could easily add this yourself to your own config).

philipwalton commented 7 years ago

Actually, I think the answer to this question can be addressed by adding the no-tabs rule, which I think was mistakenly turned off.