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

broken ast #204

Open
vankop opened this issue Jul 31, 2019 · 10 comments
Open

broken ast #204

vankop opened this issue Jul 31, 2019 · 10 comments
Labels

Comments

@vankop
Copy link
Contributor

vankop commented Jul 31, 2019

regarding to stylelint/stylelint#4049

.foo1, // this comments is marked as an error
.foo2 {
    color: #fff;
}

Parsers // this comments is marked as an error as selectors

@alexander-akait
Copy link
Collaborator

Known issue, we should rewrite parser whole, now we parse comments as part of ast, but it is invalid, we should use leadingComments, trailingComments and etc as do babel (try this in https://astexplorer.net/), it is allow to keep ast clean and works with comments in right way (without pain)

@vankop
Copy link
Contributor Author

vankop commented Jul 31, 2019

Is it possible to contribute? or this issue still is in discussion?

@alexander-akait
Copy link
Collaborator

@vankop it is breaking change, anyway let's do it, in future we should use safe option and throw error on this syntax when for pure css

@vankop
Copy link
Contributor Author

vankop commented Aug 26, 2019

@evilebottnawi I will take this.

@alexander-akait
Copy link
Collaborator

👍

@vankop
Copy link
Contributor Author

vankop commented Aug 29, 2019

@evilebottnawi should we skip comments in .toString() method?

Currently https://github.com/postcss/postcss-selector-parser/blob/master/src/__tests__/util/helpers.js#L24 we expect that comments will be in output

@alexander-akait
Copy link
Collaborator

No, we should print comments

@vankop
Copy link
Contributor Author

vankop commented Sep 26, 2019

Sorry I was a bit stuck with stringifying comments correctly and gave up =) I hope I will find time on the next week or will create WIP PR.

@daddyschmack
Copy link

This issue is occurring in upgrade for angular 12, and i also get this criptic error message that the angular people says comes from this progam after I replace all the // comments:
Error: Unexpected '/'. Escaping Social characters with \ may help

Shouldn't the error message give a location where this error occurs?

@guilhermetod
Copy link

@daddyschmack just helped a teammate with this. Apparently this is a problem with CRLF or something related to Stylelint's ignoreFiles.

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

No branches or pull requests

4 participants