Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / utils / isStandardSyntaxSelector.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/stylelint/lib/utils/isStandardSyntaxSelector.js
new file mode 100644 (file)
index 0000000..c443c80
--- /dev/null
@@ -0,0 +1,30 @@
+/* @flow */
+"use strict";
+
+const hasInterpolation = require("../utils/hasInterpolation");
+/**
+ * Check whether a selector is standard
+ */
+module.exports = function(selector /*: string*/) /*: boolean*/ {
+  // SCSS or Less interpolation
+  if (hasInterpolation(selector)) {
+    return false;
+  }
+
+  // SCSS placeholder selectors
+  if (selector.indexOf("%") === 0) {
+    return false;
+  }
+
+  // Less :extend()
+  if (/:extend(\(.*?\))?/.test(selector)) {
+    return false;
+  }
+
+  // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar])
+  if (/\.[a-z0-9-_]+\(.*\).+/i.test(selector)) {
+    return false;
+  }
+
+  return true;
+};