diff --git a/lib/rules/indentation.js b/lib/rules/indentation.js index afff1989..12fe9b99 100644 --- a/lib/rules/indentation.js +++ b/lib/rules/indentation.js @@ -67,7 +67,9 @@ module.exports = { } } - if (n.is('block') || n.is('atrulers') || n.is('parentheses')) { + + + if (n.is('block') || n.is('atrulers') || (n.is('parentheses') && !node.is('atruleb'))) { level++; } diff --git a/tests/sass/indentation.scss b/tests/sass/indentation.scss index efe44114..29a01624 100644 --- a/tests/sass/indentation.scss +++ b/tests/sass/indentation.scss @@ -20,6 +20,10 @@ content: 'bar'; .qux { content: 'bar'; } + + @if (1 == 1) { + content: 'foo'; + } } @mixin bar { diff --git a/tests/scratch.js b/tests/scratch.js index 2e0f173a..49ca6c08 100644 --- a/tests/scratch.js +++ b/tests/scratch.js @@ -15,7 +15,7 @@ var lint = require('../index'), // detects = lint.lintFiles('**/*.s+(a|c)ss'); -detects = lint.lintFiles('sass/quotes.scss'); +detects = lint.lintFiles('sass/indentation.scss'); console.log(lint.format(detects));