3 const declarationValueIndex = require("../utils/declarationValueIndex");
4 const isStandardSyntaxDeclaration = require("../utils/isStandardSyntaxDeclaration");
5 const report = require("../utils/report");
7 module.exports = function(opts) {
8 opts.root.walkDecls(decl => {
9 if (!isStandardSyntaxDeclaration(decl)) {
13 // Get the raw prop, and only the prop
14 const endOfPropIndex =
15 declarationValueIndex(decl) + (decl.raws.between || "").length - 1;
17 // The extra characters tacked onto the end ensure that there is a character to check
18 // after the colon. Otherwise, with `background:pink` the character after the
19 const propPlusColon = decl.toString().slice(0, endOfPropIndex) + "xxx";
21 for (let i = 0, l = propPlusColon.length; i < l; i++) {
22 if (propPlusColon[i] !== ":") {
25 opts.locationChecker({
26 source: propPlusColon,
28 lineCheckStr: decl.value,
33 index: decl.prop.toString().length + 1,
35 ruleName: opts.checkedRuleName