From 15cca41b5b65d065dd9acdb46a98356938b5efb1 Mon Sep 17 00:00:00 2001 From: immitsu Date: Sun, 18 Jul 2021 22:54:27 +0300 Subject: [PATCH] Remove redundant conditionals --- lib/utils/isStandardSyntaxRule.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/lib/utils/isStandardSyntaxRule.js b/lib/utils/isStandardSyntaxRule.js index 6ea9121f13..0fe6dc3f67 100644 --- a/lib/utils/isStandardSyntaxRule.js +++ b/lib/utils/isStandardSyntaxRule.js @@ -13,8 +13,6 @@ module.exports = function (rule) { return false; } - // Casting this to any because 'selector' does not exist on type 'NodeRaws' - /** @type {any} */ const raws = rule.raws; // Get full selector @@ -24,39 +22,11 @@ module.exports = function (rule) { return false; } - // Called Less mixin (e.g. a { .mixin() }) - // @ts-ignore TODO TYPES support LESS and SASS types somehow - if (rule.mixin) { - return false; - } - - // Less detached rulesets - if (selector.startsWith('@') && selector.endsWith(':')) { - return false; - } - - // Ignore Less &:extend rule - if ('extend' in rule && rule.extend) { - return false; - } - - // Ignore mixin or &:extend rule - // https://github.com/shellscape/postcss-less/blob/master/lib/less-parser.js#L52 - // @ts-ignore TODO TYPES support LESS and SASS types somehow - if (rule.params && rule.params[0]) { - return false; - } - // Non-outputting Less mixin definition (e.g. .mixin() {}) if (selector.endsWith(')') && !selector.includes(':')) { return false; } - // Less guards - if (/when\s+(not\s+)*\(/.test(selector)) { - return false; - } - // Less Parametric mixins (e.g. .mixin(@variable: x) {}) if (/\(@.*\)$/.test(selector)) { return false;