Comparing version 6.3.4 to 6.3.5
# Changelog | ||
## 6.3.5 (2019-03-18) | ||
* Fixed a `newlineAfterBlock` regression where it wouldn't ignore variable declarations. ([f47115e](https://github.com/lesshint/lesshint/commit/f47115e6a53a8b5b00dd0d39752a6cab4864a789)) | ||
## 6.3.4 (2019-03-17) | ||
@@ -3,0 +6,0 @@ * Fixed a `newlineAfterBlock` regression where it wouldn't ignore mixin calls. ([2265c04](https://github.com/lesshint/lesshint/commit/2265c04b56fbf961ab957fe9cfc9a7911744ea63)) |
'use strict'; | ||
const isVariable = require('../utils/is-variable'); | ||
module.exports = { | ||
@@ -16,3 +18,6 @@ name: 'newlineAfterBlock', | ||
const regexp = /\r?\n[ \t]*\r?\n/; | ||
// Ignore variables | ||
if (isVariable(node)) { | ||
return; | ||
} | ||
@@ -24,2 +29,4 @@ // Ignore mixin calls | ||
const regexp = /\r?\n[ \t]*\r?\n/; | ||
/** | ||
@@ -26,0 +33,0 @@ * Allow following comments without a empty line, |
{ | ||
"name": "lesshint", | ||
"description": "A tool to aid you in writing clean and consistent Less.", | ||
"version": "6.3.4", | ||
"version": "6.3.5", | ||
"main": "./lib/index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -251,3 +251,18 @@ 'use strict'; | ||
}); | ||
it('should ignore variable declarations', function () { | ||
const source = ` | ||
@var: red; | ||
.foo { | ||
color: @var; | ||
} | ||
`; | ||
return spec.parse(source, function (ast) { | ||
const result = spec.linter.lint({}, ast.root.first); | ||
expect(result).to.be.undefined; | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
528387
10679