turbio / bracey.vim

live edit html, css, and javascript in vim
GNU General Public License v2.0
482 stars 25 forks source link

Replace CSS parser with postcss #40

Closed jdsutherland closed 4 years ago

jdsutherland commented 4 years ago

Partially fixes #36.

https://www.npmjs.com/package/css doesn't support newer CSS features. When encountering newer CSS like CSS3 variables or certain grid syntax, the server blows up because the parser returns undefined. postcss doesn't have this issue.

There is an additional wrinkle here as mentioned in #36:

csslint doesn't support some newer features, notably CSS3 variables. So even though postcss works, csslint causes bracey to show false positives.

so with this PR, the parsing works but csslint will still cause bracey to blow up.

It looks like csslint is dead (see https://github.com/CSSLint/csslint/issues/720), so the solution appears to be either replace it with stylelint or simply remove csslint from bracey.

I'm not sure this PR will get any response but if there is interest, we can discuss the linting issues.

jdsutherland commented 4 years ago

@turbio the issue still persists because csslint doesn't support newer CSS syntax. This PR merge is progress but doesn't have much effect without addressing the linting (it also blows up). What are your thoughts?

turbio commented 4 years ago

@jdsutherland gotcha, I'll re-open the issue. I'm thinking the best path forward is to update the linter as well (assuming that's easy). I forget the specifics of how linting works in Bracey but for the current purpose it might be sufficient to also use the postcss parser for error checking.