diff --git a/lib/utils/__tests__/isStandardSyntaxRule.test.js b/lib/utils/__tests__/isStandardSyntaxRule.test.js index 025ab14a04..d4379764ca 100644 --- a/lib/utils/__tests__/isStandardSyntaxRule.test.js +++ b/lib/utils/__tests__/isStandardSyntaxRule.test.js @@ -79,6 +79,9 @@ describe('isStandardSyntaxRule', () => { it('less guarded namespaces', () => { expect(isStandardSyntaxRule(lessNode('#namespace when (@mode=huge) {}'))).toBeFalsy(); }); + it('less parametric mixins', () => { + expect(isStandardSyntaxRule(lessNode('.mixin (@variable: 5) {}'))).toBeFalsy(); + }); it('mixin guards', () => { expect( isStandardSyntaxRule(lessNode('.mixin (@variable) when (@variable = 10px) {}')), diff --git a/lib/utils/isStandardSyntaxRule.js b/lib/utils/isStandardSyntaxRule.js index bca92da849..076729ff8f 100644 --- a/lib/utils/isStandardSyntaxRule.js +++ b/lib/utils/isStandardSyntaxRule.js @@ -60,6 +60,11 @@ module.exports = function (rule) { return false; } + // Less Parametric mixins (e.g. .mixin(@variable: x) {}) + if (/\(@.*\)$/.test(selector)) { + return false; + } + // Ignore Scss nested properties if (selector.endsWith(':')) { return false;