0.1.5 • Published 3 years ago
@robinblomberg/stylelint-config-hac-stylelint v0.1.5
HAC Stylelint
Installation
npm install --save-dev @robinblomberg/stylelint-config-hac-stylelint
Configuration
Create a file called .stylelintrc.json at your project root:
{
"extends": "@robinblomberg/stylelint-config-hac-stylelint"
}
NPM scripts
Add the following scripts to your package.json:
{
"scripts": {
"lint-stylesheets": "npx stylelint \"src/**/*.{css,scss}\"",
"lint-stylesheets-fix": "npx stylelint \"src/**/*.{css,scss}\" --fix"
}
}
Adjust the paths according to your project/file structure as necessary (e.g. "npx stylelint \"src/**/*.scss\""
).
To run a script, enter the following in your command line:
npm run lint-stylesheets
Fix-on-save in VS Code
To enable Stylelint fix-on-save, add the following to your VS Code settings.json:
{
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}
}