ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CSSLint

by austinhappel ST2/ST3

CSSLint plugin for Sublime Text 2 and 3

Labels linting

Details

Installs

  • Total 60K
  • Win 32K
  • OS X 19K
  • Linux 8K
Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10
Windows 5 13 13 16 10 14 7 7 7 17 9 13 18 3 11 16 13 6 10 17 13 8 15 14 20 18 14 14 7 22 18 16 16 19 9 10 8 10 28 13 15 8 12 13 16 16
OS X 1 7 6 7 2 4 3 1 1 6 16 2 1 2 1 8 6 2 10 5 1 3 5 11 4 2 2 4 2 5 5 9 2 4 4 2 5 6 7 4 3 5 2 13 4 2
Linux 0 4 3 5 3 2 1 6 4 6 1 2 1 2 3 2 1 0 3 2 4 6 7 6 3 4 4 2 1 4 4 1 5 7 1 5 2 6 6 3 2 1 1 0 2 0

Readme

Source
raw.​githubusercontent.​com

CSSLint plugin for Sublime Text 2

Takes the power of csslint.net and puts it into Sublime Text. Instead of copying and pasting your CSS into the csslint.net static analysis tool, all you have to do is hit ctrl + alt + c and any warnings are displayed in your console. You can also click on those warnings in the console, and the specific line will be highlighted in your code.

You can also lint multiple files at a time by selecting them in the sidebar and selecing CSSLint Selection. A new document will open and display the lint data, sorted by filename.

Installation

  1. Copy this project folder to your Sublime Text Packages folder:

    Windows: %APPDATA%\Sublime Text 2\Packages

    Mac OS X: ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/

    Linux: ~/.config/sublime-text-2/Packages

  2. Make sure Java is installed, and that java is in your PATH.

  3. Rename the package folder from “sublime-csslint” to “CSSLint”.

Usage

  • Use the Command Pallete (Windows and Linux: Ctrl+Shift+P, OSX: Command+Shift+P) and search for:

    CSSLint: Run CSSLint

  • Use a keyboard shortcut. By default this is ctrl + alt + c. Change this by adding something like the following to your key bindings:

    { "keys": ["ctrl+alt+c"], "command": "csslint" }
    

Advanced Usage

  • Each CSS Lint rule has an ID that can be found in this file. (Look for blocks starting with CSSLint.addRule).
  • To ignore certain rules of CSS Lint, you will need to amend the Preferences > Package Settings > CSS Lint > User Preferences file. This will be blank by default. Just copy/paste the Default preferences file and then amend to suit.
  • Therefore as an example:
{
    // CSSLint rules you wish to ignore. Must be an array. Leave blank to include all default rules.
    "ignore": ["floats","universal-selector","box-model","unqualified-attributes"]
}

This would ignore messages about floats, the universal selector, box-model and unqualified attributes.

Thanks

Much of this plugin has been copied from the sublime-jslint project. I liked how that plugin worked, and based this project off of it. Much thanks to fbzhong for that!

Other Notes

This plugin uses the Rhino command-line version of CSSLint, and includes the Rhino library.