包详细信息

lesshint

lesshint29.8kMIT6.3.7

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

less, lint, hint

自述文件

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

更新日志

Changelog

6.3.7 (2019-06-19)

  • Fixed an issue where spaceAfterPropertyColon would erroneously check &:extend() syntax. (8459b37)
  • Updated to globby@9. (3b4c989)
  • Updated to strip-json-comments@3. (6fd5df4)
  • Updated to nyc@14. (aa58522)

6.3.6 (2019-03-18)

  • Fixed a newlineAfterBlock regression where it would erroneously check at-rules without a body. (64a05f2)

6.3.5 (2019-03-18)

  • Fixed a newlineAfterBlock regression where it wouldn't ignore variable declarations. (f47115e)

6.3.4 (2019-03-17)

  • Fixed a newlineAfterBlock regression where it wouldn't ignore mixin calls. (2265c04)

6.3.3 (2019-03-17)

  • Refactor newlineAfterBlock fixing a faulty mixin call check in the process. (148b877)

6.3.2 (2019-02-05)

  • Fixed an issue where newlineAfterBlock would erroneously check mixin calls. (1f03e9a)

6.3.1 (2019-01-24)

  • Fixed an issue where newlineAfterBlock wouldn't work properly with mixins. (599af9a)
  • Performed some code clean up. (d46bf4e)
  • Updated to sinon@7. (5b53193)

6.3.0 (2018-12-29)

  • Added a new nodeToString util. (6e66d02)
  • Refactored position reporting in attributeQuotes. (7a4b6f7)
  • Refactored position reporting in spaceAfterPropertyColon. (121eb7b)
  • Refactored position reporting in spaceAroundComma. (3473b03)
  • Refactored position reporting in spaceBetweenParens. (bddec6d)

6.2.0 (2018-12-26)

  • Updated postcss-selector-parser to 5.x. (330c7ad)

6.1.0 (2018-12-22)

  • Added an avoidEscape option to stringQuotes. (96b3ce4)
  • Fixed an issue where hasQuotes wouldn't check the whole string for quotes. (9cadda2)
  • Fixed an issue where newlineAfterBlock would erroneously report blocks with multiple preceding single-line comments. (dd4977d)
  • Fixed an issue where singleLinePerProperty would erroneously report blocks with preceding single-line comments. (873e128)

6.0.0 (2018-12-19)

  • Breaking Updated postcss-less to 3.x. If you're using custom linters this update might affect you. (5588aaf)
  • Updated isVariable to also check AtRule nodes. (d7f8ffd)
  • Switched from gulp to npm scripts for testing etc. (f8fc7db)

5.3.1 (2018-12-18)

  • Fixed an issue with concentric ordering and unknown properties in propertyOrdering. (11f6195)

5.3.0 (2018-11-04)

  • Added a pseudoElements rule. (e4b1717)

5.2.1 (2018-10-24)

  • Messages from propertyOrdering now include the offending property name. (23d1324)
  • CI tests are now run on Node 11. (d4d37a4)

5.2.0 (2018-10-23)

  • Added a concentric option to propertyOrdering. (4de2d06)
  • Updated postcss to 7.x. (7b0b5bc)
  • Updated postcss-less to 2.x. (4ba534f)
  • Updated postcss-values-parser to 2.x. (26060cf)

5.1.0 (2018-05-06)

  • More configuration file formats are now supported. See docs for more info. (32f6771)
  • Replaced lodash.sortBy() with lodash.orderBy(). (5c15a59)
  • Removed minimatch since it's no longer in use. (d13c0b4)
  • Updated postcss-selector-parser to 4.x. (149829a)

5.0.3 (2018-05-05)

  • Fixed a globby@8 directory expansion regression. (a100a54)
  • CI tests are now run on Node 10. (cadd6da)

5.0.2 (2018-04-23)

  • zeroUnit will now exclude flex-grow and flex-shrink. (920900c)

