Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.
This repository was archived by the owner on May 14, 2021. It is now read-only.

Stylelint doesn't lint nested conditional block of styles #298

@dawidk92

Description

@dawidk92

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions