This is an my stylelint config.
It uses Standard's as a base, has Prettier and SCSS baked in, and overrides some rules I've seen ourselves having to change often.
-
Install the following dev-dependencies:
npm install --save-dev @ofk/stylelint-config-recommend stylelint prettier
-
Extend the
@ofk/stylelint-config-recommend
config in your.stylelintrc
(orstylelint
key in yourpackage.json
):"stylelint": { "extends": "@ofk/stylelint-config-recommend" }
-
Run
eslint
on your project as part of yourlint
andformat
scripts:"scripts": { "lint": "stylelint \"**/*.{css,scss}\"", "format": "npm run lint -- --fix", "pretest": "npm run lint", "test": "test command" }