Socket
Socket
Sign inDemoInstall

grunt-contrib-csslint

Package Overview
Dependencies
31
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    grunt-contrib-csslint

Lint CSS files.


Version published
Maintainers
1
Install size
333 kB
Created

Readme

Source

grunt-contrib-csslint Build Status

Lint CSS files.

Getting Started

This plugin requires Grunt ~0.4.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-contrib-csslint --save-dev

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

grunt.loadNpmTasks('grunt-contrib-csslint');

Csslint task

Run this task with the grunt csslint command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

Files are linted with csslint.

Options

Any specified option will be passed through directly to csslint, thus you can specify any option that csslint supports. The csslint API is a bit awkward: For each rule, a value of false ignores the rule, a value of 2 will set it to become an error. Otherwise all rules are considered warnings.

For the current csslint version, these rules are available:

  • important
  • adjoining-classes
  • known-properties
  • box-sizing
  • box-model
  • overqualified-elements
  • display-property-grouping
  • bulletproof-font-face
  • compatible-vendor-prefixes
  • regex-selectors
  • errors
  • duplicate-background-images
  • duplicate-properties
  • empty-rules
  • selector-max-approaching
  • gradients
  • fallback-colors
  • font-sizes
  • font-faces
  • floats
  • star-property-hack
  • outline-none
  • import
  • ids
  • underscore-property-hack
  • rules-count
  • qualified-headings
  • selector-max
  • shorthand
  • text-indent
  • unique-headings
  • universal-selector
  • unqualified-attributes
  • vendor-prefix
  • zero-units

For an explanation of those rules, check the csslint wiki.

Side note: To update this list, run this:

node -e "require('csslint').CSSLint.getRules().forEach(function(x) { console.log(x.id) })"

Usage Examples

csslint: {
  strict: {
    options: {
      import: 2
    },
    src: ['path/to/**/*.css']
  },
  lax: {
    options: {
      import: false
    },
    src: ['path/to/**/*.css']
  }
}

Release History

  • 2013-03-06   v0.1.0   Initial release.

Task submitted by Jörn Zaefferer

This file was generated on Thu Mar 07 2013 14:20:56.

Keywords

FAQs

Last updated on 07 Mar 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc