43081j / 43081j/postcss-lit

[Bug] stylelint customSyntax postcss-lit deletes custom variables

未關閉
#40 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
90
分支
9
平均合併
1 天 9 分鐘
30 天內合併 PR
3

描述

First of all big thanks for fixing the main issue with variables inside string literals in css files for lit components.

The bug happens when you are using both a linter (to cut long lines of css into multiple lines) and stylelint with customSyntax postcss-lit in the following scenario:

let's assume we have the following css (single line css selector):
.long-class-name-container.${veryLongVariableNameAddedHere} .small-image-container span ${anotherVeryLongVariableNameAddedHere} img {
width: 100%;
height: 100%;
}

This will get parsed after linting into:
.long-class-name-container.${veryLongVariableNameAddedHere}
.small-image-container
span
${anotherVeryLongVariableNameAddedHere}
img {
width: 100%;
height: 100%;
}

And after stylelint into:
.general-takeover-container./* missing variable veryLongVariableNameAddedHere here*/
.small-image-container
span
/* missing variable anotherVeryLongVariableNameAddedHere here*/
img {
width: 100%;
height: 100%;
}

This is not happening when for example we have only one ${variable} at the end with "{" and gets parsed on the last line like:
.long-class-name-container .small-image-container span ${anotherVeryLongVariableNameAddedHere} {

into .long-class-name-container
.small-image-container
span
${anotherVeryLongVariableNameAddedHere} {
width: 100%;
height: 100%;
}

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。