1.0.6 • Published 4 years ago
stylelint-config-nahid v1.0.6
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
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:
{
"extends": [ "stylelint-config-nahid" ]
}
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": {
"lint-css": "stylelint \"**/*.{css,scss,sass}\"",
"lint-css:fix": "stylelint \"**/*.{css,scss,sass}\" --fix"
}
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.