MCPcopy
hub / github.com/css/csso / cleanRule

Function cleanRule

lib/clean/Rule.js:79–100  ·  view source on GitHub ↗
(node, item, list, options)

Source from the content-addressed store, hash-verified

77}
78
79export default function cleanRule(node, item, list, options) {
80 if (hasNoChildren(node.prelude) || hasNoChildren(node.block)) {
81 list.remove(item);
82 return;
83 }
84
85 // avoid usage filtering for some at-rules
86 if (this.atrule && skipUsageFilteringAtrule.has(keyword(this.atrule.name).basename)) {
87 return;
88 }
89
90 const { usage } = options;
91
92 if (usage && (usage.whitelist !== null || usage.blacklist !== null)) {
93 cleanUnused(node.prelude, usage);
94
95 if (hasNoChildren(node.prelude)) {
96 list.remove(item);
97 return;
98 }
99 }
100};

Callers

nothing calls this directly

Calls 2

hasNoChildrenFunction · 0.90
cleanUnusedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…