5.0.1 (2018-04-12)

  • Fixed an sub-selector regression in singleLinePerSelector. (29328aa)

5.0.0 (2018-03-29)

  • Breaking Support for Node versions below 6 has been dropped. (65ad429)
  • Breaking Unified plugin (reporters/custom linters) loading. Depending on your setup, you might experience a slight change in the lookup order. (425f616)
  • Breaking Line endings are no longer normalized, custom linters will recieve whichever line endings the source files contain. A new helper, hasNewline has been added to aid with checking this. (ba3c7a8)
  • Breaking singleLinePerSelector will no longer report the first selector on a line, only the following ones. (d58f791)
  • Breaking Removed the following, deprecated, methods: (d58f791)
    • Lesshint.checkDirectory()
    • Lesshint.checkFile()
    • Lesshint.checkPath()
  • Updated to globby@8. (1ef433a)

4.6.5 (2018-03-01)

  • Fixed an issue where propertyOrdering wouldn't check at-rules with only declarations. (1441a55)

4.6.4 (2018-02-02)

  • Fixed an issue where multiple inline disables of same the rule wouldn't disable each one properly. (80e8475)

4.6.3 (2018-01-05)

  • Fixed a CLI glob matching/excluded files regression introduced in 4.5.0. (c4fea99)

4.6.2 (2017-12-14)

  • The full file path will now be passed to postcss so it'll be available on all AST nodes. (3d409fc)

4.6.1 (2017-12-12)

  • Fixed an issue where idSelector would sometimes report the incorrect position. (8f12cb1)
  • Fixed an issue with enabling all comments with inline configuration comments. (8840589)

4.6.0 (2017-12-11)

  • Improved the inline configuration comments. Read more about it in the docs. (4c546bc)
  • Added an allowedValues option to variableValue (dbceb6d)

4.5.0 (2017-11-27)

  • Added a Lesshint.checkFiles() method. This is a more general-purpose method working on globs instead of directories/file names. (dc939cd)
  • Deprecated the following methods: (dc939cd)
    • Lesshint.checkDirectory()
    • Lesshint.checkFile()
    • Lesshint.checkPath()
  • The CLI will now also utilize the Lesshint.checkFiles() method. (dc939cd)

4.4.0 (2017-11-10)

  • Added a spaceAroundBang linter. (b459b8b)
  • CI tests are run on Node 9. (7f8e58a)

4.3.0 (2017-10-28)

  • Updated postcss-values-parser to 1.3.0. (218ca20)
  • Added a hasQuotes util. (86feef6)
  • Replaced some instances of string concatenation with template strings. (73fd66e)

4.2.0 (2017-10-24)

  • Updated postcss-selector-parser to 3.0.0. (6fac21a)
  • The parseSelector util can also accept PostCSS Rule nodes which gives better errors. (6fac21a)
  • Updated sinon to 4.0.0. (82ee2aa)

4.1.3 (2017-09-25)

  • Fixed an issue where finalNewline would erroneously report files with CRLF line endings. (5aff629)

4.1.2 (2017-09-20)

  • Fixed an issue where spaceBeforeBrace would erroneously report whitespace before a new line. (8078c85)
  • Fixed an issue where the inline config rule name check wouldn't properly accept all characters in rule names. (9fde6bf)
  • Fixed a typo in the trailingWhitespace error message. (a5fa514)
  • Fixed a typo in the trailingWhitespace docs. (bc94cdc)
  • Added docs on allowed characters in rule names. (3bb78af)

4.1.1 (2017-07-26)

  • Downgraded postcss-values-parser to 1.2.2. (c26f1e6)

4.1.0 (2017-07-24)

4.0.2 (2017-07-20)

  • Lockdown postcss-values-parser to ~ range. (d198ed6)

