4.0.0 • Published 4 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
hslfor 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-configWith yarn
yarn add --dev stylelint @dweidner/stylelint-configUsage
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 stylelintWith Yarn
yarn run stylelint