4.0.0 • Published 3 months ago

neworbit-stylelint-config v4.0.0

Weekly downloads
254
License
MIT
Repository
github
Last release
3 months ago

neworbit-stylelint-config

NewOrbit standard config for stylelint

Usage

Installation

npm install neworbit-stylelint-config --save-dev

Setup

  • Install peer dependencies npm install stylelint stylelint-config-standard-scss @stylistic/stylelint-config stylelint-scss stylelint-order stylelint-no-unsupported-browser-features --save-dev
  • Add .stylelintrc.json file with the following contents:

    {
       "extends": "neworbit-stylelint-config"
    }
  • Add an npm script to run linter

        "lint:sass": "stylelint \"**/*.scss\""

Integrate with webpack

You may want to integrate with webpack so that you get linting warnings on build. You may also want to consider failing on production build so linting errors block a pull request.

npm install stylelint-webpack-plugin --save-dev

const StyleLintPlugin = require('stylelint-webpack-plugin');

const config = { /* webpack config */ };

let styleLintOptions = {
    files: "**/*.scss"
};

if (process.env.NODE_ENV === "production") {
    styleLintOptions.failOnError = true;
}

config.plugins.push(new StyleLintPlugin(styleLintOptions));

Visual Studio Code

To make life better in Visual Studio Code when using stylelint install: VSCode Stylelint Plugin

License

Made with :sparkling_heart: by NewOrbit in Oxfordshire, and licensed under the MIT License

4.0.0

3 months ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

4 years ago

2.0.9

4 years ago

2.0.8

5 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago