Skip to content

Commit

Permalink
Fix support for HTML files in declaration-empty-line-before (#5689)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther committed Nov 16, 2021
1 parent c91774c commit 0eb6386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/rules/declaration-empty-line-before/__tests__/index.js
Expand Up @@ -902,7 +902,6 @@ testRule({
});

testRule({
skip: true,
ruleName,
config: ['always'],
customSyntax: postcssHtml,
Expand Down Expand Up @@ -960,7 +959,6 @@ testRule({
});

testRule({
skip: true,
ruleName,
config: ['always', { ignore: ['inside-single-line-block'] }],
customSyntax: postcssHtml,
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/declaration-empty-line-before/index.js
Expand Up @@ -15,7 +15,7 @@ const removeEmptyLinesBefore = require('../../utils/removeEmptyLinesBefore');
const report = require('../../utils/report');
const ruleMessages = require('../../utils/ruleMessages');
const validateOptions = require('../../utils/validateOptions');
const { isAtRule, isRule } = require('../../utils/typeGuards');
const { isAtRule, isRule, isRoot } = require('../../utils/typeGuards');

const ruleName = 'declaration-empty-line-before';

Expand Down Expand Up @@ -66,7 +66,7 @@ const rule = (primary, secondaryOptions, context) => {
return;
}

if (!isAtRule(parent) && !isRule(parent)) {
if (!isAtRule(parent) && !isRule(parent) && !isRoot(parent)) {
return;
}

Expand Down

0 comments on commit 0eb6386

Please sign in to comment.