Skip to content

Update to Stylelint

Ashley Kolodziej edited this page Apr 30, 2020 · 1 revision
  1. Run npm install stylelint
  2. Run npm install stylelint-config-wordpress
  3. Run npm uninstall grunt-sass-lint
  4. Add the following files: .stylelintrc.json
  5. Remove the following files: .sasslintrc
  6. In codeclimate.yml, under prepare: fetch, change the first url and path parameters to the following: - url: "https://raw.githubusercontent.com/bu-ist/coding-standards/master/code-climate-rule-sets/.stylelintrc.json" path: ".stylelintrc.json"
  7. Add stylelint: enabled: true config: file_extensions: scss to engines
  8. Remove sass-lint: enabled: true from engines
  9. Remove the sasslint task and all sasslint calls from Gruntfile.js
  10. In package.json, add the following two scripts:
"styles:lint": "stylelint \"**/*.scss\" --cache || echo \"\"",
    "styles:fix": "stylelint \"**/*.scss\" --cache --fix --s || echo \"\" && npm run styles:fix:success --s && npm run styles:fix:warn --s",
      "styles:fix:success": "echo \"\\033[32mSuccess! Fixed style errors where possible.\\x1b[0m\"",
      "styles:fix:warn": "echo \"\\033[33m\nErrors which could not be resolved automatically are listed above. Please review changes carefully in Tower or your git management tool of choice before committing, as errors can occur, especially in Sass maps.\n\\x1b[0m\""

Finally, test by doing the following:

Run npm install Run npm run styles:lint

Welcome to Responsive!

Get started

Configuration

Build child themes

Sass

Javascript

PHP

Shortcodes

Templates

GitHub

Tasks

Contribute to the framework

Code Examples

BU Developer Resources

Clone this wiki locally