@greenpoint/stylelint-plugin
v1.0.5
Published
A CSS linter enforcing best practices for ecocoding
Downloads
4
Readme
@greenpoint/stylelint-plugin
A CSS linter enforcing best practices for ecocoding
Installation
First run :
npm install @greenpoint/stylelint-plugin --save-dev
Add the plugin to your .stylelintrc.js
:
"plugins": ["@greenpoint/stylelint-plugin"],
"rules": {
"@greenpoint/stylelint-plugin/avoid-css-animations": "warn",
"@greenpoint/stylelint-plugin/no-resized-img": "warn",
"@greenpoint/stylelint-plugin/prefer-shorthand-css-notations-animation": "warn",
"@greenpoint/stylelint-plugin/prefer-shorthand-css-notations-content": "warn",
"@greenpoint/stylelint-plugin/prefer-shorthand-css-notations-layout": "warn",
"@greenpoint/stylelint-plugin/prefer-shorthand-css-notations-margin-padding": "warn",
"@greenpoint/stylelint-plugin/prefer-shorthand-css-notations-text": "warn",
"@greenpoint/stylelint-plugin/only-standard-font-use": "warn",
"@greenpoint/stylelint-plugin/group-similar-css-declarations": "warn",
}
Usage
Run the stylelint-linter on your .css files
stylelint .
Rules
⚠️ Configurations set to warn in.
✅ Set in the recommended
configuration.
| Name | Description | ⚠️ | | :---------------------------------- | :---------- | :-- |
| avoid-css-animations | Avoid usage of CSS animations
| no-resized-img | Warn when image is resized inside of the browser | ✅ |
| only-standard-font-use | Disallow the usage of non-standard fonts | ✅ |
| prefer-shorthand-css-notations-animation | Encourage usage of shorthand CSS notations | ✅ |
| group-similar-css-declarations | Group similar declarations of properties | ✅ |