4.0.1 (2017-07-10)

  • Fixed an issue where incomplete rules would crash lesshint. (31b54c1)
  • Fixed faulty column reporting in spaceAroundOperator. (87cb546)
  • Added fr to propertyUnits defaults. (80fb2b4)
  • The isColor from postcss-values-parser is now used where applicable. (2c038af)

4.0.0 (2017-06-25)

  • Breaking Updated postcss-less to 1.0.0, could cause issues if custom linters are used. (03107e5)
  • Breaking Updated postcss to 6.0.0, could cause issues if custom linters are used. (4e49588)
  • Breaking Warnings no longer give exit code 1, and errors give exit code 1 instead of 2. (5bc9e3f)
  • Fixed an issue where config objects passed to the Linter class would be modified. (da93ccb)
  • Added docs for the at_least_one_space option on spaceAfterPropertyColon. (767e022)
  • Updated ESLint to 4.0. (63c2a11)
  • Updated nyc to 11.0. (e6318a5)
  • Updated chai to 4.0. (f79cea4)

3.3.1 (2017-05-08)

  • Updated postcss-less to 0.16.0. (03107e5)
  • Updated postcss-values-parser to 1.2.1. (1728ff1)

3.3.0 (2017-05-03)

  • Added a colorVariables linter. (a4b46fc)
  • Added utils to help with common operations:
  • Fixed an issue with spaceAfterPropertyValue and !important. (b69ff98)

3.2.0 (2017-04-22)

  • Added a custom linter loading fallback where the path will be resolved against the .lesshintrc location. (40cffa2)
  • The Linter class was refactored. (49b7e3b)
  • Added docs on linter loading. (0101934)

3.1.1 (2017-03-27)

  • Fixed an issue where finalNewline would report the wrong position when double \n characters were used. (d234a20)
  • Fixed an issue where spaceAroundOperator would erroneously report numbers surrounded by parentheses. (98953c0)
  • Made sure internal error classes can handle both strings and error objects. (2a8a52a)
  • Fixed an issue where urlQuotes would erroneously report variables. (4508e81)
  • Updated gulp-mocha to 4.x. (7f392ee)
  • Replaced istanbul with nyc. (92d59f8)
  • Updated sinon to 2.x. (f94cae6)
  • Fixed an singleLinePerProperty example config typo. (5acc9d7)
  • Added a more prominent way to access rule docs from the README. (bc6cc3e)

3.1.0 (2017-02-16)

  • Added a variableValue linter. (1a9d48d)
  • Added a universalSelector linter. (781e372)
  • Fixed an issue where spaceAroundComma would crash on stray commas. (37aaa9a)
  • Fixed faulty line reporting issues in:

3.0.1 (2017-02-10)

  • Lockdown postcss-values-parser to ~ range. (7e03dbc)

3.0.0 (2017-02-08)

  • Breaking Dropped support for Node < 4. (7a142ee)
  • Breaking The public Node API now exposes multiple classes instead of just the Lesshint class. (5013aae)
  • Breaking All Promises returned from Lesshint methods are now native ones instead of Vow. (afda593)
  • Breaking Whenever an inaccessible file is encountered, lesshint will now throw an error. (63d258)
  • Added a Lesshint.getConfig() method to search for config files using lesshint's logic. (7850cbf)
  • A complete ES6 rewrite was performed. (879160f)
  • A new Runner class has been added, exposing the full CLI API to Node consumers. (7c9e76a)
  • excludedFiles will now be checked on all paths before lesshint tries to access them. (7bc3ab2)
  • The fullPath property in linting results will now always be a full, absolute path. (dab57d4)
  • Relative custom linter paths will now be resolved against process.cwd(). (6f2b5d9)
  • The default reporter can now be explicitly required. (587c215)
  • Replaced use of the exit module with process.exitCode. (004ae71)
  • Passing -1 to the --max-warnings flag is no longer supported. Simply omit the flag for the same behavior. (f8473d1)
  • postcss-values-parser was updated to 1.1.0. (a91aabb)
  • A huge documentation refresh. (3addaf0)
  • Added the engines field to package.json. (a62da86)
  • Added tests for the lesshint binary. (2a16a17)

