Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier-Stylelint Support #712

Open
psg2 opened this issue Mar 2, 2018 · 17 comments
Open

Prettier-Stylelint Support #712

psg2 opened this issue Mar 2, 2018 · 17 comments

Comments

@psg2
Copy link

psg2 commented Mar 2, 2018

Would It be feasible to add support for prettier-stylelint like prettier-eslint?

I love working on VSCode using prettier-vscode and not so long ago they added support for prettier-stylint, but that only works for css and related files. So I would like to have the same facility when working on .vue files.

I could start working on it with some guidance if It is considered as a good addition to Vetur
I already started reading through the source code to have some understanding of how it could be done.

@octref
Copy link
Member

octref commented Mar 6, 2018

prettier-eslint is added to address the lack of space-before-function-paren in its config, which I consider a reasonable use-case.

What's a similar use-case for css? I don't want Vetur to become a hodgepodge of every formatter.

@psg2
Copy link
Author

psg2 commented Mar 8, 2018

For the projects that I use stylelint, the first fixable error that comes to my mind is using the order rule. But it certainly isn't a big issue as the space-before-function-paren from eslint. But I guess it's just about fixable errors that every linter/formatter can have.

Vetur certainly should not become a hodgepodge of every formatter. I thought about the support for prettier-stylelint because it seemed to me that wouldn't be so different from prettier-eslint as both format files with prettier, which Vetur already has support, and then apply the --fix from the respective linters.

But if it is not feasible or in the direction of the project, what if it was possible to allow users to use custom formatters from outside the Vetur project through configuration?

@itwasmattgregg
Copy link

I would also love this feature. Or someone to explain how to get it to work. I need Vetur to use prettier for js in vue files with my eslint configuration and prettier for postcss in vue files with a stylelint configuration. I have prettier.eslintIntegration and prettier.stylelintIntegration turned on in my settings but it doesn't appear to respect my stylelint settings. Surprised more people don't have this issue.

@octref
Copy link
Member

octref commented May 23, 2018

You can follow this repo's guide to setup stylelint:
https://github.com/chrisvfritz/vue-enterprise-boilerplate/blob/master/docs/editors.md

@tigerclaw-az
Copy link

@octref your link doesn't provide any information on how to get vetur to work with prettier-stylelint. The problem I have is that whenever I save my .vue file it automatically formats the SCSS under <style> with default formatting of prettier and not my stylelint configuration.

@octref
Copy link
Member

octref commented Jun 4, 2018

@ejwaibel That's right, we don't have integration with prettier-stylelint yet. The error-checking are provided by the StyleLint extension.

@patrickcate
Copy link

I'd love to see prettier-stylelint support as well.

@ghost
Copy link

ghost commented Jun 6, 2018

I would also love to see prettier-stylelint integration with vetur - i find (opinion) eslint & stylelint the 2 most common formatting tools for js & css languages amongst the different development teams i've worked with for trying to maintain some kind of code style uniformity.

@multics
Copy link

multics commented Mar 19, 2019

+1

Linting style files, like css, less, etc. is as important as linting js files. Please consider to support it.

@nilsdjupvik
Copy link

+1

3 similar comments
@Ishadimu
Copy link

+1

@aegorx
Copy link

aegorx commented Jul 19, 2019

+1

@ux-engineer
Copy link

+1

@selfagency
Copy link

can't believe that pull request has been sitting there for six months

@multics
Copy link

multics commented Apr 26, 2020

unbelievable

1 similar comment
@skylingfly
Copy link

unbelievable

@octref
Copy link
Member

octref commented Aug 3, 2020

I merged origin/master into #1567 and it's not working. It seems https://github.com/hugomrdias/prettier-stylelint is abondonded and https://github.com/prettier/stylelint-prettier is now active.

PR welcome as I'm focusing on other tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.