GithubHelp home page GithubHelp logo

jboshers / grunt-scss-lint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ahmednuaman/grunt-scss-lint

0.0 1.0 0.0 161 KB

A Grunt task to lint your SCSS

License: MIT License

Ruby 2.28% JavaScript 97.72%

grunt-scss-lint's Introduction

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.

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, 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 jUnit XML file to save the output to. If you don't want this then set the option as 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.

force

  • Type: Boolean
  • Default: false

Set force to true to report scss-lint errors but not fail the task.

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

grunt-scss-lint's People

Contributors

ahmednuaman avatar mikesherov avatar farseeing avatar thomasphorton avatar gabrielf avatar branneman avatar hortontp avatar anselmh avatar alexfu avatar blmyr avatar niksy avatar jeffreylo avatar jgerigmeyer avatar kaelig avatar nschonni avatar gitter-badger avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.