Skip to content

Commit

Permalink
Merge pull request sasstools#168 from bgriffith/hotfix/sass-single-line
Browse files Browse the repository at this point in the history
Hotfix master - Fix issue with Single Line Per Selector and Sass syntax
  • Loading branch information
DanPurdy committed Sep 14, 2015
2 parents ed8e315 + 663e81d commit 2ea6fcf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/rules/single-line-per-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ module.exports = {
var result = [];

ast.traverseByType('selector', function (selector) {
selector.forEach('delimiter', function (del, i) {
var next = selector.content[i + 1].content[0];
selector.forEach('delimiter', function (delimiter, i) {
var next = selector.content[i + 1];

if (next) {
if (next.type !== 'space' || next.content.indexOf(os.EOL) === -1) {
if (next.is('simpleSelector')) {
next = next.content[0];
}

if (!(next.is('space') && next.content.indexOf(os.EOL) !== -1)) {
result = helpers.addUnique(result, {
'ruleId': parser.rule.name,
'line': next.start.line,
Expand Down

0 comments on commit 2ea6fcf

Please sign in to comment.