From 9df35ad4aec50b52884b91b56ccdf4590e93387b Mon Sep 17 00:00:00 2001 From: Tomasz Kopacki Date: Tue, 14 Mar 2017 15:11:49 +0100 Subject: [PATCH 01/20] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0d3cad35..3e35eafb 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,10 @@ Our AST is [Gonzales-PE](https://github.com/tonyganch/gonzales-pe/tree/dev). Eac * [Gulp](https://www.npmjs.com/package/gulp-sass-lint) * [Grunt](https://github.com/sasstools/grunt-sass-lint) +## Module Bundler Integration + +* [rollup.js](https://github.com/kopacki/rollup-plugin-sass-lint) + ## IDE Integration * [Atom](https://atom.io/packages/linter-sass-lint) From 56ca1df4960e852b1caa8b85f53c02063039bf61 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Wed, 30 Aug 2017 23:38:14 +0100 Subject: [PATCH 02/20] :bug: Fix custom properties in declarations --- lib/rules/no-misspelled-properties.js | 9 ++++++--- tests/sass/no-misspelled-properties.sass | 3 +++ tests/sass/no-misspelled-properties.scss | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/rules/no-misspelled-properties.js b/lib/rules/no-misspelled-properties.js index 7db9d105..02b1a26b 100644 --- a/lib/rules/no-misspelled-properties.js +++ b/lib/rules/no-misspelled-properties.js @@ -43,7 +43,7 @@ var buildPartialProperty = function (valBlock, currentProperty) { var value = node.first('value'); skipProps++; - if (prop.first().is('ident')) { + if (prop && prop.first().is('ident')) { if (value.contains('block')) { propList = propList.concat( buildPartialProperty(value.first('block'), @@ -77,7 +77,10 @@ module.exports = { ast.traverseByType('declaration', function (node) { var prop = node.first('property'); - var containsInterp = prop.contains('interpolation'); + // declaration may include custom properties etc, check that prop is defined here + if (!prop) { + return false; + } // If we've already checked declarations in a multiline we can skip those decs here if (skipProps) { skipProps -= 1; @@ -123,7 +126,7 @@ module.exports = { * If our property name contains interpolation we need to make a best guess by using a * partial string match as we can't be 100% on the context */ - if (containsInterp) { + if (prop.contains('interpolation')) { if (!helpers.isPartialStringMatch(curProperty, propertyList)) { result = helpers.addUnique(result, { 'ruleId': parser.rule.name, diff --git a/tests/sass/no-misspelled-properties.sass b/tests/sass/no-misspelled-properties.sass index 645c5e7e..773a2b87 100644 --- a/tests/sass/no-misspelled-properties.sass +++ b/tests/sass/no-misspelled-properties.sass @@ -77,3 +77,6 @@ $red: #ff0000 color: red background-colr: blue font-size: 12rem + +.element + --main-bg-color: brown diff --git a/tests/sass/no-misspelled-properties.scss b/tests/sass/no-misspelled-properties.scss index 7e9afcb1..7fc2003c 100644 --- a/tests/sass/no-misspelled-properties.scss +++ b/tests/sass/no-misspelled-properties.scss @@ -104,3 +104,7 @@ $red: #ff0000; background-colr: blue; // 14 font-size: 12rem; } + +.element { + --main-bg-color: brown; +} From e31abb6230815c3f49f97b322cb968526fa5ba10 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Thu, 31 Aug 2017 00:08:56 +0100 Subject: [PATCH 03/20] Check for custom properties in no-color-keywords --- lib/rules/no-color-keywords.js | 2 +- tests/sass/no-color-keywords.sass | 2 ++ tests/sass/no-color-keywords.scss | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rules/no-color-keywords.js b/lib/rules/no-color-keywords.js index dcf21d1b..31518ce4 100644 --- a/lib/rules/no-color-keywords.js +++ b/lib/rules/no-color-keywords.js @@ -16,7 +16,7 @@ var cssColors = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data', */ var checkValidParentType = function (node) { if (node) { - return node.type === 'function' || node.type === 'variable'; + return node.type === 'function' || node.type === 'variable' || node.type === 'customProperty'; } return false; diff --git a/tests/sass/no-color-keywords.sass b/tests/sass/no-color-keywords.sass index a619da9f..127727b1 100644 --- a/tests/sass/no-color-keywords.sass +++ b/tests/sass/no-color-keywords.sass @@ -31,3 +31,5 @@ $other: rgba($blue, 0.3) // Issue #717 - rule trips over Sass color function names $colors: ( 'red': red($color), 'green': green($color), 'blue': blue($color) ) + +$badge-bg: var(--red) diff --git a/tests/sass/no-color-keywords.scss b/tests/sass/no-color-keywords.scss index 3bcea3d7..4aac84b4 100644 --- a/tests/sass/no-color-keywords.scss +++ b/tests/sass/no-color-keywords.scss @@ -42,3 +42,5 @@ $colors: ( 'green': green($color), 'blue': blue($color) ); + +$badge-bg: var(--red); From 9ee433045e40dc1c23958af80d8e7ec8f797c879 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Thu, 31 Aug 2017 00:19:36 +0100 Subject: [PATCH 04/20] Tidy up no-color-keywords logic --- lib/rules/no-color-keywords.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rules/no-color-keywords.js b/lib/rules/no-color-keywords.js index 31518ce4..face6db9 100644 --- a/lib/rules/no-color-keywords.js +++ b/lib/rules/no-color-keywords.js @@ -15,11 +15,11 @@ var cssColors = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data', * @returns {boolean} Whether the node is a valid type or not */ var checkValidParentType = function (node) { - if (node) { - return node.type === 'function' || node.type === 'variable' || node.type === 'customProperty'; + if (node && (node.is('function') || node.is('variable') || node.is('customProperty'))) { + return false; } - return false; + return true; }; module.exports = { @@ -30,7 +30,7 @@ module.exports = { ast.traverseByType('value', function (node) { node.traverse(function (elem, i, parent) { - if (elem.type === 'ident' && !checkValidParentType(parent)) { + if (elem.type === 'ident' && checkValidParentType(parent)) { var index = cssColors.indexOf(elem.content.toLowerCase()); if (index !== -1) { From 8e34fa3d34deb35d8c25f5ce33ef7bf864678971 Mon Sep 17 00:00:00 2001 From: Ben Griffith Date: Thu, 31 Aug 2017 00:36:26 +0100 Subject: [PATCH 05/20] :bug: Check before calling is method --- lib/rules/empty-line-between-blocks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rules/empty-line-between-blocks.js b/lib/rules/empty-line-between-blocks.js index b4c12385..cc14f1f3 100644 --- a/lib/rules/empty-line-between-blocks.js +++ b/lib/rules/empty-line-between-blocks.js @@ -52,7 +52,7 @@ var findNearestReturnSCSS = function (parent, i) { var findNearestReturnSass = function (parent, i) { var previous; - if (parent.content[i - 1]) { + if (!parent.is('ident') && parent.content[i - 1]) { previous = parent.content[i - 1]; if (counter === 2) { From 1eb2b5b9319d13414664c13bdf268635e43c8990 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 01:13:35 +0100 Subject: [PATCH 06/20] Allow functions & custom props in rgba params --- lib/rules/no-color-literals.js | 11 +++++++---- tests/rules/no-color-literals.js | 12 ++++++------ tests/sass/no-color-literals.sass | 8 ++++++++ tests/sass/no-color-literals.scss | 10 ++++++++++ 4 files changed, 31 insertions(+), 10 deletions(-) diff --git a/lib/rules/no-color-literals.js b/lib/rules/no-color-literals.js index 7d7159b4..0c6642dc 100644 --- a/lib/rules/no-color-literals.js +++ b/lib/rules/no-color-literals.js @@ -80,7 +80,7 @@ module.exports = { ast.traverseByTypes(['value', 'variable'], function (node, i, parent) { - // If we don't literals as variable names then check each variable name + // If we don't allow literals as variable names then check each variable name if (node.is('variable') && !parser.options['allow-variable-identifiers']) { if (cssColors.indexOf(node.content[0].content) !== -1) { result = helpers.addUnique(result, { @@ -127,15 +127,18 @@ module.exports = { // if rgba usage is allowed we need to make sure only variables are being passed to it. else if ( parser.options['allow-rgba'] && - funcType === 'rgba' && - valElem.content[1].content[0].type !== 'variable' && + funcType === 'rgba' && ( + valElem.content[1].content[0].type !== 'variable' && + valElem.content[1].content[0].type !== 'function' && + valElem.content[1].content[0].type !== 'customProperty' + ) && declarationType !== 'variable' ) { result = helpers.addUnique(result, { 'ruleId': parser.rule.name, 'line': valElem.start.line, 'column': valElem.start.column, - 'message': 'A color in variable form must be passed to rgba, literals are restricted', + 'message': 'Only variables or functions must be passed to rgba, literals are restricted', 'severity': parser.severity }); } diff --git a/tests/rules/no-color-literals.js b/tests/rules/no-color-literals.js index 00a1400d..11c320d5 100644 --- a/tests/rules/no-color-literals.js +++ b/tests/rules/no-color-literals.js @@ -12,7 +12,7 @@ describe('no color literals - scss', function () { lint.test(file, { 'no-color-literals': 1 }, function (data) { - lint.assert.equal(16, data.warningCount); + lint.assert.equal(19, data.warningCount); done(); }); }); @@ -40,7 +40,7 @@ describe('no color literals - scss', function () { } ] }, function (data) { - lint.assert.equal(20, data.warningCount); + lint.assert.equal(23, data.warningCount); done(); }); }); @@ -54,7 +54,7 @@ describe('no color literals - scss', function () { } ] }, function (data) { - lint.assert.equal(19, data.warningCount); + lint.assert.equal(22, data.warningCount); done(); }); }); @@ -86,7 +86,7 @@ describe('no color literals - sass', function () { lint.test(file, { 'no-color-literals': 1 }, function (data) { - lint.assert.equal(16, data.warningCount); + lint.assert.equal(19, data.warningCount); done(); }); }); @@ -114,7 +114,7 @@ describe('no color literals - sass', function () { } ] }, function (data) { - lint.assert.equal(20, data.warningCount); + lint.assert.equal(23, data.warningCount); done(); }); }); @@ -128,7 +128,7 @@ describe('no color literals - sass', function () { } ] }, function (data) { - lint.assert.equal(19, data.warningCount); + lint.assert.equal(22, data.warningCount); done(); }); }); diff --git a/tests/sass/no-color-literals.sass b/tests/sass/no-color-literals.sass index f7a88d70..045b3e4e 100644 --- a/tests/sass/no-color-literals.sass +++ b/tests/sass/no-color-literals.sass @@ -113,3 +113,11 @@ $hsla: hsla(40, 50%, 50%, .3) .rgba-enabled color: rgba($hexVar, .3) + +.some-element + border-bottom: 1px solid rgba($light-gray, 0.5) + color: rgba(shade($some-color), 0.5) + +.color + border: 1px solid --white + color: rgba(--my-color, 0.5) diff --git a/tests/sass/no-color-literals.scss b/tests/sass/no-color-literals.scss index 1e62b699..e8538e80 100644 --- a/tests/sass/no-color-literals.scss +++ b/tests/sass/no-color-literals.scss @@ -122,3 +122,13 @@ $black: #000; .rgba-enabled { color: rgba($hexVar, .3); } + +.some-element { + border-bottom: 1px solid rgba($light-gray, .5); + color: rgba(shade($some-color), 0.5); // functions should be allowed as rgba params +} + +.color { + border: 1px solid --white; + color: rgba(--my-color, 0.5); +} From 31d834371b9c92264168a49f33d461066e295b43 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 02:23:52 +0100 Subject: [PATCH 07/20] :mag: Update variable for property options --- docs/rules/variable-for-property.md | 95 +++++++++++++++++++++++ lib/rules/variable-for-property.js | 45 ++++++++++- tests/rules/variable-for-property.js | 106 ++++++++++++++++++++++++++ tests/sass/variable-for-property.sass | 11 +++ tests/sass/variable-for-property.scss | 12 +++ 5 files changed, 267 insertions(+), 2 deletions(-) diff --git a/docs/rules/variable-for-property.md b/docs/rules/variable-for-property.md index 07a4e9f7..c2809da9 100644 --- a/docs/rules/variable-for-property.md +++ b/docs/rules/variable-for-property.md @@ -14,6 +14,10 @@ The `!important` flag will also be excluded when used. * `properties`: `[array of property names]` (defaults to empty array `[]`) +* `allow-map-get`: `true`/`false` (defaults to `true`) You may allow/disallow the use of `map-get()` as property values + +* `allowed-functions`: `[array of function names]` (defaults to empty array `[]`) + You may pass an array of properties you wish to enforce the use of variables for ```yaml @@ -26,10 +30,54 @@ variable-for-property: - 'content' ``` +You may pass an array of function names you wish to allow as property values + +```yaml + +variable-for-property: + - 1 + - + 'allowed-functions': + - 'my-map-func' + - 'palette' +``` + +*** full config example *** + +```yaml +variable-for-property: + - 1 + - + allow-map-get: true + allowed-functions: + - my-map-func + - palette + properties: + - margin + - content +``` + ## Examples By default `properties` is an empty array and therefore no properties are forced to use variables as values. +```scss +.bar { + content: ' '; + margin: 0; + + &__element { + margin: 0; + } +} + +@mixin red() { + margin: 0; +} +``` + +## [properties: []] + When `properties` contains the values shown in the options section example the following would be disallowed: ```scss @@ -65,6 +113,53 @@ When `properties` contains the values shown in the options section example the f ``` +## [allow-map-get: true] + +When allow-map-get is set to `true` and properties contains the `color` property, the following would be allowed + +```scss +.foo { + color: map-get(blueish, light); +} +``` + +When allow-map-get is set to `false` and properties contains the `color` property, the following would be disallowed + +```scss +.foo { + color: map-get(blueish, light); +} +``` + +## [allowed-functions: []] + +When `allowed-functions` contains the values shown in the options section and `properties` includes the `color` property the following would be disallowed: + +```scss +.foo { + color: disallowed-function($test, $vars); + + &__element { + color: invalid-func-name($test, $vars); + } +} +``` + +When `allowed-functions` contains the values shown in the options section and `properties` includes the `color` property the following would be disallowed: + +```scss +.foo { + color: my-map-func($allowed); + + &__element { + color: palette(blue, light); + } +} + +``` + +## Extra info + The `!important` flag will be excluded from any lint warnings. For example if `properties` contains the value `color` the following would be disallowed diff --git a/lib/rules/variable-for-property.js b/lib/rules/variable-for-property.js index b006595b..a928ef32 100644 --- a/lib/rules/variable-for-property.js +++ b/lib/rules/variable-for-property.js @@ -37,10 +37,36 @@ var isIgnoredType = function (propertyElem) { return false; }; +/** + * Checks If the property type is a function and whether it is allowed + * + * @param {Object} propertyElem - The property element + * @param {boolean} allowMap - Whether the user has specified to allow Sass function map-get + * @param {Array} functionWhitelist - An array of string - function names we wish to allow + * @returns {boolean} Whether the property is an ignored type or not + */ +var isIgnoredFunction = function (propertyElem, allowMap, functionWhitelist) { + if (propertyElem && propertyElem.type === 'function') { + var funcIdent = propertyElem.first('ident'); + + if (allowMap && funcIdent.content === 'map-get') { + return true; + } + + if (functionWhitelist.length) { + return functionWhitelist.indexOf(funcIdent.content) !== -1; + } + } + return false; +}; + + module.exports = { 'name': 'variable-for-property', 'defaults': { - 'properties': [] + 'properties': [], + 'allow-map-get': true, + 'allowed-functions': [] }, 'detect': function (ast, parser) { var result = []; @@ -54,7 +80,22 @@ module.exports = { if (declarationType === 'ident') { if (parser.options.properties.indexOf(declarationIdent) !== -1) { node.forEach(function (valElem) { - if (!isValidProperty(valElem) && !isIgnoredType(valElem)) { + + if (valElem.is('function') && !isIgnoredFunction(valElem, parser.options['allow-map-get'], parser.options['allowed-functions'])) { + result = helpers.addUnique(result, { + 'ruleId': parser.rule.name, + 'line': declaration.start.line, + 'column': declaration.start.column, + 'message': 'The function passed to \'' + declarationIdent + '\' is not allowed', + 'severity': parser.severity + }); + } + else if ( + !valElem.is('function') && + !isValidProperty(valElem) && + !isIgnoredType(valElem) && + !valElem.is('interpolation') + ) { result = helpers.addUnique(result, { 'ruleId': parser.rule.name, 'line': declaration.start.line, diff --git a/tests/rules/variable-for-property.js b/tests/rules/variable-for-property.js index 8e803347..8b010599 100644 --- a/tests/rules/variable-for-property.js +++ b/tests/rules/variable-for-property.js @@ -45,6 +45,59 @@ describe('variable for property - scss', function () { ] } ] + }, function (data) { + lint.assert.equal(2, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allow-map-get: true]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allow-map-get': true + } + ] + }, function (data) { + lint.assert.equal(2, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allow-map-get: false]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allow-map-get': false + } + ] + }, function (data) { + lint.assert.equal(3, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allowed-functions: [\'my-map-func\']]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allowed-functions': [ + 'my-map-func' + ] + } + ] }, function (data) { lint.assert.equal(1, data.warningCount); done(); @@ -95,6 +148,59 @@ describe('variable for property - sass', function () { ] } ] + }, function (data) { + lint.assert.equal(2, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allow-map-get: true]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allow-map-get': true + } + ] + }, function (data) { + lint.assert.equal(2, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allow-map-get: false]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allow-map-get': false + } + ] + }, function (data) { + lint.assert.equal(3, data.warningCount); + done(); + }); + }); + + it('[properties: [\'color\'], allowed-functions: [\'my-map-func\']]', function (done) { + lint.test(file, { + 'variable-for-property': [ + 1, + { + 'properties': [ + 'color' + ], + 'allowed-functions': [ + 'my-map-func' + ] + } + ] }, function (data) { lint.assert.equal(1, data.warningCount); done(); diff --git a/tests/sass/variable-for-property.sass b/tests/sass/variable-for-property.sass index 78047682..45ea874d 100644 --- a/tests/sass/variable-for-property.sass +++ b/tests/sass/variable-for-property.sass @@ -35,3 +35,14 @@ .issue color: red !important + +.test + color: map-get($blue) + +.interp-test + color: #{var} + + // ensure interp is not flagged + +.func-name-test + color: my-map-func(blue, light) diff --git a/tests/sass/variable-for-property.scss b/tests/sass/variable-for-property.scss index b9621772..8725f95c 100644 --- a/tests/sass/variable-for-property.scss +++ b/tests/sass/variable-for-property.scss @@ -39,3 +39,15 @@ .t-neutral { color: red !important; } + +.test { + color: map-get($blue); +} + +.interp-test { + color: #{var}; // ensure interp is not flagged +} + +.func-name-test { + color: my-map-func(blue, light); +} From f1427932394e26b0ab7f6afdc88b94d34c6e3e64 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 02:39:34 +0100 Subject: [PATCH 08/20] :bug: Allow custom properties as variables --- lib/rules/variable-for-property.js | 11 ++++++++--- tests/sass/variable-for-property.sass | 4 ++++ tests/sass/variable-for-property.scss | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/rules/variable-for-property.js b/lib/rules/variable-for-property.js index a928ef32..dd73361c 100644 --- a/lib/rules/variable-for-property.js +++ b/lib/rules/variable-for-property.js @@ -14,10 +14,10 @@ var whitelistedValues = ['inherit', 'initial', 'transparent', 'none', 'currentCo */ var isValidProperty = function (propertyElem) { if (propertyElem) { - if (propertyElem.type === 'variable') { + if (propertyElem.is('variable')) { return true; } - else if (propertyElem.type === 'ident' && whitelistedValues.indexOf(propertyElem.content) !== -1) { + else if (propertyElem.is('ident') && whitelistedValues.indexOf(propertyElem.content) !== -1) { return true; } } @@ -46,9 +46,14 @@ var isIgnoredType = function (propertyElem) { * @returns {boolean} Whether the property is an ignored type or not */ var isIgnoredFunction = function (propertyElem, allowMap, functionWhitelist) { - if (propertyElem && propertyElem.type === 'function') { + if (propertyElem && propertyElem.is('function')) { var funcIdent = propertyElem.first('ident'); + // allow custom properties as values + if (funcIdent.content === 'var') { + return true; + } + if (allowMap && funcIdent.content === 'map-get') { return true; } diff --git a/tests/sass/variable-for-property.sass b/tests/sass/variable-for-property.sass index 45ea874d..5f34c217 100644 --- a/tests/sass/variable-for-property.sass +++ b/tests/sass/variable-for-property.sass @@ -46,3 +46,7 @@ .func-name-test color: my-map-func(blue, light) + +.custom-prop + // ensure custom properties are valid + color: var(--my-prop) diff --git a/tests/sass/variable-for-property.scss b/tests/sass/variable-for-property.scss index 8725f95c..cba29b09 100644 --- a/tests/sass/variable-for-property.scss +++ b/tests/sass/variable-for-property.scss @@ -51,3 +51,7 @@ .func-name-test { color: my-map-func(blue, light); } + +.custom-prop { + color: var(--my-prop); // ensure custom properties are valid +} From 8d0ae41a20f37849433217b16816be105b0e3514 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 02:42:16 +0100 Subject: [PATCH 09/20] :bug: Fix the custom proeprties test --- tests/sass/no-color-literals.sass | 4 ++-- tests/sass/no-color-literals.scss | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sass/no-color-literals.sass b/tests/sass/no-color-literals.sass index 045b3e4e..56801878 100644 --- a/tests/sass/no-color-literals.sass +++ b/tests/sass/no-color-literals.sass @@ -119,5 +119,5 @@ $hsla: hsla(40, 50%, 50%, .3) color: rgba(shade($some-color), 0.5) .color - border: 1px solid --white - color: rgba(--my-color, 0.5) + border: 1px solid var(--white) + color: rgba(var(--my-color), 0.5) diff --git a/tests/sass/no-color-literals.scss b/tests/sass/no-color-literals.scss index e8538e80..4e32f753 100644 --- a/tests/sass/no-color-literals.scss +++ b/tests/sass/no-color-literals.scss @@ -129,6 +129,6 @@ $black: #000; } .color { - border: 1px solid --white; - color: rgba(--my-color, 0.5); + border: 1px solid var(--white); + color: rgba(var(--my-color), 0.5); } From 94ad31e7d4fe9ab8ec572c67f9c66f621fbe3ac0 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 14:00:21 +0100 Subject: [PATCH 10/20] :bug: Fix at-root in space after colon --- lib/rules/space-after-colon.js | 45 ++++++++++++++++--------------- tests/rules/space-after-colon.js | 4 +-- tests/sass/space-after-colon.sass | 6 +++++ tests/sass/space-after-colon.scss | 14 ++++++++++ 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/lib/rules/space-after-colon.js b/lib/rules/space-after-colon.js index b5b4f9a8..20d39dc5 100644 --- a/lib/rules/space-after-colon.js +++ b/lib/rules/space-after-colon.js @@ -11,29 +11,30 @@ module.exports = { var result = []; ast.traverseByTypes(['propertyDelimiter', 'operator'], function (delimiter, i, parent) { - if (delimiter.content === ':') { - var next = parent.content[i + 1]; - - if (next && next.is('space')) { - if (!parser.options.include) { - result = helpers.addUnique(result, { - 'ruleId': parser.rule.name, - 'line': next.start.line, - 'column': next.start.column, - 'message': 'No space allowed after `:`', - 'severity': parser.severity - }); + if (!parent.is('atrule')) { + if (delimiter.content === ':') { + var next = parent.content[i + 1]; + if (next && next.is('space')) { + if (!parser.options.include) { + result = helpers.addUnique(result, { + 'ruleId': parser.rule.name, + 'line': next.start.line, + 'column': next.start.column, + 'message': 'No space allowed after `:`', + 'severity': parser.severity + }); + } } - } - else { - if (parser.options.include) { - result = helpers.addUnique(result, { - 'ruleId': parser.rule.name, - 'line': delimiter.start.line, - 'column': delimiter.start.column, - 'message': 'Space expected after `:`', - 'severity': parser.severity - }); + else { + if (parser.options.include) { + result = helpers.addUnique(result, { + 'ruleId': parser.rule.name, + 'line': delimiter.start.line, + 'column': delimiter.start.column, + 'message': 'Space expected after `:`', + 'severity': parser.severity + }); + } } } } diff --git a/tests/rules/space-after-colon.js b/tests/rules/space-after-colon.js index 734538b5..50576ad5 100644 --- a/tests/rules/space-after-colon.js +++ b/tests/rules/space-after-colon.js @@ -12,7 +12,7 @@ describe('space after colon - scss', function () { lint.test(file, { 'space-after-colon': 1 }, function (data) { - lint.assert.equal(3, data.warningCount); + lint.assert.equal(4, data.warningCount); done(); }); }); @@ -26,7 +26,7 @@ describe('space after colon - scss', function () { } ] }, function (data) { - lint.assert.equal(4, data.warningCount); + lint.assert.equal(6, data.warningCount); done(); }); }); diff --git a/tests/sass/space-after-colon.sass b/tests/sass/space-after-colon.sass index 302c35a7..f2485e8f 100644 --- a/tests/sass/space-after-colon.sass +++ b/tests/sass/space-after-colon.sass @@ -14,3 +14,9 @@ $qux: 'qux' $norf:'norf' + +.foo + @at-root button#{&}:hover + +.foo:hover + +test diff --git a/tests/sass/space-after-colon.scss b/tests/sass/space-after-colon.scss index 967c5949..76f8db13 100644 --- a/tests/sass/space-after-colon.scss +++ b/tests/sass/space-after-colon.scss @@ -14,3 +14,17 @@ $qux: 'qux'; $norf:'norf'; + +.foo { + @at-root button#{&}:hover { + } +} + +.foo:hover { + @include test; +} + +$map: { + test:'red', + other: blue, +} From 6c8f13fa29d74152816c85f8feacf41eee0f76e9 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 16:25:34 +0100 Subject: [PATCH 11/20] :bug: ignore interpolation in class-name-format --- lib/helpers.js | 5 ++++- tests/rules/class-name-format.js | 32 +++++++++++++++---------------- tests/sass/class-name-format.sass | 17 ++++++++++++++++ tests/sass/class-name-format.scss | 21 ++++++++++++++++++++ 4 files changed, 58 insertions(+), 17 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 0b9af3ce..725d31bc 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -309,7 +309,10 @@ helpers.attemptTraversal = function (node, traversalPath) { currentNodeList = [], processChildNode = function processChildNode (child) { child.forEach(traversalPath[i], function (n) { - nextNodeList.push(n); + if (n.content && n.content.some && n.contains('interpolation')) { + return false; + } + return nextNodeList.push(n); }); }; diff --git a/tests/rules/class-name-format.js b/tests/rules/class-name-format.js index c5f5365c..751b05a2 100644 --- a/tests/rules/class-name-format.js +++ b/tests/rules/class-name-format.js @@ -12,7 +12,7 @@ describe('class name format - scss', function () { lint.test(file, { 'class-name-format': 1 }, function (data) { - lint.assert.equal(31, data.warningCount); + lint.assert.equal(33, data.warningCount); done(); }); }); @@ -26,7 +26,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(30, data.warningCount); + lint.assert.equal(32, data.warningCount); done(); }); }); @@ -40,7 +40,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(40, data.warningCount); + lint.assert.equal(42, data.warningCount); done(); }); }); @@ -54,7 +54,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(40, data.warningCount); + lint.assert.equal(43, data.warningCount); done(); }); }); @@ -68,7 +68,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(36, data.warningCount); + lint.assert.equal(37, data.warningCount); done(); }); }); @@ -82,7 +82,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(17, data.warningCount); + lint.assert.equal(18, data.warningCount); done(); }); }); @@ -110,7 +110,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(42, data.warningCount); + lint.assert.equal(45, data.warningCount); done(); }); }); @@ -126,7 +126,7 @@ describe('class name format - scss', function () { } ] }, function (data) { - lint.assert.equal(38, data.warningCount); + lint.assert.equal(41, data.warningCount); lint.assert.equal(data.messages[0].message, message); done(); }); @@ -143,7 +143,7 @@ describe('class name format - sass', function () { lint.test(file, { 'class-name-format': 1 }, function (data) { - lint.assert.equal(31, data.warningCount); + lint.assert.equal(33, data.warningCount); done(); }); }); @@ -157,7 +157,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(30, data.warningCount); + lint.assert.equal(32, data.warningCount); done(); }); }); @@ -171,7 +171,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(40, data.warningCount); + lint.assert.equal(42, data.warningCount); done(); }); }); @@ -185,7 +185,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(40, data.warningCount); + lint.assert.equal(43, data.warningCount); done(); }); }); @@ -199,7 +199,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(36, data.warningCount); + lint.assert.equal(37, data.warningCount); done(); }); }); @@ -213,7 +213,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(17, data.warningCount); + lint.assert.equal(18, data.warningCount); done(); }); }); @@ -241,7 +241,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(42, data.warningCount); + lint.assert.equal(45, data.warningCount); done(); }); }); @@ -257,7 +257,7 @@ describe('class name format - sass', function () { } ] }, function (data) { - lint.assert.equal(38, data.warningCount); + lint.assert.equal(41, data.warningCount); lint.assert.equal(data.messages[0].message, message); done(); }); diff --git a/tests/sass/class-name-format.sass b/tests/sass/class-name-format.sass index f63b1fe9..0b22788e 100644 --- a/tests/sass/class-name-format.sass +++ b/tests/sass/class-name-format.sass @@ -94,3 +94,20 @@ .strict-bem__elem_key--fail color: red + + +// Issue #988 - Fix interpolation in class names + +.#{$primary-class}--small + color: red + + &__child + color: red + +.test + &#{$primary-class} + color: red + + &__block + &--mod + color: blue diff --git a/tests/sass/class-name-format.scss b/tests/sass/class-name-format.scss index bbb2452e..cffedbc0 100644 --- a/tests/sass/class-name-format.scss +++ b/tests/sass/class-name-format.scss @@ -133,3 +133,24 @@ .strict-bem__elem_key--fail { color: red; } + +// Issue #988 - Fix interpolation in class names + +.#{$primary-class}--small { + color: red; + &__child { + color: red; + } +} + +.test { + &#{$primary-class} { + color: red; + } + + &__block { + &--mod { + color: blue; + } + } +} From 93268c6702501c3c4f7193b4a8561837c12212c8 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sat, 2 Sep 2017 17:06:29 +0100 Subject: [PATCH 12/20] :racehorse: Add npmignore --- .npmignore | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..607da405 --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +.github +coverage +docs +tests +.editorconfig +.eslintrc +.gitignore +.npmignore +.npmrc +.travis.yml +.nvmrc +appveyor.yml +CONTRIBUTING.md +CODE_OF_CONDUCT.md From ebd85116ddfc004e668c20038b5ff6499e299db5 Mon Sep 17 00:00:00 2001 From: ngryman Date: Wed, 17 Feb 2016 21:51:35 +0100 Subject: [PATCH 13/20] :art: Add support for .sasslintrc --- lib/config.js | 4 +++ tests/cli.js | 42 +++++++++++++++++++++++++ tests/yml/.sass-lint.yml/.sass-lint.yml | 1 + tests/yml/.sasslintrc/.sasslintrc | 1 + 4 files changed, 48 insertions(+) create mode 120000 tests/yml/.sass-lint.yml/.sass-lint.yml create mode 120000 tests/yml/.sasslintrc/.sasslintrc diff --git a/lib/config.js b/lib/config.js index 6f4f5590..3d79ccc1 100644 --- a/lib/config.js +++ b/lib/config.js @@ -52,6 +52,10 @@ module.exports = function (options, configPath) { } else { configPath = confHelpers.findFile(false, '.sass-lint.yml'); + + if (!configPath) { + configPath = confHelpers.findFile(false, '.sasslintrc'); + } } } else if (!pathIsAbsolute(configPath)) { diff --git a/tests/cli.js b/tests/cli.js index df7c7fef..6399e636 100644 --- a/tests/cli.js +++ b/tests/cli.js @@ -239,6 +239,48 @@ describe('cli', function () { }); }); + // Test default config files + + it('should return JSON from .sass-lint.yml', function (done) { + var command = 'sass-lint ../../sass/cli.scss --verbose'; + + childProcess.exec(command, { cwd: path.join(__dirname, 'yml', '.sass-lint.yml') }, function (err, stdout) { + + if (err) { + return done(err); + } + else { + try { + JSON.parse(stdout); + return done(); + } + catch (e) { + return done(new Error('Not JSON')); + } + } + }); + }); + + it('should return JSON from .sasslintrc', function (done) { + var command = 'sass-lint ../../sass/cli.scss --verbose'; + + childProcess.exec(command, { cwd: path.join(__dirname, 'yml', '.sasslintrc') }, function (err, stdout) { + + if (err) { + return done(err); + } + else { + try { + JSON.parse(stdout); + return done(); + } + catch (e) { + return done(new Error('Not JSON')); + } + } + }); + }); + // Test custom config path it('should return JSON from a custom config', function (done) { diff --git a/tests/yml/.sass-lint.yml/.sass-lint.yml b/tests/yml/.sass-lint.yml/.sass-lint.yml new file mode 120000 index 00000000..293a8cc2 --- /dev/null +++ b/tests/yml/.sass-lint.yml/.sass-lint.yml @@ -0,0 +1 @@ +../.color-keyword-errors.yml \ No newline at end of file diff --git a/tests/yml/.sasslintrc/.sasslintrc b/tests/yml/.sasslintrc/.sasslintrc new file mode 120000 index 00000000..293a8cc2 --- /dev/null +++ b/tests/yml/.sasslintrc/.sasslintrc @@ -0,0 +1 @@ +../.color-keyword-errors.yml \ No newline at end of file From ed93438322dde69522351ec46a3d529a99a6209b Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Wed, 22 Jun 2016 23:50:21 +0100 Subject: [PATCH 14/20] :art: Fix test issues --- tests/cli.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/cli.js b/tests/cli.js index 6399e636..dc5f1e7e 100644 --- a/tests/cli.js +++ b/tests/cli.js @@ -242,9 +242,9 @@ describe('cli', function () { // Test default config files it('should return JSON from .sass-lint.yml', function (done) { - var command = 'sass-lint ../../sass/cli.scss --verbose'; + var command = 'sass-lint ../../cli/cli.scss --verbose'; - childProcess.exec(command, { cwd: path.join(__dirname, 'yml', '.sass-lint.yml') }, function (err, stdout) { + exec(command, { cwd: path.join(__dirname, 'yml', '.sass-lint.yml') }, function (err, stdout) { if (err) { return done(err); @@ -262,10 +262,9 @@ describe('cli', function () { }); it('should return JSON from .sasslintrc', function (done) { - var command = 'sass-lint ../../sass/cli.scss --verbose'; - - childProcess.exec(command, { cwd: path.join(__dirname, 'yml', '.sasslintrc') }, function (err, stdout) { + var command = 'sass-lint ../../cli/cli.scss --verbose'; + exec(command, { cwd: path.join(__dirname, 'yml', '.sasslintrc') }, function (err, stdout) { if (err) { return done(err); } From 433b57c196af4e21e854b1dfd632c1186d5438f9 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Tue, 9 Aug 2016 00:50:24 +0100 Subject: [PATCH 15/20] include test files --- tests/cli.js | 2 +- tests/yml/.sass-lint.yml/.sass-lint.yml | 9 ++++++++- tests/yml/.sasslintrc/.sasslintrc | 14 +++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) mode change 120000 => 100644 tests/yml/.sass-lint.yml/.sass-lint.yml mode change 120000 => 100644 tests/yml/.sasslintrc/.sasslintrc diff --git a/tests/cli.js b/tests/cli.js index dc5f1e7e..6e004820 100644 --- a/tests/cli.js +++ b/tests/cli.js @@ -262,7 +262,7 @@ describe('cli', function () { }); it('should return JSON from .sasslintrc', function (done) { - var command = 'sass-lint ../../cli/cli.scss --verbose'; + var command = 'sass-lint ../../cli/cli.scss -c ".sasslintrc" --verbose'; exec(command, { cwd: path.join(__dirname, 'yml', '.sasslintrc') }, function (err, stdout) { if (err) { diff --git a/tests/yml/.sass-lint.yml/.sass-lint.yml b/tests/yml/.sass-lint.yml/.sass-lint.yml deleted file mode 120000 index 293a8cc2..00000000 --- a/tests/yml/.sass-lint.yml/.sass-lint.yml +++ /dev/null @@ -1 +0,0 @@ -../.color-keyword-errors.yml \ No newline at end of file diff --git a/tests/yml/.sass-lint.yml/.sass-lint.yml b/tests/yml/.sass-lint.yml/.sass-lint.yml new file mode 100644 index 00000000..2ba37375 --- /dev/null +++ b/tests/yml/.sass-lint.yml/.sass-lint.yml @@ -0,0 +1,8 @@ +options: + formatter: json + cache-config: false + merge-default-rules: false +files: + include: '**/*.s+(a|c)ss' +rules: + no-color-keywords: 1 diff --git a/tests/yml/.sasslintrc/.sasslintrc b/tests/yml/.sasslintrc/.sasslintrc deleted file mode 120000 index 293a8cc2..00000000 --- a/tests/yml/.sasslintrc/.sasslintrc +++ /dev/null @@ -1 +0,0 @@ -../.color-keyword-errors.yml \ No newline at end of file diff --git a/tests/yml/.sasslintrc/.sasslintrc b/tests/yml/.sasslintrc/.sasslintrc new file mode 100644 index 00000000..a7505d0c --- /dev/null +++ b/tests/yml/.sasslintrc/.sasslintrc @@ -0,0 +1,13 @@ +{ + "options": { + "formatter": "json", + "cache-config": false, + "merge-default-rules": false + }, + "files": { + "include": "**/*.s+(a|c)ss" + }, + "rules": { + "no-color-keywords": 1 + } +} From 554056bc5071f031ca3fe9fbea70117108cdae41 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sun, 3 Sep 2017 15:47:44 +0100 Subject: [PATCH 16/20] :white_check_mark: Fix tests --- tests/cli.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cli.js b/tests/cli.js index 6e004820..b2f7bb0c 100644 --- a/tests/cli.js +++ b/tests/cli.js @@ -242,7 +242,7 @@ describe('cli', function () { // Test default config files it('should return JSON from .sass-lint.yml', function (done) { - var command = 'sass-lint ../../cli/cli.scss --verbose'; + var command = 'node ../../../bin/sass-lint ../../cli/cli.scss --verbose'; exec(command, { cwd: path.join(__dirname, 'yml', '.sass-lint.yml') }, function (err, stdout) { @@ -262,7 +262,7 @@ describe('cli', function () { }); it('should return JSON from .sasslintrc', function (done) { - var command = 'sass-lint ../../cli/cli.scss -c ".sasslintrc" --verbose'; + var command = 'node ../../../bin/sass-lint ../../cli/cli.scss -c ".sasslintrc" --verbose'; exec(command, { cwd: path.join(__dirname, 'yml', '.sasslintrc') }, function (err, stdout) { if (err) { From d977a2fe1cb85dd157e8f9a29418be1f3961d417 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Sun, 3 Sep 2017 18:09:43 +0100 Subject: [PATCH 17/20] :memo: Add basic sasslintrc docs --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e35eafb..20627d32 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ npm install sass-lint --save-dev ## Configuring -Sass-lint can be configured from a `.sass-lint.yml` file in your project. If you don't have one in the root of your project or you would like all your projects to follow a standard config file then you can specify the path to one in your project's `package.json` file. +Sass-lint can be configured from a `.sass-lint.yml` or `.sasslintrc` file in your project. The `.sasslintrc` file can be in either JSON format or YAML. Both formats are interchangeable easily using tools such as [json2yaml](https://www.json2yaml.com/). If you don't either file in the root of your project or you would like all your projects to follow a standard config file then you can specify the path to one in your project's `package.json` file with the `sasslintConfig` option. For example: ```javascript @@ -32,7 +32,7 @@ For example: } ``` -Use the [Sample Config](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml) as a guide to create your own `.sass-lint.yml` config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml). +Use the [Sample Config (YAML)](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml) or [Sample Config (JSON)](https://github.com/sasstools/sass-lint/tree/master/docs/sasslintrc) as a guide to create your own config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml). ### [Configuration Documentation](https://github.com/sasstools/sass-lint/tree/master/docs/options) @@ -48,7 +48,6 @@ The following are options that you can use to config the Sass Linter. * [merge-default-rules](https://github.com/sasstools/sass-lint/tree/master/docs/options/merge-default-rules.md) - Allows you to merge your rules with the default config file included with sass-lint * [output-file](https://github.com/sasstools/sass-lint/tree/master/docs/options/output-file.md) - Choose to write the linters output to a file - #### Files The `files` option contains two properties, `include` and `ignore`. Both can be set to either a [glob](https://github.com/isaacs/node-glob) or an array of glob strings/file paths depending on your projects' needs and setup. From 24ef9ba97555d6049daf35aec082e52337916e98 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Mon, 25 Sep 2017 23:44:37 +0100 Subject: [PATCH 18/20] Check for non strings for gonales methods --- lib/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helpers.js b/lib/helpers.js index 725d31bc..9673d8af 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -309,7 +309,7 @@ helpers.attemptTraversal = function (node, traversalPath) { currentNodeList = [], processChildNode = function processChildNode (child) { child.forEach(traversalPath[i], function (n) { - if (n.content && n.content.some && n.contains('interpolation')) { + if (n.content && typeof n.content !== 'string' && n.contains('interpolation')) { return false; } return nextNodeList.push(n); From 1f2718de1f5f430296ffc64e36429f11eba08a2d Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Tue, 3 Oct 2017 01:09:41 +0100 Subject: [PATCH 19/20] :shipit: Prepare 1.12.0 --- CHANGELOG.md | 19 +++++++++++++++++++ package.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 140dac7a..6ac5f473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Sass Lint Changelog +## v1.12.0 + +**October 3rd, 2017** + +**Fixes** +* Fixed an issue with custom properties being flagged in the misspelled-properties rule [#1122](https://github.com/sasstools/sass-lint/pull/1122) +* Fixed an issue where custom properties with colors in their name would be flagged as invalid by no-color-keywords [#1124](https://github.com/sasstools/sass-lint/pull/1124/files) +* Fixed a crash in empty-line-between-blocks where acessing the content of a parent node of type string would throw an error [#1125](https://github.com/sasstools/sass-lint/pull/1125/files) +* Functions and custom properties were being incorrectly flagged as invalid within rgba functions for no-color-literals [#1127](https://github.com/sasstools/sass-lint/pull/1127) +* Fixed an incorrect warning in space-after-colon when using `@at-root` [#1129](https://github.com/sasstools/sass-lint/pull/1129) +* Fixed an issue where interpolation was incorrectly flagging within the class-name-format rule [#1131](https://github.com/sasstools/sass-lint/pull/1131) + + +**New Features** +* Rollup.js integration added to integration list +* Added an npmignore to remove unnecessary dev files from a sass-lint install / release [#1132](https://github.com/sasstools/sass-lint/pull/1132) +* Added basic support for a `.sasslintrc` json config file [#1135](https://github.com/sasstools/sass-lint/pull/1135) +* Added two new options to the variable-for-property rule - [allow-map-get](https://github.com/sasstools/sass-lint/blob/master/docs/rules/variable-for-property.md#allow-map-get-true) & [allowed-functions](https://github.com/sasstools/sass-lint/blob/master/docs/rules/variable-for-property.md#allowed-functions-) - [#1128](https://github.com/sasstools/sass-lint/pull/1128) + ## v1.11.1 **August 28th, 2017** diff --git a/package.json b/package.json index b184547a..7bb28088 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sass-lint", - "version": "1.11.1", + "version": "1.12.0", "description": "All Node Sass linter!", "main": "index.js", "scripts": { From b126b4c57b3000b6541a7ed33c5ea15806aeb166 Mon Sep 17 00:00:00 2001 From: Dan Purdy Date: Tue, 3 Oct 2017 01:11:42 +0100 Subject: [PATCH 20/20] :shipit: Prepare v1.12.0 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ac5f473..e65a7b8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ **Fixes** * Fixed an issue with custom properties being flagged in the misspelled-properties rule [#1122](https://github.com/sasstools/sass-lint/pull/1122) -* Fixed an issue where custom properties with colors in their name would be flagged as invalid by no-color-keywords [#1124](https://github.com/sasstools/sass-lint/pull/1124/files) -* Fixed a crash in empty-line-between-blocks where acessing the content of a parent node of type string would throw an error [#1125](https://github.com/sasstools/sass-lint/pull/1125/files) +* Fixed an issue where custom properties with colors in their name would be flagged as invalid by no-color-keywords [#1124](https://github.com/sasstools/sass-lint/pull/1124) +* Fixed a crash in empty-line-between-blocks where acessing the content of a parent node of type string would throw an error [#1125](https://github.com/sasstools/sass-lint/pull/1125) * Functions and custom properties were being incorrectly flagged as invalid within rgba functions for no-color-literals [#1127](https://github.com/sasstools/sass-lint/pull/1127) * Fixed an incorrect warning in space-after-colon when using `@at-root` [#1129](https://github.com/sasstools/sass-lint/pull/1129) * Fixed an issue where interpolation was incorrectly flagging within the class-name-format rule [#1131](https://github.com/sasstools/sass-lint/pull/1131)