SamVerschueren / clinton

Project style linter
MIT License
122 stars 9 forks source link

`editorconfig` indent_style errors for multiline documentation #26

Closed SamVerschueren closed 7 years ago

SamVerschueren commented 8 years ago

The editorconfig rule lints the project with eclint. Although it works pretty well and detects everything. But, if we have the following file

'use strict';

/**
 * Returns `Foo Bar`
 */
module.exports = () => 'Foo Bar';

It will throw an error indicating that line 4 and 5 starts with a space instead of a tab because the indent_style was set to tab.

Is this incorrect behaviour of eclint? Not really I guess, because the first character really is a space. But this is not something that a developer should worry about because that's just how multiline documentation works in code.

Any ideas or suggestions? Currently I disable the editorconfig rule because of this.

// @sindresorhus @jfmengels @kevva

sindresorhus commented 8 years ago

Per https://github.com/jedmao/eclint/pull/36#issuecomment-155925547, maybe try lintspaces instead? Or roll you own.

Spaces for alignment should be allowed. It's commonly called "smart tabs". See: http://eslint.org/docs/rules/no-mixed-spaces-and-tabs#smart-tabs

SamVerschueren commented 7 years ago

This one will be solved with #77.