Code Monkey home page Code Monkey logo

lesslint's Introduction

LESSlint

LESSlint is a linter for LESS files.
It is intended to check the code quality and compliance with standards.

Requirements

PHP 5.4+

Usage

lesslint rules.json /path/to/less/folder/ /path/to/file.less
    --exclude=file.less,lib.less
    --recursive
  • --exclude takes file names separated by commas;
  • --recursive recursively browse through the folders to find LESS files.

Rules

Supported rules

  • IndentWithTabs: use tabs to indent the code, not spaces;
  • OneSpaceBeforeBracket: one space before a bracket: .stuff {;
  • WrongIndent: check if each line is properly intended regarding to the code depth;
  • ClosingBracketOnItsOwnLine: closing bracket must be on its own line;
  • ValidCssProperty : check for non-existing CSS properties (supports CSS3 and vendor prefixes);
  • OnePropertyPerLine: max one property per line;
  • ColonSpacing: no space before a colon; one after;
  • NotImportant: do not use !important;
  • OverQualifiedSelector: do not overqualify the selectors. div.stuff โ†’ .stuff;
  • DoNotStyleIds: do not apply a style to IDs (#), use classes;
  • OpeningBracketInline: opening bracket should be inline, not on its own line.

Rules file

Rules file contains the list of rules to be enforced as keys; their parameter a values or true if the rule does not support extra parameters:

{
	"IndentWithTabs": true,
	"NotImportant": true,
	"OneSpaceBeforeBracket": true,
	"WrongIndent": true,
	"ClosingBracketOnItsOwnLine": true,
	"ValidCssProperty": true,
	"OnePropertyPerLine": true,
	"ColonSpacing": true,
	"OverQualifiedSelector": true,
	"NoUnitToZero": true,
	"OpeningBracketInline": true
}

lesslint's People

Watchers

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