neworbit-stylelint-config

4.0.0 • Public • Published

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 💖 by NewOrbit in Oxfordshire, and licensed under the MIT License

Readme

Keywords

Package Sidebar

Install

npm i neworbit-stylelint-config

Weekly Downloads

241

Version

4.0.0

License

MIT

Unpacked Size

12.5 kB

Total Files

4

Last publish

Collaborators

  • senderek
  • neworbit-admin
  • petevb
  • ksstott
  • thyde1
  • owenpattison