/stylelint-config-torchbox

Shareable stylelint config for CSS and SCSS, following Torchbox’s code style.

Primary LanguageJavaScriptMIT LicenseMIT

stylelint-config-torchbox on npm Build status

Shareable stylelint config for CSS and SCSS, following Torchbox’s code style.

Usage

Install stylelint, and the config:

npm install --save-dev stylelint@13 stylelint-config-torchbox

Then configure stylelint to use this config. As a stylelint.config.js in the root of your project:

module.exports = {
  // See https://github.com/torchbox/stylelint-config-torchbox for rules.
  extends: 'stylelint-config-torchbox',
};

Tips

Vue

stylelint supports Vue, and our configuration is usable in .vue single-file components with no changes. Do make sure linting is configured to check .vue files:

  • Wherever stylelint is manually invoked, make sure to point it both at stylesheets, and Vue components: stylelint --report-needless-disables './src/sass' './src/vue_components'.
  • With stylelint-webpack-plugin, use extensions: ['scss', 'vue'],.
  • With pre-commit, use files: \.(scss|vue)$.

Related tools

To get the most out of this config, it is assumed that projects have the following tools set up:

What’s included

See config.js for the config definition. This package depends on:

Rules

Custom rules

Rules of stylelint-config-standard

Disabled rules

Rules that are turned off on purpose.

Unused rules

Rules that are not configured.

Contributing

See the contribution guidelines for guidance and setup instructions.