2.4.0 (2016-12-14)

  • Added a allowSingleLineRules option to singleLinePerProperty. (52879a7)
  • Added a position field to results. (6292387)
  • Test console spies are now restored before doing assertions. (00f2f1d)
  • Added issue and PR templates. (33f767d)
  • Fixed a "there's"/"there are" typo in the README. (31e5eb3)

2.3.0 (2016-11-29)

  • Added a -x/--max-warnings CLI flag. (21e184d)
  • Added a JSON reporter. (a69bdee)
  • Reporters can now also be objects and not just file paths. (376940c)
  • Fixed a "is"/"are" typo in the README. (282fdea)

2.2.1 (2016-10-30)

  • Fixed a newlineAfterBlock regression from 2.2.0. (117a2b5)

2.2.0 (2016-10-27)

  • Rules without any options can now be enabled by just setting it to to true. (5071ce9)
  • Invalid inline rules are now properly reported. (df2fcac)
  • When lesshint fails for some reason, the currently checked file is now included in the output. (b783f9c)
  • Fixed an issue where duplicateProperty would erroneously report properties using the Less merge feature. (317a7af)
  • Fixed an issue where newlineAfterBlock would give false positives with lines containing trailing whitespace. (ed2c9f6)
  • Fixed an issue stringQuotes would erroneously report some at-rules. (5f1a2b6)
  • Fixed a typo in the "Unknown error" output. (059e162)
  • Fixed a typo in the CLI flags documentation. (a77fca0)

2.1.1 (2016-09-11)

  • Fixed a false positive in newlineAfterBlock with nested blocks. (e64c360)
  • Fixed an issue where singleLinePerSelector would report the same selector multiple times. (507e89)
  • Fixed an issue in spaceBeforeBrace where indented blocks would be erroneously reported with the new_line setting. (45d166e)
  • Fixed an issue in spaceBeforeBrace where the one_space option would erroneously allow other spaces than just a single one. (45d166e)
  • Removed old spaceBeforeComma setting in the default config. (d7bb4f6)

2.1.0 (2016-09-02)

  • Added maxCharPerLine linter. (af69e95)
  • Added newlineAfterBlock linter. (05d48e1)
  • Fixed an issue where stringQuotes wouldn't check at-rules. (aaf1d84)
  • Fixed an issue where spaceBetweenParens would report the wrong line. (fa6ff41)
  • Added tests for failing linter plugins. (02aeef0)
  • Added some examples on how to use lesshint from custom code. (0a87b24)

2.0.3 (2016-08-09)

  • Fixed an issue where importPath wouldn't handle Less import options. (dc099ee)
  • Fixed two issues where urlFormat and urlQuotes wouldn't report multiple URLs in the same declaration. (ec5bd4a)
  • Updated gulp-mocha to 3.x. (28c80b8)

2.0.2 (2016-07-31)

  • Fixed an issue where the wrong line was reported in decimalZero. (e0c8e94)
  • Removed unnecessary gulp-debug-finder dependency. (967968b)
  • Bumped postcss-values-parser to 0.1.7 and added tests for a bug fixed there. (22e11eb)
  • Fixed some broken tests. (44b542f)

2.0.1 (2016-07-25)

  • Fixed an issue where finalNewline and trailingWhitespace weren't called. (6386b4c)

2.0.0 (2016-07-13)

  • Added the possibility to use custom linters. (97e7268)
  • Added a allowNewline option to spaceAroundComma. (1cb009a)
  • Made a small behavioral change in decimalZero where it now only checks if there's always/never a leading/trailing decimal number. (95e8037)
  • Fixed an issue where qualifyingElement would report &.classname. (af37172)
  • Fixed an issue where spaceBetweenParens would fail on mulitiline definitions. (846ebb0)
  • Fixed an issue where decimalZero would erroneously report whole numbers when style was none. (b46be32)
  • Fixed a ton of other bugs found after the parser back-end switch. (Full diff from 2.0.0-rc1)

