microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.99k stars 29.54k forks source link

[css] Consider stylelint for CSS linting #1900

Closed davidtheclark closed 8 years ago

davidtheclark commented 8 years ago

I was trying out Visual Studio recently and realized that it uses CSS Lint. As one of the creators of stylelint, I am writing to ask you to consider adding stylelint support, so Visual Studio users can take advantage of a more robust and active CSS linter.

CSSLint was good for its time, but is limited and pretty much stagnant. With stylelint, we're trying to create a newer and better tool. stylelint is actively growing and very actively maintained; it is powered by PostCSS, a tool & ecosystem that is blowing up right now; and it has adopted many fantastic features from ESLint, like plugins, shareable configs, and custom reporters. Because styelint uses PostCSS for parsing, it can handle any syntax that PostCSS can, which currently includes SCSS and potentially includes anything else, like Less and Stylus (when people build the parsers for them).

Please let me know if you have any questions about stylelint. Feedback on the project would also be appreciated. Thanks for your consideration.

And please let me know if I should instead file this issue with WebAnalyzer — I wasn't sure which project was the right one to ask.

ai commented 8 years ago

Also it may fix PostCSS support in Visual Studio.

benfrain commented 8 years ago

The absence of stylelint support is one of only two things stopping me using Code more (the other being a'goto symbol in project' capability for CSS). To get stylelint built in would be fantastic (a 3rd party plugin like Sublime's would be a close second).

I'd also go so far as to say I don't know many progressive CSSers that rely on CSSlint for their listing anymore. For my money, stylelint is its natural successor.

egamma commented 8 years ago

This is an extension opportunity and there already is a stylelint extension. Repository: https://github.com/shinnn/vscode-stylelint.

Code supports to disable the built-in css linting (which is a custom linter) using a setting:

"css.validate": false
aeschli commented 8 years ago

Thanks am lot for the pointer and info! @davidtheclark Visual Studio Code and Visual Studio are different products, not sure which one you meant. This issue tracker is for Visual Studio Code, for Visual Studio feature requests you would post here: http://visualstudio.uservoice.com/forums/121579-visual-studio. If you meant Visual Studio Code, you are right, we have no support for stylelint yet. Since November we however have an extension API that allow you to add additional linters. Check our API documentation on that: https://code.visualstudio.com/docs/extensions/example-language-server It would be great if the community could pick this up!

davidtheclark commented 8 years ago

Thanks @egamma and @aeschli. I did mean Visual Studio Code.

built-in css linting (which is a custom linter)

Is the built-in linter not CSSLint? It certainly seems to be.

Since there's already a VS Code extension for stylelint, this issue is about the built-in linting. If that's not up for reconsideration, feel free to close the issue.

egamma commented 8 years ago

Is the built-in linter not CSSLint? It certainly seems to be.

It provides similar rules as CSSLint but it is a custom implementation. There now also is an extension for CSSLint.

Closing this issue, we currently have no plans to replace the built-in linter.