styled-components / stylelint-processor-styled-components

Lint your styled components with stylelint!

Home Page:https://styled-components.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stylelint doesn't lint nested conditional block of styles

dawidk92 opened this issue · 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