2.0.0-rc1 (2016-05-16)

  • Completely new parser back-end, using PostCSS. Please report any issues! (1894408)
  • Removed support for old reporter style. (49a2dba)
  • Added a Lesshint.getReporter() method for loading of reporters using lesshint's logic. (6fc0041)
  • Fixed an issue where paths would sometimes include double slashes. (0a197db)

1.5.2 (2016-03-31)

  • Changed gonzales-pe full URL to GitHub pattern. (e83e665)

1.5.1 (2016-03-29)

  • Fixed an issue where zeroUnit would crash in certain cases. (34606cc)

1.5.0 (2016-03-24)

  • Added a at_least_one_space value for the style option in spaceAfterPropertyColon. (5e9fd1e)
  • Added units and exclude options to zeroUnit. (728f37a)
  • Fixed an issue where decimalZero wouldn't check all numbers. (661cc57)
  • Fixed an issue where zeroUnit would erroneously report properties without units. (728f37a)

1.4.0 (2016-03-01)

  • Added the following linters:
  • Added support for configuration using inline comments. (cf757cd)
  • Added a 18f option to singleLinePerSelector. (2f65c31)
  • Fixed an issue where singleLinePerProperty would erroneously report mixins without semicolons. (ef97361)
  • Fixed an issue where spaceAroundOperator would erroneously report negative numbers. (2569d73)
  • Fixed an issue where trailingWhitespace would output errors when checking empty files. (26ba39b)
  • Fixed an issue where importPath would erroneously report files with different file extensions than .less. (b7610dd)
  • Fixed an issue where singleLinePerSelector would erroneously report selectors with the comma on a new line. (637ff49)
  • Fixed an issue where finalNewline would sometimes report the wrong line. (12981cd)
  • Updated ESLint to 2.x (4c14d3a)

1.3.1 (2016-02-12)

  • Fixed an issue where spaceAroundOperator would erroneously try to check negative values. (fe37b21)
  • Fixed an issue where spaceAroundOperator would erroneously report font-size/line-height shorthand declarations. (4819346)

1.3.0 (2016-02-12)

  • Added the following linters:
  • Added the possibility to override linter severity and added a new exit status code for it. See linter docs for more info. (0bc95e1, 062950f, e1d6831)
  • Fixed an issue where excludedFiles in the config file weren't honored in the CLI. (974d0fa)
  • Updated lodash to 4.x. (ac52619)
  • Some other minor improvements to singleLinePerProperty. (072664d, bc439e7)

1.2.2 (2016-01-26)

  • Fixed an issue where local variable declarations would crash duplicateProperty. (2955198)

1.2.1 (2015-12-14)

  • Fixed an issue in selectorNaming where it would sometimes fail if there is no selector name. (8b48fee)
  • Fixed an issue in singleLinePerProperty where it would erroneously report "chained" mixins. (71f2afe)
  • Fixed an issue in qualifyingElement where it wouldn't check parent selectors. (8b090c9)

1.2.0 (2015-12-10)

  • Added selectorNaming linter. (94639fa)
  • Reporters now require a report method, and the old use is now deprecated. (72263bc)
  • Fixed an issue where nested media queries would be erroneously reported by singleLinePerProperty. (3f251e1)
  • Fixed an issue where declarations without a semicolon would erroneously trigger singleLinePerProperty. (3f251e1)

1.1.0 (2015-11-21)

  • Replaced our Less parser, gonzales-pe, with our own fork to solve various parsing issues. (a31a790)
  • Byte order marks are now stripped from config files. (9d2721e)
  • New test suite, using Chai and Gulp. (7915ac5, 44a367c)
  • Updated dependencies. (fc714bd, 62f3d72)

