.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / utils / isStandardSyntaxSelector.js
1 /* @flow */
2 "use strict";
3
4 const hasInterpolation = require("../utils/hasInterpolation");
5 /**
6  * Check whether a selector is standard
7  */
8 module.exports = function(selector /*: string*/) /*: boolean*/ {
9   // SCSS or Less interpolation
10   if (hasInterpolation(selector)) {
11     return false;
12   }
13
14   // SCSS placeholder selectors
15   if (selector.indexOf("%") === 0) {
16     return false;
17   }
18
19   // Less :extend()
20   if (/:extend(\(.*?\))?/.test(selector)) {
21     return false;
22   }
23
24   // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar])
25   if (/\.[a-z0-9-_]+\(.*\).+/i.test(selector)) {
26     return false;
27   }
28
29   return true;
30 };