MCPcopy
hub / github.com/postcss/postcss / plugin

Function plugin

test/types.ts:4–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import { RootRaws } from '../lib/root.js'
3
4const plugin: PluginCreator<string> = prop => {
5 return {
6 Declaration: (decl, { Comment, result }) => {
7 if (decl.prop === prop) {
8 decl.warn(result, `${decl.prop} found in ${decl.parent?.nodes.length}`)
9 decl.replaceWith(new Comment({ text: `${decl.prop} removed` }))
10 }
11 },
12 postcssPlugin: 'remover'
13 }
14}
15
16plugin.postcss = true
17

Callers 3

processor.test.tsFile · 0.70
postcss.test.tsFile · 0.70
runOnRootMethod · 0.50

Calls 2

replaceWithMethod · 0.80
warnMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…