1.0.1 (2015-10-22)

  • Fixed an issue where local variable declarations would crash propertyUnits. (06bee99)
  • Fixed an issue where importPath wouldn't check url() statements. (91cf906)
  • Fixed an issue where urlQuotes wouldn't check @import url() statements. (a038ec5)
  • Fixed issues where singleLinePerProperty wouldn't check mixins, variables, and detached rulesets. (ae16888)
  • Fixed incorrect checking of absolute URLs in importPath. (2709dc9, 0756cba)

1.0.0 (2015-10-19)

  • Complete linter refactor. (92bb70a)
  • Merged spaceAfterComma and spaceBeforeComma into spaceAroundComma (28497b0).
  • Merged leadingZero and trailingZero into decimalZero (12d34a5).
  • Removed the quote style option from attributeQuotes. (c0b229e)
  • The comment linter is now disabled by default. (c93121f)
  • The default value for zeroUnit is now keep_unit. (0c9ef81)
  • The following changes has been made to propertyUnits: (8b85210)
    • Renamed global to valid.
    • Added an invalid option.
  • Lint results are now sorted by line and column numbers. (50d223f)
  • Better handling of parse errors, they are now returned together with the lint results. (f6efb3c)
  • Updated gonzales-pe to 3.x. (ac47970, 9cba245)
  • Updated other dependencies. (acb5e10, fcdf05d)

0.9.4 (2015-09-25)

  • Fix for bad 0.9.3.

0.9.3 (2015-09-25)

  • Fixed an issue where propertyOrdering would try to check variables and crash.

0.9.2 (2015-09-23)

  • Fixed an issue where spaceBeforeBrace wouldn't check @media queries. Props @kokarn. (#61).
  • Fixed an issue where finalNewline would fail on empty files.
  • Fixed an issue where trailingWhitespace would fail on empty files.

0.9.1 (2015-09-09)

  • Fixed an issue in propertyOrdering where identical properties weren't handled correctly (#59).
  • Fixed an issue in idSelector where it would sometimes crash.
  • Fixed error message language in urlQuotes Props @shellscape. (#60).

0.9.0 (2015-08-31)

  • lesshint now reports Less parse errors. Props @shellscape. (#46, #47).
  • All reporters now receive a severity property with the values error for parse errors and warning for rule violations. This feature will be developed further in future releases.
  • A propertyOrdering linter has been added. Props @srogers202. (#48)
  • Fixed an issue where spaceBeforeComma and spaceAfterComma would erroneously report on all operators. (#49).
  • Fixed an issue where singleLinePerProperty would erroneously report lines with trailing comments. Props @CITguy. (#54).
  • Fixed an issue where attributeQuotes would erroneously report on boolean attributes. Props @CITguy. (#54).
  • Fixed message grammar in singleLinePerSelector (#42).

0.8.0 (2015-08-16)

  • This release contains possible breaking changes. Check this list before updating.
  • Support for custom reporters has been added. This enables users to do whatever they want with the lint results, not just log it to the console.
  • Added the following linters:
    • singleLinePerProperty
    • singleLinePerSelector
    • trailingWhitespace
  • The Less AST passed to each linter is now frozen to prevent accidental modifying by a linter.
  • All linters now returns the complete source of each offending line.
  • Linters are no longer passed a filename.

0.7.1 (2015-08-05)

  • Fixed an issue where Windows line endings in the Less source would cause the wrong line to be reported (#28).

0.7.0 (2015-06-24)

  • lesshint has a new home: https://github.com/lesshint/lesshint
  • Added the following linters
    • importPath
    • propertyUnits
    • spaceAfterComma
    • spaceBeforeComma
    • spaceBetweenParens
  • Updated gonzales-pe dependency, adding support for all forms of :extend().
  • Added the possibility to exclude files. See the excludedFiles option and -e/--exclude flags.
  • Added the possibility to specify which file extensions to check, see the fileExtensions option.
  • Fixed an issue where lesshint wouldn't report any more errors when the parser encountered a problem.
  • Fixed an issue where hexNotation would report hex codes with invalid characters.
  • Fixed an issue where spaceAfterPropertyValue wouldn't report multiple errors in the same block.

0.6.2 (2015-06-01)

  • Stopped hexLength and hexNotation from reporting on invalid hex colors.

0.6.1 (2015-05-28)

  • Lock gonzales-pe dependency to stop things from breaking due to changes there.

0.6.0 (2015-05-27)

  • Added the following linters:
    • qualifyingElement
    • spaceAfterPropertyValue
  • Fixed an issue where trailingSemicolon would fail when a space was preceding the semicolon.
  • Fixed an issue where hexNotation would incorrectly report colors with only numbers.
  • Fixed an issue in idSelector due to a changed AST from gonzales-pe.
  • The detached rulesets feature of Less is now supported thanks to a upstream patch in gonzales-pe.
  • Increased test coverage.

0.5.1 (2015-05-19)

  • Fixed issues with hexLength, hexNotation, and hexValidation where they wouldn't check for hex colors outside declarations (in variables for example) (#28).

0.5.0 (2015-05-17)

  • Added the following linters:
    • attributeQuotes
    • comment
    • leadingZero
    • trailingZero
    • zeroUnit
  • Added an exclude option to the following linters:
    • duplicateProperty
    • idSelector
  • The stringQuotes linter now checks strings everywhere, not just in rulesets.

0.4.1 (2015-05-11)

  • Fixed two issues with urlFormat and urlQuotes where they would incorrectly report errors when the URLs were surrounded by spaces (#22).

0.4.0 (2015-05-10)

  • Breaking change: The LessHint class is now called Lesshint.
  • The following linters have been added:
    • importantRule
    • stringQuotes
    • urlFormat
    • urlQuotes
  • All linters can now be disabled by simply setting the respective property to false. No need to set enabled: false anymore.
  • Some other improvements to the linters.

0.3.1 (2015-05-03)

  • When running from the CLI and a line or column is null, it's no longer printed.
  • Fixed an issue where the only error reported was a missing final newline.
  • Fixed an issue that prevented errors on the last ruleset from being shown when a final newline was missing.
  • Fixed an issue where emptyRule would incorrectly report errors on rules that only contain a mixin (#16).
  • Fixed an issue where trailingSemicolon would fail on an empty rule.
  • Fixed an issue where trailingSemicolon would incorrectly report errors in rules containing variables inside @media directives (#15).

0.3.0 (2015-05-01)

  • Added the following linters:
    • duplicateProperty
    • emptyRule
    • finalNewline
    • idSelector
    • trailingSemicolon
  • Better error messages, the property or value that caused the error are now more clearly described.
  • Internal code cleanup.

0.2.0 (2015-04-27)

  • Added the following linters:
    • borderZero
    • hexLength
    • hexNotation
    • hexValidation
    • spaceAfterPropertyName
  • lesshint will now exit with proper status codes. E.g. 1 when there's a lint error in a checked file, thus failing builds etc.
  • Made some improvements to CLI output, added colors and made it easier to read.
  • Fixed an issue where the spaceBeforeBrace linter would report the wrong column when style is one_space (#4).

0.1.5 (2015-04-24)

  • The default options are now always loaded, regardless if lesshint is running from the CLI or another module.
  • If no files are passed via the CLI, an error is now printed.
  • When something's wrong with a passed config file, the error message from JSON.parse() is also shown.

0.1.4 (2015-04-20)

  • Fixed incorrect dependency name.

0.1.3 (2015-04-20)

  • Fixed some issues where the default config wasn't properly loaded.
  • Fixed an issue when the CLI was passed multiple directories and files, they weren't all linted.

0.1.2 (2015-04-19)

  • Another version bump for npm.

0.1.1 (2015-04-19)

  • Version bump for npm after some old files were deleted.

0.1.0 (2015-04-19)

  • Initial release