jefferson-william / stylelint-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@jeffersonwilliammachado/stylelint-config

npm version License

Shareable stylelint config.

Install

# 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

Usage

After installing it, apply the config to stylelint by running the following command:

echo "module.exports = { extends: ['@jeffersonwilliammachado/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

About

License:MIT License


Languages

Language:JavaScript 100.0%