Git Product home page Git Product logo

stylelint-scss-config's Introduction

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

stylelint-scss-config's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

addie-pi-aiii

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.