MCPcopy Index your code
hub / github.com/tailwindlabs/prettier-plugin-tailwindcss / loadPlugins

Function loadPlugins

src/create-plugin.ts:145–165  ·  view source on GitHub ↗
(fns: PluginLoad[])

Source from the content-addressed store, hash-verified

143}
144
145async function loadPlugins<T>(fns: PluginLoad[]) {
146 let plugin: Plugin<T> = {
147 parsers: Object.create(null),
148 printers: Object.create(null),
149 options: Object.create(null),
150 defaultOptions: Object.create(null),
151 languages: [],
152 }
153
154 for (let source of fns) {
155 let loaded = await loadPlugin(source)
156 Object.assign(plugin.parsers!, loaded.parsers ?? {})
157 Object.assign(plugin.printers!, loaded.printers ?? {})
158 Object.assign(plugin.options!, loaded.options ?? {})
159 Object.assign(plugin.defaultOptions!, loaded.defaultOptions ?? {})
160
161 plugin.languages = [...(plugin.languages ?? []), ...(loaded.languages ?? [])]
162 }
163
164 return plugin
165}
166
167const EMPTY_PLUGIN: Plugin<any> = {
168 parsers: {},

Callers 1

createPluginFunction · 0.85

Calls 1

loadPluginFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…