Code Monkey home page Code Monkey logo

Comments (3)

hudochenkov avatar hudochenkov commented on June 15, 2024

Had you shared config somehow between stylelint-order and postcss-sorting before? Do you share it somehow now?

There is no way to just use .stylelintrc for postcss-sorting, because stylelint's rules and this plugin's rules have different names.

Stylelint:

{
    "order/declaration-block-order": [],
    "order/declaration-block-property-groups-structure": []
}

postcss-sorting:

{
    "order": [],
    "properties-order": []
}

So it already needs some config conversion. Since it needs conversion, it can use more simple values then. My goal is to make independent software, which can be used by itself without stylelint. Config is friendlier for people not familiar with stylelint.

But I kept in mind stylelint when was developing v2. Stylelint's config can be used by this plugin, but after a little conversion.

There is a tool to format style sheets with stylelint config — stylefmt. I'm going to add stylelint-order rules to it, and it will use postcss-sorting internally.

from postcss-sorting.

wroughtec avatar wroughtec commented on June 15, 2024

True if you add stylelint in directly like that they do not match but internally the blobs are almost the same and its easy to set the rules without needing the entire blob:

'properties-order': config.rules['order/declaration-block-property-groups-structure']

In v1 no I could not use the rules directly (well I could in an earlier version of stlyelint before they removed the order rules) had to write some rules to translate the order which was why I was glad that v2 came out and pretty much respected the rule structure.

Yes I already use stylefmt as well so if you will be adding these rules there as well then potentially I can remove the sorting from my build step however I just thought these match as they are now would have been useful.

from postcss-sorting.

hudochenkov avatar hudochenkov commented on June 15, 2024

@wroughtec I won't change this, because I'll drop these options altogether in the next major version in favor of stylelint's soon coming autofixing.

stylefmt supports stylelint-order now.

from postcss-sorting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.