Skip to content

explooosion/stylelint-scss-config

Repository files navigation

stylelint-scss-config

This is the general settings about stylelint for scss.


The rules include stylelint-order, you can easily to order scss properties by stylelint with --fix.

Run Sample

git clone https://github.com/explooosion/stylelint-scss-config.git
cd stylelint-scss-config && yarn # or npm install
yarn lint # or npm run lint
yarn lint:fix # with auto fix

How To Use

1. Installation

Checkout the package.json and install the devDependencies.

npm

npm install -D stylelint stylelint-config-prettier stylelint-config-sass-guidelines stylelint-config-standard stylelint-order stylelint-scss pre-commit

yarn

yarn add -D stylelint stylelint-config-prettier stylelint-config-sass-guidelines stylelint-config-standard stylelint-order stylelint-scss pre-commit

2. Add Scripts and Precommit

Please add the following script to package.json.

{
 "scripts": {
    "lint": "stylelint app/scss/**/**/**/*.scss --syntax scss",
    "lint:fix": "stylelint app/scss/**/**/**/*.scss --syntax scss --fix"
  },
  "pre-commit": [
    "lint"
  ],
}

3. Add .stylelintrc.json

Copy .stylelintrc.json into project root directory.

4. Install extensions

If your IDE is vscode, please install the following extensions:

5. Start Lint

Now you can check your scss with the following command:

yarn lint

License

MIT

Releases

No releases published

Packages

No packages published

Languages