Skip to content
forked from lesshint/lesshint

A tool to aid you in writing clean and consistent Less.

License

Notifications You must be signed in to change notification settings

mhauens/lesshint

This branch is 32 commits behind lesshint/lesshint:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 29, 2018
baa81d2 · Dec 29, 2018
Jan 26, 2017
Jun 25, 2017
Dec 29, 2018
Dec 29, 2018
Dec 29, 2018
Oct 23, 2018
Jun 24, 2017
Apr 6, 2015
Feb 21, 2017
Dec 18, 2018
Dec 29, 2018
Aug 28, 2015
Apr 8, 2015
Nov 2, 2018
Oct 24, 2018
Dec 29, 2018
Dec 29, 2018

Repository files navigation

lesshint

npm Build Status Build status Coverage Status

lesshint is a tool to aid you in writing clean and consistent Less.

Installation

Node.js 6 (or later) is required.

Run the following from the command line to install lesshint (add -g to install globally):

npm install lesshint

Configuration

For information on how to configure lesshint and other available options, see the user guide.

Since lesshint is highly customizable we recommend you to also take a look at the available rule options to tailor it to your needs.

CLI usage

Run lesshint from the command-line by passing one or more files/directories to recursively scan. Quote the glob patterns for optimal cross-platform results.

lesshint "src/less/" "lib/style.less"
Available Flags Description
-c/--config Specify the configuration file to use (will be merged with defaults).
-e/--exclude A globby glob pattern or a file to exclude from being linted.
-l/--linters Paths to custom linters to add to the built-in list. See "Linters" below for more information.
-r/--reporter The reporter to use. See "Reporters" below for more information.
-V/--version Show the version.
-x/--max-warnings Number of warnings to allow before exiting with a non-zero code. Omit it to always exit with zero code.

Exit status codes

Depending on the linter results and options supplied, the exit status code returned by the CLI will differ.

Exit status code Description
0 Everything is alright or only linting errors with a severity of warning were found.
1 One or more linting errors with a severity of error were found. Or when --max-warnings flag is set and the number of linting errors with a severity of warning found is greater than the given value.
66 No files to lint were supplied.
70 An unknown error occurred within lesshint, possibly a bug. Please file an issue!
78 Something is wrong with the config file, most likely invalid JSON.

These codes were chosen with regards to the preferable exit codes.

Complementary tools

Linters

In addition to the linters included with lesshint, it's also possible to include custom ones. For example to check something team or project specific.

For more information on using custom linters, see the user guide.

Reporters

Reporters are small modules that can be used to perform actions with the lint results, for example printing something to the terminal or generate custom reports.

For more information on using reporters, see the user guide.

Developer resources

About

A tool to aid you in writing clean and consistent Less.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.7%
  • CSS 0.3%