.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / utils / isStandardSyntaxValue.js
1 /* @flow */
2 "use strict";
3
4 const hasInterpolation = require("../utils/hasInterpolation");
5 /**
6  * Check whether a value is standard
7  */
8 module.exports = function(value /*: string*/) /*: boolean*/ {
9   let normalizedValue = value;
10
11   // Ignore operators before variables (example -$variable)
12   if (/^[-+*/]/.test(value[0])) {
13     normalizedValue = normalizedValue.slice(1);
14   }
15
16   // SCSS variable
17   if (normalizedValue[0] === "$") {
18     return false;
19   }
20
21   // Less variable
22   if (normalizedValue[0] === "@") {
23     return false;
24   }
25
26   // SCSS or Less interpolation
27   if (hasInterpolation(normalizedValue)) {
28     return false;
29   }
30
31   return true;
32 };