-
Notifications
You must be signed in to change notification settings - Fork 262
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
processor for stylelint #106
Comments
I believe that you can get stylelint working if you use styled-jsx-postcss instead. @rauchg I suppose that this is never going to happen in |
@giuseppeg what about https://csstree.github.io/docs/validator.html?... or when the transformer is updated to v1.0 stylis you could register a custom linter as a plugin. |
It'd be cool to have support for linting, with stylis |
@rauchg working on v1.2 that will have better support for creating a linter plugin, will create a basic linter plugin after that is out. |
@rauchg This should now be possible with v1.2.0 relevant issue |
I think that this can be done as a plugin if/when #190 lands. Can we close it? |
Got it working! On top of stylelint you need the "{at}mapbox/stylelint-processor-arbitrary-tags" processor and the "stylelint-config-css-modules" configuration (for allowing "global()"-syntax).
XOR
.stylelintrc{
"extends": [
"stylelint-config-standard",
"stylelint-config-css-modules"
],
"processors": [
[ "@mapbox/stylelint-processor-arbitrary-tags", {
"startTag": "\\s*<style jsx>{`",
"endTag": "\\s*`}<\/style>"
}
]
],
"rules": {
"no-empty-source": null
}
} Now lint code:
Of cource, this can be done nicer with a npm script... IMO it's worth adding to the "readme.md". :) |
@rauchg, @nkzawa, @giuseppegurgone Can we use @rsternagel approach as the best one and add it to readme? |
@rsternagel Thank you for your example above. I get a |
+1 error too |
I'm getting that error also. It works fine if I don't use interpolated values though. |
Fixed by #291 I made a test plugin https://github.com/giuseppeg/styled-jsx-plugin-stylelint it is a proof of concept but you guys can start from there (contribute and make it better) |
Have you figured out how to use for <style> tags and for .css files at the same time? |
I've made a custom syntax for stylelint based on the |
Maybe this issue deserves to be re-open, as no complete solution has been found yet ? |
No description provided.
The text was updated successfully, but these errors were encountered: