Comparing version 0.7.0 to 0.7.1
# Changelog | ||
### 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](https://github.com/lesshint/lesshint/issues/28)). | ||
## 0.7.0 (2015-06-24) | ||
@@ -4,0 +7,0 @@ * `lesshint` has a new home: https://github.com/lesshint/lesshint |
@@ -38,5 +38,8 @@ 'use strict'; | ||
exports.lint = function (input, path, config) { | ||
var ast = this.parseAST(input); | ||
var errors = []; | ||
var ast; | ||
input = input.replace(/\r\n|\r|\n/g, '\n'); // Normalize line endings. See #40 | ||
ast = this.parseAST(input); | ||
ast.traverse(function (node) { | ||
@@ -43,0 +46,0 @@ var i; |
{ | ||
"name": "lesshint", | ||
"description": "A tool to aid you in writing clean and consistent Less.", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"main": "./lib/lesshint.js", | ||
@@ -6,0 +6,0 @@ "author": { |
# lesshint | ||
[](https://travis-ci.org/lesshint/lesshint) | ||
[](https://ci.appveyor.com/project/jwilsson/lesshint/branch/master) | ||
[](https://ci.appveyor.com/project/jwilsson/lesshint/branch/master) | ||
[](https://coveralls.io/r/lesshint/lesshint?branch=master) | ||
@@ -6,0 +6,0 @@ [](https://david-dm.org/lesshint/lesshint) |
@@ -27,2 +27,27 @@ var assert = require('assert'); | ||
}); | ||
it('should handle all sorts of line endings (#40)', function () { | ||
var source = '.foo {\r\n margin-right:10px; }\r\n'; | ||
var path = 'test.less'; | ||
var actual; | ||
var expected = [{ | ||
column: 15, | ||
file: 'test.less', | ||
line: 2, | ||
linter: 'spaceAfterPropertyColon', | ||
message: 'Colon after property name should be followed by one space.' | ||
}]; | ||
var config = { | ||
spaceAfterPropertyColon: { | ||
enabled: true, | ||
style: 'one_space' | ||
} | ||
}; | ||
actual = linter.lint(source, path, config); | ||
assert.deepEqual(actual, expected); | ||
}); | ||
}); | ||
@@ -29,0 +54,0 @@ |
319373
8264