Skip to content

Commit

Permalink
Use stylelint-plugin-defensive-css (#115)
Browse files Browse the repository at this point in the history
* Install Stylelint plugin `use-defensive-css`

* Configure Stylelint plugin `use-defensive-css`
  • Loading branch information
germanfrelo authored Aug 26, 2024
1 parent e385ba9 commit d5c82ad
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
23 changes: 22 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"prettier": "3.3.3",
"stylelint": "16.8.2",
"stylelint-config-recess-order": "5.1.0",
"stylelint-config-standard": "36.0.1"
"stylelint-config-standard": "36.0.1",
"stylelint-plugin-defensive-css": "1.0.4"
}
}
16 changes: 16 additions & 0 deletions stylelint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
"stylelint-config-standard",
"stylelint-config-recess-order",
],
plugins: ["stylelint-plugin-defensive-css"],
reportDescriptionlessDisables: true,
reportInvalidScopeDisables: true,
reportNeedlessDisables: true,
Expand Down Expand Up @@ -93,5 +94,20 @@ export default {
// "keyframes-name-pattern": null,
// "selector-class-pattern": null,
// "selector-id-pattern": null,

// plugin/use-defensive-css
"plugin/use-defensive-css": [
true,
{
"severity": "warning",
"accidental-hover": true,
"background-repeat": true,
"custom-property-fallbacks": true,
"flex-wrapping": true,
"scroll-chaining": true,
"scrollbar-gutter": true,
"vendor-prefix-grouping": true,
},
],
},
};

0 comments on commit d5c82ad

Please sign in to comment.