From 743e9ea045dd2e38db88c010993694338969abfa Mon Sep 17 00:00:00 2001 From: Aleks Hudochenkov Date: Mon, 28 Nov 2016 15:22:30 +0300 Subject: [PATCH] Fixed tests for `declaration-block-property-groups-structure` --- CHANGELOG.md | 3 +++ package.json | 2 +- rules/declaration-block-property-groups-structure/index.js | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81acf39..299060d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## 0.2.2 +* Fixed tests for `declaration-block-property-groups-structure` which were broken by previous fix ¯\_(ツ)_/¯ + ## 0.2.1 * Fixed incorrect severity level for `declaration-block-properties-order` which is called from `declaration-block-property-groups-structure` diff --git a/package.json b/package.json index bf445ca..8d4dd4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stylelint-order", - "version": "0.2.1", + "version": "0.2.2", "description": "A collection of order related linting rules for stylelint.", "keywords": [ "stylelint-plugin", diff --git a/rules/declaration-block-property-groups-structure/index.js b/rules/declaration-block-property-groups-structure/index.js index 3e42fca..cb166ab 100644 --- a/rules/declaration-block-property-groups-structure/index.js +++ b/rules/declaration-block-property-groups-structure/index.js @@ -31,8 +31,10 @@ function rule(expectation, options) { const cleanedConfig = cleanConfig(expectation); const runPropertiesOrder = stylelint.rules['declaration-block-properties-order'](cleanedConfig, options); - // set the same severity level - result.stylelint.ruleSeverities['declaration-block-properties-order'] = result.stylelint.ruleSeverities[ruleName]; + if (!_.isUndefined(result.stylelint.ruleSeverities) && !_.isUndefined(result.stylelint.ruleSeverities[ruleName])) { + // set the same severity level + result.stylelint.ruleSeverities['declaration-block-properties-order'] = result.stylelint.ruleSeverities[ruleName]; + } // run declaration-block-properties-order rule runPropertiesOrder(root, result);