Skip to content

// style comment support #1149

Closed
Closed

Description

@chriseppstein

The stylelint and prettier folks have complained about postcss not supporting // style comments in the selector parser.

I have told them that if they need postcss plugins to support it, must come from postcss first and foremost.

Here's an example of how postcss currently parses the "to-end-of-line" comments.

The AST returned is basically useless. If postcss wants to support this, it will need to add specific handling for it. Possibly with an option that enables it, because it's non-standard syntax.

Activity

  1. ai commented on May 16, 2018

    @ai
    Member

    Do they use postcss-scss parser? Since // is not part of CSS syntax, we keep parsing // there.

    The AST Explorer doesn't support postcss-scss (your link contains different csstree parser).

  2. chriseppstein commented on May 16, 2018

    @chriseppstein
    ContributorAuthor

    @ai ok thanks for clarifying. Sorry about the confusion. I'm still coming up to speed on how all this fits together.

    It does look like stylelint uses postcss-scss and prettier does too. I wasn't aware these existed so I had been testing against postcss itself.

    The selector parser tries to be all the syntaxes in one with no mode option, strict setting, or anything else like that. I don't think it's a good idea and would prefer if it was clearly supporting specific syntaxes. Errors are a feature.

    Closing this, will track from the selector-parser repo.

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

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