-
Notifications
You must be signed in to change notification settings - Fork 61
Version 1.2.0 breaks complex multiline expressions #165
Comments
@chinesedfan could you look at this as it seems to relate to your multiline interpolation PR? Also @joakimkemeny if you could please share the version of all the relevant packages (stylelint specifically) and your stylelint config |
I use the latest version of these libs (I found this problem as I was updating all dependencies):
My stylelint config is really simple: {
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-standard",
"stylelint-config-styled-components"
],
"rules": {
"no-descending-specificity": null
},
"syntax": "scss"
} |
@emilgoldsmith Confirmed they were introduced by 1.2.0.
Our new substitution method will convert the multi-line interpolation to comments, but stylelint treated comments as empty strings in value. Maybe we should filter these warnings as well as indentations.
The old substitution just kept one line so no warnings before. But I think the current implementation is more reasonable. Because it is really a multi-line declaration, even written in interpolation. |
Hmm, I don't think we can filter here though, as it would be overkill and remove a lot of valid errors. What about instead of comments we just put in dummy css. Such as |
We have
Comments are not the best dummy css. But as discussed in #140, it is still hard to replace with |
What's the latest status on this issue (I'm not familiar with the codebase, and so I'm not following the discussion here...)? The problem still exists in v1.3.1. |
No one has yet to take on solving the issue, @edahlseng feel free to be the one to do it |
@emilgoldsmith, I'm happy to take a look at solving, but I'm completely new to the codebase. Do you have any recommendations on where a good place to start looking may be? |
Thanks @edahlseng! You can take a look at #140 to get some inspirations. If still have questions, feel free to ask us. |
Just wondering if there's any progress with this? I have these linting errors in version 1.3.2 and not sure how to get around it with either disabling the rules globally or disabling them for a file/line which doesn't feel right. |
@caribou-code Can you try #220 locally? I hope more people can help me test the fix. |
Let's say I have some styles with a switch statement that Prettier formats like this:
This was fine before 1.2.0 but in 1.2.0 I get the following errors:
The text was updated successfully, but these errors were encountered: