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

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

Open
dawidk92 opened this issue Jul 24, 2020 · 0 comments
Open

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

dawidk92 opened this issue Jul 24, 2020 · 0 comments

Comments

@dawidk92
Copy link

dawidk92 commented Jul 24, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant