- 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)
- Updated
postcss-values-parser
to1.3.0
. (218ca20) - Added a
hasQuotes
util. (86feef6) - Replaced some instances of string concatenation with template strings. (73fd66e)
- Updated
postcss-selector-parser
to3.0.0
. (6fac21a) - The
parseSelector
util can also accept PostCSSRule
nodes which gives better errors. (6fac21a) - Updated
sinon
to4.0.0
. (82ee2aa)
- Fixed an issue where
finalNewline
would erroneously report files with CRLF line endings. (5aff629)
- 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)
- Downgraded
postcss-values-parser
to1.2.2
. (c26f1e6)
Lesshint.configure()
now returns the final config object. (076f8fe)- The
parseValue
util can now acceptpostcss-values-parser
options. (c2f8d53) - Updated
postcss-values-parser
to1.3.0
. (e49f4d7) - Refactored position reporting in the following linters:
borderZero
(836ff0f)colorVariables
(277f1aa)decimalZero
(d33fa2c)hexLength
(e599d8b)hexNotation
(60e7485)hexValidation
(7b441aa)idSelector
(d8b298b)importantRule
(ba733a6)propertyUnits
(da6353e)qualifyingElement
(58a3f03)selectorNaming
(7b2f08e)spaceAfterPropertyName
(871bf2c)spaceAfterPropertyValue
(7395a16)spaceBeforeBrace
(36979f4)universalSelector
(4aaf666)urlFormat
(56a4c64)urlQuotes
(56a4c64)variableValue
(de75d7e)zeroUnit
(b24c91a)
- Lockdown
postcss-values-parser
to~
range. (d198ed6)
- Fixed an issue where incomplete rules would crash
lesshint
. (31b54c1) - Fixed faulty column reporting in
spaceAroundOperator
. (87cb546) - Added
fr
topropertyUnits
defaults. (80fb2b4) - The
isColor
frompostcss-values-parser
is now used where applicable. (2c038af)
- Breaking Updated
postcss-less
to1.0.0
, could cause issues if custom linters are used. (03107e5) - Breaking Updated
postcss
to6.0.0
, could cause issues if custom linters are used. (4e49588) - Breaking Warnings no longer give exit code
1
, and errors give exit code1
instead of2
. (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 onspaceAfterPropertyColon
. (767e022) - Updated ESLint to
4.0
. (63c2a11) - Updated
nyc
to11.0
. (e6318a5) - Updated
chai
to4.0
. (f79cea4)
- Added a
colorVariables
linter. (a4b46fc) - Added utils to help with common operations:
- Fixed an issue with
spaceAfterPropertyValue
and!important
. (b69ff98)
- 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)
- 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
to4.x
. (7f392ee) - Replaced
istanbul
withnyc
. (92d59f8) - Updated
sinon
to2.x
. (f94cae6) - Fixed an
singleLinePerProperty
example config typo. (5acc9d7) - Added a more prominent way to access rule docs from the
README
. (bc6cc3e)
- 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:
- Lockdown
postcss-values-parser
to~
range. (7e03dbc)
- 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
Promise
s returned fromLesshint
methods are now native ones instead ofVow
. (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 usinglesshint
'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 beforelesshint
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 withprocess.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 to1.1.0
. (a91aabb)- A huge documentation refresh. (3addaf0)
- Added the
engines
field topackage.json
. (a62da86) - Added tests for the
lesshint
binary. (2a16a17)
- Added a
allowSingleLineRules
option tosingleLinePerProperty
. (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)
- 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)
- Fixed a
newlineAfterBlock
regression from2.2.0
. (117a2b5)
- 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)
- 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 thenew_line
setting. (45d166e) - Fixed an issue in
spaceBeforeBrace
where theone_space
option would erroneously allow other spaces than just a single one. (45d166e) - Removed old
spaceBeforeComma
setting in the default config. (d7bb4f6)
- 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)
- Fixed an issue where
importPath
wouldn't handle Less import options. (dc099ee) - Fixed two issues where
urlFormat
andurlQuotes
wouldn't report multiple URLs in the same declaration. (ec5bd4a) - Updated
gulp-mocha
to3.x
. (28c80b8)
- Fixed an issue where the wrong line was reported in
decimalZero
. (e0c8e94) - Removed unnecessary
gulp-debug-finder
dependency. (967968b) - Bumped
postcss-values-parser
to0.1.7
and added tests for a bug fixed there. (22e11eb) - Fixed some broken tests. (44b542f)
- Fixed an issue where
finalNewline
andtrailingWhitespace
weren't called. (6386b4c)
- Added the possibility to use custom linters. (97e7268)
- Added a
allowNewline
option tospaceAroundComma
. (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 whenstyle
wasnone
. (b46be32) - Fixed a ton of other bugs found after the parser back-end switch. (Full diff from
2.0.0-rc1
)
- 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 usinglesshint
's logic. (6fc0041) - Fixed an issue where paths would sometimes include double slashes. (0a197db)
- Changed
gonzales-pe
full URL to GitHub pattern. (e83e665)
- Fixed an issue where
zeroUnit
would crash in certain cases. (34606cc)
- Added a
at_least_one_space
value for thestyle
option inspaceAfterPropertyColon
. (5e9fd1e) - Added
units
andexclude
options tozeroUnit
. (728f37a) - Fixed an issue where
decimalZero
wouldn't check all numbers. (661cc57) - Fixed an issue where
zeroUnit
would erroneously report properties without units. (728f37a)
- Added the following linters:
depthLevel
(18bb203)
- Added support for configuration using inline comments. (cf757cd)
- Added a
18f
option tosingleLinePerSelector
. (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)
- Fixed an issue where
spaceAroundOperator
would erroneously try to check negative values. (fe37b21) - Fixed an issue where
spaceAroundOperator
would erroneously reportfont-size/line-height
shorthand declarations. (4819346)
- Added the following linters:
spaceAroundOperator
(ac689c7)
- 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)
- Fixed an issue where local variable declarations would crash
duplicateProperty
. (2955198)
- 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)
- 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)
- 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)
- Fixed an issue where local variable declarations would crash
propertyUnits
. (06bee99) - Fixed an issue where
importPath
wouldn't checkurl()
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)
- Complete linter refactor. (92bb70a)
- Merged
spaceAfterComma
andspaceBeforeComma
intospaceAroundComma
(28497b0). - Merged
leadingZero
andtrailingZero
intodecimalZero
(12d34a5). - Removed the quote style option from
attributeQuotes
. (c0b229e) - The
comment
linter is now disabled by default. (c93121f) - The default value for
zeroUnit
is nowkeep_unit
. (0c9ef81) - The following changes has been made to
propertyUnits
: (8b85210)- Renamed
global
tovalid
. - Added an
invalid
option.
- Renamed
- 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
to3.x
. (ac47970, 9cba245) - Updated other dependencies. (acb5e10, fcdf05d)
- Fix for bad
0.9.3
.
- Fixed an issue where
propertyOrdering
would try to check variables and crash.
- 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.
- 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).
lesshint
now reports Less parse errors. Props @shellscape. (#46, #47).- All reporters now receive a
severity
property with the valueserror
for parse errors andwarning
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
andspaceAfterComma
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).
- 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.
- Fixed an issue where Windows line endings in the Less source would cause the wrong line to be reported (#28).
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.
- Stopped
hexLength
andhexNotation
from reporting on invalid hex colors.
- Lock
gonzales-pe
dependency to stop things from breaking due to changes there.
- 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 fromgonzales-pe
. - The
detached rulesets
feature of Less is now supported thanks to a upstream patch ingonzales-pe
. - Increased test coverage.
- Fixed issues with
hexLength
,hexNotation
, andhexValidation
where they wouldn't check for hex colors outside declarations (in variables for example) (#28).
- 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.
- Fixed two issues with
urlFormat
andurlQuotes
where they would incorrectly report errors when the URLs were surrounded by spaces (#22).
- Breaking change: The
LessHint
class is now calledLesshint
. - 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 setenabled: false
anymore. - Some other improvements to the linters.
- 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).
- 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.
- 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 whenstyle
isone_space
(#4
).
- 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.
- Fixed incorrect dependency name.
- 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.
- Another version bump for npm.
- Version bump for npm after some old files were deleted.
- Initial release