4.0.0 • Published 2 years ago
@dweidner/stylelint-config v4.0.0
@dweidner/stylelint-config
An opinionated, shareable config for stylelint.
Extends stylelint-config-standard
.
Turns on a handful of additional rules in addition to those already activated in the standard configuration:
- Standardize quotes
- Standardize font notations
- Prefer
hsl
for color notations - Disallow vendor prefixes (use autoprefixer instead)
- Control specificity
Installation
Install stylelint and @dweidner/stylelint-config
With npm
npm install --save-dev stylelint @dweidner/stylelint-config
With yarn
yarn add --dev stylelint @dweidner/stylelint-config
Usage
If you've installed @dweidner/stylelint-config
locally within your project, just reference it in your stylelint
config. See the stylelint configuration documentation for more details.
{
"extends": "@dweidner/stylelint-config"
}
Check the stylelint CLI documentation((https://stylelint.io/user-guide/cli/) to see how to execute the linter. One possibility would to add the following configuration to your package.json
:
{
"scripts": {
"stylelint": "stylelint 'src/**/*.scss'"
}
}
Now you can check for style violation by running the following commands:
With npm
npm run stylelint
With Yarn
yarn run stylelint