Stylelint Config Preset
Installation
yarn add @dlwlrma/stylelint-config --D
After installation create a file stylelint.config.js
at project root and extend the config:
{
"extends": ["@dlwlrma/stylelint-config"],
"rules": {}
}
Usage
Simply read the stylelint documentation and follow those instructions.
Git Hook
Setup pre-commit hook for styles linting.
yarn add husky --D
npm install husky --save-dev
Update package.json
"scripts": {
"lint:style": "stylelint \"**/*.less\" --syntax less --fix --allow-empty-input",
},
"husky": {
"hooks": {
"pre-commit": "npm run lint:style"
}
},