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

State of stylefmt #214

Open
hudochenkov opened this issue Sep 30, 2016 · 6 comments
Open

State of stylefmt #214

hudochenkov opened this issue Sep 30, 2016 · 6 comments

Comments

@hudochenkov
Copy link
Contributor

Stylefmt position itself as a tool, which changes CSS according to stylelint's config. But it's not entirely accurate. Stylefmt has opinionated default settings, which applies regardless stylelint's config. For example, I have a stylelint config which has almost every stylelint rule configured. Stylefmt regardless settings put empty lines between rules (both nested and in root) and make a multiline selectors single line. After that stylelint throws a lot of errors, of course.

A community needs a complimentary tool for stylelint to fix CSS. A community needs a tool they can rely on. But right now stylefmt is a mix of a tool, which changes CSS according to stylelint's config, and a tool, which changes CSS with hardcoded options.

Would you like to change stylefmt to a tool which will use only stylelint's config for its modification?

I believe, stylefmt should not change anything without stylelint config and work stylelint way. I mean, it should make changes with enabled rules only. Each rule should care only about itself.

Also, I think each supported rule should be 100% compatible with stylelint (if it's technically possible). It means if stylefmt changes something according to a rule, stylelint should pass and not throws errors. Things like that shouldn't happen #175

@matype
Copy link
Owner

matype commented Oct 2, 2016

@hudochenkov I will try to refactor all stylefmt's code and all of its default rules load from the original stylelint config (e.g. stylelint-config-stylefmt(optional)) on the next major version.

I think each supported rule should be 100% compatible with stylelint (if it's technically possible).

I need more contributors :)

@hudochenkov
Copy link
Contributor Author

hudochenkov commented Oct 2, 2016

It's great! I would like to help with declaration-block-properties-order. This rule formatter is based on my postcss-sorting, and, because of this, there are some side effects. For example, postcss-sorting removes all empty lines. And has some others side effects.

I'll release next version of postcss-sorting with ability to sort rules without side effects, so it will fit better in stylefmt. With this version I'll fix #175.

Also, I released stylelint-declaration-block-order for checking the order of content within declaration blocks. It covers variables, nested rules, etc. It'll play nicely with postcss-sorting. Can stylefmt support stylelint plugin's config? I would like to add support for this plugin into stylefmt.

@lkraav
Copy link

lkraav commented Oct 2, 2016

A community needs a complimentary tool for stylelint to fix CSS. A community needs a tool they can rely on. But right now stylefmt is a mix of a tool, which changes CSS according to stylelint's config, and a tool, which changes CSS with hardcoded options.

This also took me a while to understand. I was expecting a blank stylelint configuration to result in unchanged output. Perhaps this should be reflected in README with more emphasis to avoid wasting time.

@lkraav
Copy link

lkraav commented Oct 2, 2016

I see several issues addressing this already, #157 for example. Good to know it's coming.

@macgyver
Copy link

I need more contributors :)

@morishitter I'd love to contribute but it seems like the basic architecture is in flux right now - is there a way to contribute in a small way that won't conflict with the greater changes on the roadmap? Some oss projects like to add labels such as "good beginner ticket" to issues...

@matype
Copy link
Owner

matype commented Oct 24, 2016

@macgyver stylefmt is not large project like facebook/flux, so feel free to send me PR :)

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

No branches or pull requests

4 participants