An object of CSS properties that don't accept values with units
92
Quality
Pending
Does it follow best practices?
Impact
92%
0.92xAverage score across 7 eval scenarios
{
"context": "This criteria evaluates how effectively the engineer uses the @emotion/unitless package to implement a performant style value processor. The focus is on correct usage of the unitless lookup object for efficient property checking and appropriate unit handling logic.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import unitless",
"description": "The @emotion/unitless package is imported using require() or import statement (e.g., 'const unitless = require(\"@emotion/unitless\")' or 'import unitless from \"@emotion/unitless\"')",
"max_score": 10
},
{
"name": "Direct lookup",
"description": "Uses direct object property access on the unitless object (e.g., 'unitless[property]' or 'unitless.flex') rather than methods like hasOwnProperty, Object.keys, or Array.includes",
"max_score": 25
},
{
"name": "Correct value check",
"description": "Checks if the unitless lookup equals 1 (e.g., 'unitless[property] === 1') or checks for undefined/falsy (e.g., 'unitless[property] !== 1' or '!unitless[property]') to determine unitless properties",
"max_score": 20
},
{
"name": "Custom property handling",
"description": "Implements logic to detect and preserve custom CSS properties (variables starting with '--') without modification, typically using charCodeAt or string prefix checking",
"max_score": 15
},
{
"name": "Zero value handling",
"description": "Implements logic that prevents adding units to zero values (e.g., 'value === 0' check before adding 'px')",
"max_score": 10
},
{
"name": "Type checking",
"description": "Checks if the value is a number using 'typeof value === \"number\"' before applying unit logic",
"max_score": 10
},
{
"name": "Correct unit application",
"description": "Adds 'px' unit only to numeric non-zero values for properties not in the unitless object (e.g., returns 'value + \"px\"' or template literal)",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-emotion--unitless