SamVerschueren / clinton

Project style linter
MIT License
122 stars 9 forks source link

Enforce rules in `.editorconfig` #77

Closed sindresorhus closed 7 years ago

sindresorhus commented 7 years ago

You could use https://github.com/editorconfig/editorconfig-core-js to enforce the rules in .editorconfig.

SamVerschueren commented 7 years ago

I previously tried that but with another tool, I think eclint. It didn't work for smart indentation. I will have a look at this one. Thanks!

sindresorhus commented 7 years ago

You could only target non-code files where smart indentation is rarely used. I mostly need this for package.json, readme.md, etc.

SamVerschueren commented 7 years ago

Good point, will look into it

SamVerschueren commented 7 years ago

I found a solution. As suggested by you in #26, I took a look at lintspaces. This one works as I want which is pretty neat :)!

I have just one question about the output. The editorconfig linter gives me a line number of an error. But when I render that like XO, it looks like this.

screen shot 2017-06-16 at 21 18 38

This looks pretty aweful to me. So I tried with another approach. I strip off the dot at the end of the message at add at line <NR>.

screen shot 2017-06-16 at 21 17 54

Not sure about the last one either. Any suggestions?

sindresorhus commented 7 years ago

The last one looks better indeed.

SamVerschueren commented 7 years ago

I implemented it and it seems to work fine. Still having some issues on Windows apparently.