Is it possible to force Stylelint to lint conditional blocks of styles?
July 23, 2020 at 3:03pmIs it possible to force Stylelint to lint conditional blocks of styles?
July 23, 2020 at 3:03pm (Edited 2 years ago)An example:
const Container = styled.View<{ $marginBottom?: number }>(({ $marginBottom }) => css`/* LINTS HERE */flex-direction: row;align-items: center;${$marginBottom && css`/* DOESN'T LINT HERE */margin-bottom: ${$marginBottom};`}`);
July 24, 2020 at 7:47am
could you please share a link to that issue? I cannot find it. Also could you please show what do you mean by converting inline conditional to a function, I'm not sure if I understand you right.
This is the closest thing I found: https://github.com/stylelint/stylelint/issues/4119. The issue description includes the suggested workaround.
In general, the right repo for these issues is https://github.com/styled-components/stylelint-processor-styled-components