Skip to content

formatter: Diff with prettier on singleQuote:true and experimentalTailwindcss inside JSX className property with ternary #17835

@jlowcs

Description

@jlowcs
{
  "$schema": "./node_modules/oxfmt/configuration_schema.json",
  "singleQuote": true,
  "experimentalTailwindcss": {
    "functions": ["clsx", "cn", "tv"]
  }
}

Prettier:

const showLandingPage = true;

export const HeaderTitle: React.FC = () => {
	return <div className={showLandingPage ? 'container pb-6' : 'hidden'}>title</div>;
};

oxfmt:

const showLandingPage = true;

export const HeaderTitle: React.FC = () => {
	return <div className={showLandingPage ? "container pb-6" : 'hidden'}>title</div>;
};

For some reason "container pb-6" becomes double-quoted, but not 'hidden'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions