• Stars
    star
    142
  • Rank 258,145 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Grunt task to lint your SCSS

grunt-scss-lint

Gitter Build Status Code Climate Test Coverage NPM version

Lint your .scss files

Getting Started

This plugin requires Grunt >= 0.4.0 and scss-lint >= 0.18.0. It is recommended to use the scss_lint gem as that is the currently maintained version.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-scss-lint --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-scss-lint');

Scss-lint task

Run this task with the grunt scsslint command.

scss-lint is a Ruby gem written by The Causes Engineering Team. It is currently owned and maintained by brigade. This plugin is simply a grunt wrapper for the gem.

This task requires you to have Ruby, and scss-lint 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.

Options

bundleExec

  • Type: Boolean
  • Default: false

You can choose to have your gems installed via bundler and if so, set this option to true to use the local gems.

colorizeOutput

  • Type: Boolean
  • Default: true

Get some nice looking output.

For colors to work on Windows, you first need to install 2 extra gems. This is because of Rainbow, a dependency of scss-lint.

gem install windows-pr win32console

compact

  • Type: Boolean
  • Default: false

Group related linted files for more easier error review. XML output will still be default from scss-lint.

config

  • Type: String
  • Default: node_modules/grunt-scss-lint/.scss-lint.yml.

Specify a configuration file.

gemVersion

  • Type: String
  • Default: null.

Specify a gem version for the scsslint gem.

exclude

  • Type: String or Array
  • Default: null

Exclude one or more files from being linted.

reporterOutput

  • Type: String
  • Default: null

The file to save the output to. If you don't want this then set the option as null.

reporterOutputFormat

  • Type: String
  • Default: null
  • Options: txt, xml

This will ultimately default to the file extension used for reporterOutput if left null

emitError

  • Type: Boolean
  • Default: false

Emits a Grunt event on scss-lint error called scss-lint-error.

emitSuccess

  • Type: Boolean
  • Default: false

Emits a Grunt event on scss-lint success called scss-lint-success.

failOnWarning

  • Type: Boolean
  • Default: true

Disable to fail the task only on errors. You can set the severity level for individual linters in your configuration file.

force

  • Type: Boolean
  • Default: false

Set force to true to report scss-lint warnings and errors but not fail the task. This overrides failOnWarning.

maxBuffer

  • Type: Number or Boolean
  • Default: 300 * 1024

Set maxBuffer for the child_process.exec process, if you're linting a lot of files and you're recieving no output then you can try and increase this value. Setting it to false, 0, NaN or Infinite will not return any stdout or stderr and the task will think that everything's fine.

Usage Examples

Example config

grunt.initConfig({
  scsslint: {
    allFiles: [
      'test/fixtures/*.scss',
    ],
    options: {
      bundleExec: true,
      config: '.scss-lint.yml',
      reporterOutput: 'scss-lint-report.xml',
      colorizeOutput: true
    },
  }
});

grunt.loadNpmTasks('grunt-scss-lint');

grunt.registerTask('default', ['scsslint']);

Exit error codes

If you're having problems with the task exiting with an error code, then have a look here: https://github.com/causes/scss-lint/blob/master/lib/scss_lint/cli.rb

More Repositories

1

radian

A scalable AngularJS framework
CoffeeScript
106
star
2

gdrive-cms-php

A simple CMS powered by Google Drive (PHP version)
PHP
38
star
3

AS3

This is a very useful library of AS3 classes
ActionScript
18
star
4

javascript-tests

A suite of JavaScript tests (hopefully) useful for interviews
JavaScript
17
star
5

angularjs-drag-directive

An AngularJS directive to handle the dragging of an $element for mouse and touch devices
CoffeeScript
11
star
6

my-punch-card

Punch card data of all my commits
JavaScript
9
star
7

vid

a jQuery plugin for loading video players from your favourite video sites
JavaScript
9
star
8

Facebook-Actionscript-API

This is my bastardised version from the 'official' dead one at http://code.google.com/p/facebook-actionscript-api/
6
star
9

gdrive-cms-py-gae

A simple CMS powered by Google Drive (Python on Google App Engine version)
Python
5
star
10

AS3-Webcam-To-Server-Capture

Does what it says on the tin :D
ActionScript
4
star
11

qliksense-extension

A simple boilerplate for writing Qlik Sense extensions in Javascript
JavaScript
4
star
12

opentok-presenter-participant-public-app

It's an app built on Tokbox's OpenTok API that creates a presenter-participant-public relationship for a conference style web show
Python
3
star
13

appengine-projects

A simple repo to help people get on board and start using Google's App Engine.
3
star
14

meme-says-jenkins

A meme based Jenkins CI monitor
CoffeeScript
3
star
15

YouTube-Auth-And-Upload

A simple example showing you how to auth a user and upload their videos to YouTube
Ruby
3
star
16

YouTube-Player-Wrapper

This is the source code for my production YouTube Player Wrapper to be used with AS3
ActionScript
3
star
17

generator-radian

A yeoman generator for http://radian.io
JavaScript
2
star
18

qliksense-template

A simple boilerplate for writing Qlik Sense templates in Javascript
JavaScript
2
star
19

qliksense-deploy

Simple deployment of QlikSense templates, mashups, and extensions
JavaScript
2
star
20

qlikview-data-table-to-excel

A simple Qlikview extension to take data and export it to Excel
JavaScript
2
star
21

AS2

This is a very useful library of AS2 classes
ActionScript
2
star
22

twitfavs

A nice way to aggregate a user's twitter favourites
JavaScript
2
star
23

cornwallis-facebook-photo-app

JavaScript
2
star
24

ahmeds-wordpress-carousel

This is a simple carousel plugin
PHP
2
star
25

html5-mic-check

2
star
26

wildfire-local

A little app to help build WildFire apps locally
PHP
2
star
27

testing-angularjs

Testing AngularJS with Jasmine and Karma
JavaScript
2
star
28

playa

It's a Flash based video player (Flash?! Like holy shit!) that plays FLVs/F4Vs/MP4s and YouTube videos without having to rewrite the player
ActionScript
2
star
29

workshops-site

This is the WordPress theme for the Digital Workshops site
PHP
2
star
30

hypergrid-rerender-test

HTML
1
star
31

parsemycss

CoffeeScript
1
star
32

quick-react

JavaScript
1
star
33

battleships-server

A simple battleships server written in NodeJS and MongoDB
JavaScript
1
star
34

csv-to-jsonl

A simple node CLI to convert CSV to JSONL (for services like Athena)
JavaScript
1
star
35

santas-call

A little trick to keep your little ones in check during Christmas time
JavaScript
1
star
36

key-code-fetchr

A simple app that returns the key code onkeypress()
1
star
37

PHP

This is a very useful library of PHP classes
1
star
38

abilities-device-sniffer-samsungtv

http://ab.iliti.es app for Samsung TV
JavaScript
1
star
39

wordpress-filer

It's a plugin that handles files that much better
PHP
1
star
40

serverless-react-connect-spa

A auth ready Serverless React Connect SPA
JavaScript
1
star
41

fb-app-giglist

Display your gigs on a page tab. Simply create gigs as events for your page and use this app to display them. Upload a custom background and even edit the CSS if you feel brave!
Python
1
star