Skip to content

Commit

Permalink
Ignore Less &:extend in isStandardSyntaxDeclaration (#3824)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwilsson authored and ntwb committed Nov 27, 2018
1 parent 29424d4 commit 9dde9be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/utils/__tests__/isStandardSyntaxDeclaration.test.js
Expand Up @@ -204,6 +204,12 @@ describe("isStandardSyntaxDeclaration", () => {
expect(isStandardSyntaxDeclaration(decl)).toBeFalsy();
});
});

it("less &:extend", () => {
lessDecls("a { &:extend(b) }", decl => {
expect(isStandardSyntaxDeclaration(decl)).toBeFalsy();
});
});
});

function decls(css, cb) {
Expand Down
5 changes: 5 additions & 0 deletions lib/utils/isStandardSyntaxDeclaration.js
Expand Up @@ -33,5 +33,10 @@ module.exports = function(decl /*: Object*/) /*: boolean*/ {
return false;
}

// Less &:extend
if (decl.extend) {
return false;
}

return true;
};
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -66,7 +66,7 @@
"postcss": "^7.0.0",
"postcss-html": "^0.34.0",
"postcss-jsx": "^0.35.0",
"postcss-less": "^3.0.1",
"postcss-less": "^3.1.0",
"postcss-markdown": "^0.34.0",
"postcss-media-query-parser": "^0.2.3",
"postcss-reporter": "^6.0.0",
Expand Down

0 comments on commit 9dde9be

Please sign in to comment.