{"record":{"id":"1e9a8aa5e8d0e35e","repo":"dianping/cat","slug":"unknown-property","errorCode":null,"errorMessage":"Unknown property '{}'.","messagePattern":"Unknown property '(.+?)'\\.","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"warning","filePath":"cat-home/src/main/webapp/assets/js/editor/worker-css.js","lineNumber":5129,"sourceCode":"var Validation = {\n\n    validate: function(property, value){\n        var name        = property.toString().toLowerCase(),\n            parts       = value.parts,\n            expression  = new PropertyValueIterator(value),\n            spec        = Properties[name],\n            part,\n            valid,\n            j, count,\n            msg,\n            types,\n            last,\n            literals,\n            max, multi, group;\n\n        if (!spec) {\n            if (name.indexOf(\"-\") !== 0){    //vendor prefixed are ok\n                throw new ValidationError(\"Unknown property '\" + property + \"'.\", property.line, property.col);\n            }\n        } else if (typeof spec != \"number\"){\n            if (typeof spec == \"string\"){\n                if (spec.indexOf(\"||\") > -1) {\n                    this.groupProperty(spec, expression);\n                } else {\n                    this.singleProperty(spec, expression, 1);\n                }\n\n            } else if (spec.multi) {\n                this.multiProperty(spec.multi, expression, spec.comma, spec.max || Infinity);\n            } else if (typeof spec == \"function\") {\n                spec(expression);\n            }\n\n        }\n\n    },","sourceCodeStart":5111,"sourceCodeEnd":5147,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/editor/worker-css.js#L5111-L5147","documentation":"Thrown by `Validation.validateProperty` when a declaration's property name is not present in the validator's Properties table and does not start with `-` (the parser deliberately lets vendor-prefixed properties through unvalidated). This is the worker's 'unknown property' lint: the CSS parses fine, but the validator does not recognize the property as standard CSS.","triggerScenarios":"Newer CSS properties absent from the bundled table (`gap`/`grid-template-areas` in old builds, `aspect-ratio`, `container-type`, `text-wrap: balance`'s property), custom/internal properties like `fx-foo`, typos (`colr`, `backgroud`), and CSS-in-JS artifacts. Any name not in Properties and not prefixed with `-` triggers the throw at the property token's position.","commonSituations":"Long-lived app bundles embedding an aging worker-css.js validating modern stylesheets; teams using nonstandard framework properties; simple misspellings that browsers silently ignore but the validator flags.","solutions":["If the name is a typo, correct it (the message gives you the exact spelling and position).","If the property is legitimately new, upgrade worker-css.js / the validation table, or switch the lint to a maintained validator (stylelint) that knows current CSS.","Prefix genuinely custom properties with `-` (they are exempt from this check) — this is also how spec custom properties (`--var`) pass.","Disable/relax the unknown-property rule in editor lint config if modern CSS must flow through an old worker."],"exampleFix":"/* before */\n.item { backgroud: red; gap: 8px; } /* 'Unknown property' for backgroud (and gap on old tables) */\n\n/* after */\n.item { background: red; gap: 8px; }","handlingStrategy":"validation","validationCode":"var Properties = /* your validator's table keys */ Object.keys(propertyTable);\nfunction knownProperty(name) {\n  return name.charAt(0) === '-' || propertyTable.hasOwnProperty(name); // vendor-prefixed and custom are exempt\n}","typeGuard":"function isRecognizedProperty(name, table) {\n  return typeof name === 'string' && (name[0] === '-' || Object.prototype.hasOwnProperty.call(table, name));\n}","tryCatchPattern":"try {\n  Validation.validate(property, value);\n} catch (ex) {\n  if (/Unknown property/.test(ex.message)) { addLint(ex.line, ex.col, ex.message); return; } // lint, don't crash\n  throw ex;\n}","preventionTips":["Treat unknown-property throws as lint warnings, not fatal errors — catch and display them.","Prefix custom properties with '-' or use '--var' names, which bypass this check.","Keep the validator's property table (or the worker itself) on an upgrade cadence matching the CSS you ship.","Run stylelint with a current spec preset alongside this legacy validator."],"tags":["css","validation","unknown-property","lint","legacy"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}