GithubHelp home page GithubHelp logo

rlugojr / sublime-csslint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from austinhappel/sublime-csslint

0.0 2.0 0.0 1.17 MB

CSSLint plugin for Sublime Text 2 and 3

License: Other

Python 4.21% JavaScript 95.46% Shell 0.28% CSS 0.05%

sublime-csslint's Introduction

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.

sublime-csslint's People

Contributors

atsjj avatar austinhappel avatar benfrain avatar ndmitry avatar

Watchers

 avatar  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.