stylelint-processor-styled-components
stylelint-processor-styled-components copied to clipboard
Stylelint doesn't lint nested conditional block of styles
Environment
package.json:
"stylelint": "^13.6.1",
"stylelint-config-recommended": "^3.0.0",
"stylelint-config-styled-components": "^0.1.1",
"stylelint-processor-styled-components": "^1.10.0"
.stylelintrc:
{
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
]
}
Reproduction
const Container = styled.div<{ $hasError?: number }>(
({ $hasError }) => css`
/* LINTS HERE */
flex-direction: row;
align-items: center;
${$hasError && css`
/* DOESN'T LINT HERE */
background-color: red;
border: 1px solid black;
`}
`
);
Expected Behavior
Stylelint lints whole components
Actual Behavior
Stylelint doesn't lint styles which are located inside a nested conditional block