Hoppa till innehåll

@soleil-se/stylelint-config

v1.1.0 NPM

Stylelint config based on stylelint-config-standard and stylelint-config-rational-order.

Installation

yarn add @soleil-se/stylelint-config --dev Add all peerDependencies: yarn add stylelint stylelint-config-rational-order stylelint-config-standard stylelint-order stylelint-scss --dev

Create .stylelintrc in the root of the project containing:

{
"extends": "@soleil-se/stylelint-config"
}

VS Code

Install stylelint for VS Code.

Settings

Open settings.json and add the following settings:

"css.validate": false,
"less.validate": false,
"scss.validate": false,
// If you want autofix enabled
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}

CLI

Add the following to package.json and then adjust paths and file extensions.

{
"scripts": {
"stylelint": "npx stylelint ./path/to/css/**/*.css --allow-empty-input",
"stylelint-fix": "npx stylelint ./path/to/css/**/*.css --fix --allow-empty-input"
}
}

https://stylelint.io/user-guide/usage/cli