Shopify's stylelint rules and config
Last updated a month ago by shopify-dep .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @shopify/stylelint-plugin 
SYNC missed versions from official npm registry.


Build Status License: MIT npm version

Shopify's stylelint rules and config


Install stylelint and @shopify/stylelint-plugin:

With Yarn

yarn add --dev stylelint @shopify/stylelint-plugin

With npm

npm install stylelint @shopify/stylelint-plugin --save-dev


Shopify’s stylelint rules come bundled in @shopify/stylelint-pluginv. To enable these rules, add a stylelint property in your package.json. See the stylelint configuration docs for more details.

"stylelint": {
  "extends": ["@shopify/stylelint-plugin"]

Now you can run stylelint by adding the following linting script to your package.json. See the stylelint CLI docs for more details.

"scripts": {
  "stylelint": "stylelint 'src/**/*.scss'"

Run it:

With Yarn

yarn run stylelint

With npm

npm run stylelint


This config also includes a prettier config which can be extended to format .scss. Using the stylelint-prettier plugin, prettier changes are exposed as stylelint rule violations.

Install prettier:

$ yarn add --dev prettier

Extend the config in your package.json:

"stylelint": {
  "extends": [

Add a prettier config in package.json:

"prettier": {
  "singleQuote": true,
  "trailingComma": "es5",
  "bracketSpacing": false

Prettier fixes shall be reported when you run stylelint **/*.css and shall be autofixed when you run stylelint --fix **/*.scss.

Current Tags

  • 9.0.0                                ...           latest (a month ago)
  • 7.4.0-initial-release-beta.6                                ...           next (3 months ago)

5 Versions

  • 9.0.0                                ...           a month ago
  • 8.1.0                                ...           2 months ago
  • 8.0.1                                ...           3 months ago
  • 8.0.0                                ...           3 months ago
  • 7.4.0-initial-release-beta.6                                ...           3 months ago

Copyright 2014 - 2016 © taobao.org |