Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/zayne-labs/config/llms.txt

Use this file to discover all available pages before exploring further.

The zayne() factory accepts an options object with four main feature flags, each supporting boolean or detailed configuration.

Base Options

base
boolean | Config
default:"true"
Opinionated base Prettier configuration with refined defaults.When true, applies these defaults:
{
  experimentalOperatorPosition: "start",
  experimentalTernaries: true,
  jsxSingleQuote: false,
  printWidth: 107,
  singleQuote: false,
  tabWidth: 3,
  trailingComma: "es5",
  useTabs: true,
}
Pass a Config object to override specific values:
zayne({
  base: {
    printWidth: 120,
    useTabs: false,
  },
});

Sort Imports Options

sortImports
boolean | OptionsSortImports
default:"true"
Enables @ianvs/prettier-plugin-sort-imports with distance-based import organization.

Tailwind CSS Options

tailwindcss
boolean | OptionsTailwindCss
default:"false"
Enables Tailwind CSS class sorting via merged plugins. Requires:
  • prettier-plugin-tailwindcss
  • prettier-plugin-classnames
  • prettier-plugin-merge

Astro Options

astro
boolean | OptionsAstro
default:"false"
Enables prettier-plugin-astro for formatting .astro files.

Complete Example

import { zayne } from "@zayne-labs/prettier-config";

export default zayne(
  {
    base: {
      printWidth: 100,
      useTabs: false,
    },
    sortImports: {
      importOrder: [
        "^@company/core",
        "^@company/",
        "<THIRD_PARTY_MODULES>",
        "^@/",
        "^[./]",
      ],
      importOrderCaseSensitive: true,
    },
    tailwindcss: {
      tailwindStylesheet: "./src/styles/globals.css",
      customFunctions: ["cn", "clsx", "cva"],
      customAttributes: ["containerClass"],
    },
    astro: {
      astroAllowShorthand: true,
    },
  },
  {
    // Additional custom config
    semi: false,
  }
);

Build docs developers (and LLMs) love