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

Make sure we don't explode on Vue and css-in-js solutions #22

Merged
merged 1 commit into from
May 12, 2019
Merged

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented May 11, 2019

Stylelint 9.10.0 uses postcss-jsx to parse css-in-js solutions and postcss-html to parse vue/markdown/html files. These two together mean the embedded languages landscape is a lot cleaner than a few months ago in the days of 9.2.1.

However stylelint 9.9 to 9.10 changed how these embedded languages were passed into rules. In 9.9 the whole file content was available in root.source.input (i.e. a whole html or vue file, including all surrounding html tags tags). In 9.10 only the contents of style language fragments are available (i.e. only the content of each of the <style> tags gets passed to the rule).

This means that we can run stylelint with stylelint-prettier over these embedded language files, but it'll only prettify the style portions. If you're this interested in prettier then you probably want to run prettier over the rest of the file too to get it fully formatted. Thus it seems pointless to duplicate that work of running prettier within stylelint.

So stop running prettier over this handful of languages that can have style languages embedded into them.

This also adds a handful of e2e tests as which allow us to keep testing the embedded language end-to-end.

Fixes #18, #15 and #12.

@BPScott BPScott force-pushed the vue branch 3 times, most recently from ff2a0da to 2c7a214 Compare May 11, 2019 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid errors when linting Vue.js SFCs.
1 participant