Reputation: 391
I have a project that make use of styled-components and I just have installed Stylelint
following the official guide[1].
My .stylelintrc.json
already have declaration-no-important set to true
but seems have no effect, because I have one component that make use of !important
(see bellow)
{
"processors": ["stylelint-processor-styled-components"],
"extends": ["stylelint-config-recommended", "stylelint-config-styled-components"],
"rules": {
"declaration-no-important": true
}
}
$ ag important
lib/components/molecules/Checkbox/Checkbox.styles.ts
24: border-color: #7e77a1 !important;
What I need to do to Stylelint warn me about the use of !important
?
1 - https://styled-components.com/docs/tooling#stylelint
Upvotes: 2
Views: 1042
Reputation: 310
Could you try this instead?
'declaration-no-important': [true, { 'severity': 'warning' }]
Upvotes: 3