Skip to content

Linting in markup for class order and duplicates #572

@rightaway

Description

@rightaway

As I'm using tailwind more and more it's great but I'd like to enforce some kind of linting in my markup (in this case I'm using Vue single file components for the markup) to ensure things are consistent and maintainable.

It would be good to have linting errors when classes for a given element are duplicated, like when it's the same value (text-red appearing twice, or text-red followed by text-blue meaning the first one isn't used). Also when classes are out of order, which can make it easier to find a class when you use a lot of them if they're in an expected order (here's a sample order for a different framework https://github.com/brigade/scss-lint/blob/master/data/property-sort-orders/concentric.txt).

I know tailwind isn't the right place for such a tool but some discussion around this kind of tooling that could meet this requirement is good and a section could be added to the documentation for people who are interested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions