-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create custom Stylelint syntax so you can use Stylelint with Emotion #2695
Comments
how is going? |
@leohxj I believe it wasn't started already 😕 |
For what it's worth I was fiddling with this today and jacobrienstra/postcss-lit@bf29170 just adding 'jsx' in the babel parser did a lot of the initial work. It parses and rearranges the template literals. Still can't insert empty lines for some reason, or won't, and it doesn't handle literals within the css literal well. |
Any progress? 👀 |
There are more details over here: styled-components/styled-components#3607 (comment) Our config, which we use for linting CSS in
/** @type { import('stylelint').Config } */
const config = {
extends: [
'stylelint-config-recommended',
'stylelint-config-styled-components',
'stylelint-config-prettier',
],
rules: {
'no-descending-specificity': null,
},
overrides: [
{
files: [
'**/*.js',
'**/*.cjs',
'**/*.mjs',
'**/*.jsx',
'**/*.ts',
'**/*.tsx',
],
processors: ['stylelint-processor-styled-components'],
customSyntax: 'postcss-scss',
},
],
};
module.exports = config; It mostly works - at least better than nothing. As soon as either Emotion or Styled Components can provide an updated solution (eg. a |
@Andarist @emmatown would creating this Stylelint syntax be something that the Stylelint team would take over? Would be great to get first-class support! Similar issue over in the Styled Components repo over here: styled-components/styled-components#3607 (comment) |
I've opened the following issue to ask for a |
In the meantime, there have been two custom syntaxes published 🎉🙌
I would suggest that anyone looking to set up Stylelint with Emotion or Styled Components to try these out! Super big thanks to @43081j and @hudochenkov for putting in the work to get these out the door! |
So now that there are these two custom syntaxes, maybe this issue can be closed now @srmagura? |
Thanks for implementing this :) |
I didn't have any luck getting either to work with
I get these kinds of errors
With
Is anybody else having any luck? |
@scottdickerson could open an issue with full example and info? I can take a look if it's something with syntax, Stylelint, or something else.
|
|
I've tried to adopt
whereas if I try to run with {
"extends": ["stylelint-config-standard"],
"customSyntax": "postcss-styled-components"
} any other person still facing this? |
The text was updated successfully, but these errors were encountered: