Grunt plugin for running Stylelint
JavaScript CSS
Latest commit a5ea1e6 Jan 12, 2017 @Volker-E Volker-E committed on GitHub Merge pull request #34 from mdvanes/master
Stylelint update to v7.7.1 and documentation update
Permalink
Failed to load latest commit information.
tasks Don't over-ride 'formatter' option if set Oct 14, 2016
test/simple
.gitignore
.jscsrc
.jshintrc
.travis.yml Travis CI: Cache NPM modules Jul 20, 2016
Gruntfile.js Provide a first unit test May 19, 2016
History.md
LICENSE Initial code May 17, 2016
README.md Fixing typo and formatting of README.md Jan 12, 2017
package.json

README.md

NPM version Build Status dependencies Status devDependencies Status NPM Downloads

grunt-stylelint

Grunt plugin for running stylelint

Getting started

If this is the first time you're using Grunt, the getting started guide will show you how to get up and running.

Once you have that installed, with a Gruntfile set for your code, you can install the plugin with:

npm install grunt-stylelint --save-dev

In your Gruntfile, add the line:

grunt.loadNpmTasks( 'grunt-stylelint' );

Running and configuring stylelint task

Run this task with the grunt stylelint command.

You can specify the targets and options for the task using the normal Grunt configuration – see Grunt's guide on how to configure tasks in general.

For more explanations of the lint errors stylelint will throw at you please visit http://stylelint.io/.

Usage examples

In this example, running grunt stylelint:all (or grunt stylelint because stylelint is a multi task) will lint the project's CSS and Sass files in the css and sass directories and their subdirectories, using the default stylelint options or the options specified in the .stylelintrc in the root of the project. For an example config see http://stylelint.io/user-guide/example-config/.

// Project configuration.
grunt.initConfig({
  stylelint: {
    all: ['css/**/*.css', 'sass/**/*.scss']
  }
});

The options object is passed through to stylelint. Options you may wish to set are:

formatter

Type: string Default value: "string" Values: "string"|"verbose"|"json"

Which output format in which you would like results. If grunt is run with --verbose and this is not explicitly set, it will act as though you passed in "verbose".

syntax

Type: string Values: "scss"|"less"|"sugarss"

Which syntax standard should be used to parse source stylesheets. If this is unset, stylelint will attempt to guess which syntax is used by the files' extensions.

ignoreDisables

Type: boolean Default vaue: false

Whether to ignore inline comments that disable stylelint.

reportNeedlessDisables

Type: boolean Default vaue: false

Whether to ignore inline comments that disable stylelint and report which ones did not block a lint warning.