MCPcopy
hub / github.com/tailwindlabs/prettier-plugin-tailwindcss / transformAstro

Function transformAstro

src/index.ts:752–775  ·  view source on GitHub ↗
(ast: any, env: TransformerEnv)

Source from the content-addressed store, hash-verified

750}
751
752function transformAstro(ast: any, env: TransformerEnv) {
753 let { matcher } = env
754
755 if (ast.type === 'element' || ast.type === 'custom-element' || ast.type === 'component') {
756 for (let attr of ast.attributes ?? []) {
757 if (matcher.hasStaticAttr(attr.name) && attr.type === 'attribute' && attr.kind === 'quoted') {
758 attr.value = sortClasses(attr.value, {
759 env,
760 })
761 } else if (
762 matcher.hasDynamicAttr(attr.name) &&
763 attr.type === 'attribute' &&
764 attr.kind === 'expression' &&
765 typeof attr.value === 'string'
766 ) {
767 transformDynamicJsAttribute(attr, env)
768 }
769 }
770 }
771
772 for (let child of ast.children ?? []) {
773 transformAstro(child, env)
774 }
775}
776
777function transformMarko(ast: any, env: TransformerEnv) {
778 let { matcher } = env

Callers

nothing calls this directly

Calls 4

sortClassesFunction · 0.85
hasStaticAttrMethod · 0.80
hasDynamicAttrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…