Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilsson committed Mar 1, 2018
2 parents 65ad429 + e8d7911 commit b335d84
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 4.6.5 (2018-03-01)
* Fixed an issue where `propertyOrdering` wouldn't check at-rules with only declarations. ([1441a55](https://github.com/lesshint/lesshint/commit/1441a55fa5272c31dea1b8280e6631b20c8c509a))

## 4.6.4 (2018-02-02)
* Fixed an issue where multiple inline disables of same the rule wouldn't disable each one properly. ([80e8475](https://github.com/lesshint/lesshint/commit/80e84752b31ae139d9f33f6ed64a1fcd01f335a1))

Expand Down
2 changes: 1 addition & 1 deletion lib/linters/property_ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const isVariable = require('../utils/is-variable');

module.exports = {
name: 'propertyOrdering',
nodeTypes: ['rule'],
nodeTypes: ['atrule', 'rule'],
message: 'Property ordering is not alphabetized',

lint: function propertyOrderingLinter (config, node) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lesshint",
"description": "A tool to aid you in writing clean and consistent Less.",
"version": "4.6.4",
"version": "4.6.5",
"main": "./lib/index.js",
"author": {
"name": "Jonathan Wilsson",
Expand Down
20 changes: 20 additions & 0 deletions test/specs/linters/property_ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ describe('lesshint', function () {
});
});

it('should check at-rules without rules (#460)', function () {
const source = '@media (screen) { opacity: 1; color: red; }';

const expected = [{
column: 31,
line: 1,
message: 'Property ordering is not alphabetized'
}];

const options = {
style: 'alpha'
};

return spec.parse(source, function (ast) {
const result = spec.linter.lint(options, ast.root.first);

expect(result).to.deep.equal(expected);
});
});

it('should throw on invalid "style" value', function () {
const source = '.foo { color: red; color: blue; }';
const options = {
Expand Down

0 comments on commit b335d84

Please sign in to comment.