Personal Stylelint config presets. Used for:
- Linting CSS files
- Linting SCSS files
- Linting Both CSS and SCSS style blocks
- Linting inline CSS
# Using pnpm
pnpm add -D stylelint @yungezeit/stylelint-config
# Using yarn
yarn add -D stylelint @yungezeit/stylelint-config
# Using npm
npm i -D stylelint @yungezeit/stylelint-config
See Presets to refine your configuration install
Set the extends
property of Stylelint's configuration :
{
"extends": "@yungezeit/stylelint-config"
}
{
"scripts": {
"stylelint": "stylelint .",
"stylelint:fix": "stylelint . --fix"
}
}
Create/edit the .vscode/settings.json
file and add the following:
{
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
},
"css.validate": false,
"less.validate": false,
"scss.validate": false,
// add "vue" if using @yungezeit/stylelint-config-vue
// add "svelte" if using @yungezeit/stylelint-config-svelte
"stylelint.validate": ["css", "scss"],
}
This will autofix files on save and let Stylelint handle code formatting.
@yungezeit/stylelint-config-base
This preset extends the following ones:
@yungezeit/stylelint-config-vue
This preset extends the following ones:
@yungezeit/eslint-config-svelte
This preset extends the following ones: