stylelint-config-nahid
My sharable and pluggable Stylelint configuration.
Contents
stylelint
stylelint-config-prettier
stylelint-config-sass-guidelines
stylelint-config-standard
stylelint-config-wordpress
stylelint-prettier
stylelint-scss
Features
- Lints CSS and SCSS according to latest standards using Stylelint.
- Formats CSS & SCSS using Prettier.
Requirements
Installation
- If your project doesn't have a
package.json
file already, create one using thenpm init
command. - Run the command:
npx install-peerdeps --dev stylelint-config-nahid
- Create a file named
.stylelintrc
and insert the following there:
This object can also be added in your package.json
file instead under the stylelint
property.
Learn more about using shareable Stylelint config here.
Usage
- You can try running the following command
stylelint .
to run Stylelint. Look at Stylelint's command-line interface guide here. - I prefer adding two scripts to the
package.json
file:
"scripts":
That way, I can run npm run lint-css
and npm run lint-css:fix
to lint and lint/fix all the CSS & SCSS files in the codebase.
The documentation for Stylelint as a whole can be found here.