npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-scss-lint

v0.5.0

Published

Validate `.scss` files with `scss-lint`.

Downloads

23,565

Readme

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