stylelint-processor-styled-components icon indicating copy to clipboard operation
stylelint-processor-styled-components copied to clipboard

Stylelint doesn't lint nested conditional block of styles

Open dawidk92 opened this issue 4 years ago • 0 comments

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

dawidk92 avatar Jul 24 '20 11:07 dawidk92