Skip to content

Tailwind CSS config is accepted but has no effect due to oxfmt using a JS callout for Tailwind CSS sorting under the hood #8

@purkka

Description

@purkka

version: dprint 0.52.0

oxfmt doesn't implement Tailwind CSS class sorting in Rust. Instead, it has an external callback for prettier-plugin-tailwindcss which calls into a JS runtime to invoke tailwindcss.getClassOrder. The WASM plugin has no JS runtime available, so it cannot provide the TailwindCallback that oxc_formatter requires via ExternalCallbacks. As a result, oxc's formatter.build passes None for external callbacks, and Tailwind CSS classes are never sorted.

Either adding a JS runtime in the plugin to call prettier's sorter or rewriting sorting logic in Rust would solve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions