0.0.2 • Published 1 year ago
@classcraft.edu/stylelint-config v0.0.2
@classcraft.edu/stylelint-config
Shareable stylelint
config.
Install
# pnpm
pnpm i -D @classcraft.edu/stylelint-config
# npm
npm i -D @classcraft.edu/stylelint-config
# Yarn
yarn add -D @classcraft.edu/stylelint-config
Usage
After installing it, apply the config to stylelint
by running the following command:
echo "module.exports = { extends: ['@classcraft.edu/stylelint-config'] };" > stylelint.config.js
Bonus
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
License
MIT License