UNPKG

2.53 kBMarkdownView Raw
1# grunt-scss-lint
2[![Build Status](https://travis-ci.org/ahmednuaman/grunt-scss-lint.png?branch=master)](https://travis-ci.org/ahmednuaman/grunt-scss-lint) [![Code Climate](https://codeclimate.com/github/ahmednuaman/grunt-scss-lint.png)](https://codeclimate.com/github/ahmednuaman/grunt-scss-lint) [![NPM version](https://badge.fury.io/js/grunt-scss-lint.png)](http://badge.fury.io/js/grunt-scss-lint)
3
4> Lint your `.scss` files
5
6## Getting Started
7This plugin requires Grunt `>= 0.4.0` and [scss-lint](https://github.com/causes/scss-lint) `>= 0.18.0`.
8
9If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
10
11```shell
12npm install grunt-scss-lint --save-dev
13```
14
15Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
16
17```js
18grunt.loadNpmTasks('grunt-scss-lint');
19```
20
21## Scss-lint task
22_Run this task with the `grunt scsslint` command._
23
24[scss-lint](https://github.com/causes/scss-lint) is a Ruby gem written by [The Causes Engineering Team](https://github.com/causes), this plugin is simply a grunt wrapper for the gem.
25
26This task requires you to have [Ruby](http://www.ruby-lang.org/en/downloads/), and [scss-lint](https://github.com/causes/scss-lint#installation) installed. If you're on OS X or Linux you probably already have Ruby installed; test with `ruby -v` in your terminal. When you've confirmed you have Ruby installed, run `gem update --system && gem install scss-lint` to install the `scss-lint` gem.
27
28### Options
29
30#### config
31
32Type: `String`
33Default: `scss-lint`'s [default config file](https://github.com/causes/scss-lint/blob/master/config/default.yml).
34
35~~**[Note that this isn't working correctly yet](https://github.com/causes/scss-lint/issues/46).**~~
36
37#### reporterOutput
38
39Type: `String`
40Default: `scss-lint-report.xml`
41
42The jUnit XML file to save the output to. If you don't want this then set the option as `null`.
43
44### Usage Examples
45
46#### Example config
47
48```javascript
49grunt.initConfig({
50 scsslint: {
51 allFiles: [
52 'test/fixtures/*.scss',
53 ],
54 options: {
55 config: '.scss-lint.yml',
56 reporterOutput: 'scss-lint-report.xml'
57 },
58 }
59});
60
61grunt.loadNpmTasks('grunt-scss-lint');
62
63grunt.registerTask('default', ['scsslint']);
64```