Shareable stylelint
config.
# pnpm
pnpm i -D @jeffersonwilliammachado/stylelint-config @stylelint/cli
# npm
npm i -D @jeffersonwilliammachado/stylelint-config @stylelint/cli
# Yarn
yarn add -D @jeffersonwilliammachado/stylelint-config @stylelint/cli
After installing it, apply the config to stylelint
by running the following command:
echo "module.exports = { extends: ['@jeffersonwilliammachado/stylelint-config'] };" > stylelint.config.js
To lint commits before they are created, install Husky and use the 'commit-msg' hook.
# npm
pnpm i -D husky
# npm
npm i -D husky
# yarn
yarn add -D husky
After that, you can create a .huskyrc
file or add to your package.json
the following code for
Husky v5:
# .husky/commit-msg
# pnpm
pnpx stylelint --quiet 'src/**/*.{css,scss,tsx}' --fix
# npm
npx stylelint --quiet 'src/**/*.{css,scss,tsx}' --fix
# yarn
yarn stylelint --quiet 'src/**/*.{css,scss,tsx}' --fix
MIT License