🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@aureldvx/prettier

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aureldvx/prettier

An opinionated Prettier configuration for my personal projects

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Prettier configuration

Tailored for accessibility and readability purposes, which for some part is inherited from this reddit post.

Installation

npm install --save-dev @aureldvx/prettier
# or
yarn add --dev @aureldvx/prettier
# or
pnpm install --save-dev @aureldvx/prettier

Usage

To use the configuration, add the following to your prettier.config.js file:

import { defineConfig } from "@aureldvx/prettier";

export default defineConfig();

Built-in plugins

prettier-plugin-packagejson (documentation)

Format the package.json file in a more readable way, using sort-package-json under the hood. It is enabled by default and cannot be disabled.

prettier-plugin-astro (documentation)

Format all .astro files. You can customize the configuration more granularly :

import { defineConfig } from "@aureldvx/prettier";

// Enable the default astro config
export default defineConfig({
  astro: true,
});

// Or override it with your own
export default defineConfig({
  astro: {
    allowShorthand: true,
    skipFrontmatter: false,
  },
});

@prettier/plugin-xml (documentation)

Format XML files, uses primarly to format SVGs in your project. You can customize the configuration more granularly :

import { defineConfig } from "@aureldvx/prettier";

// Enable the default xml config
export default defineConfig({
  xml: true,
});

// Or override it with your own
export default defineConfig({
  xml: {
    bracketSameLine: false,
    printWidth: 80,
    singleAttributePerLine: false,
    tabWidth: 2,
    quoteAttributes: 'double',
    selfClosingSpace: true,
    sortAttributesByKey: true,
    whitespaceSensitivity: 'ignore',
  },
});

prettier-plugin-tailwindcss (documentation)

Reorder tailwindcss classes wherever they are referenced based on the recommended order from tailwind team.

import { defineConfig } from "@aureldvx/prettier";

// With Tailwind v4
export default defineConfig({
  tailwind: {
    // Required: specify the css entrypoint file.
    tailwindStylesheet: 'src/index.css',
    // All other ones are optional.
    tailwindAttributes: ['class', 'className'],
    tailwindFunctions: ['clsx', 'cva', 'cx', 'tw', 'twMerge', 'cw'],
    tailwindPreserveWhitespace: false,
    tailwindPreserveDuplicates: false,
  },
});

// With Tailwind v3
export default defineConfig({
  tailwind: {
    // If not specified, it will find a `tailwind.config.js`
    // in the same directory as the prettier config file.
    tailwindConfig: 'tailwind.config.js',
    tailwindAttributes: ['class', 'className'],
    tailwindFunctions: ['clsx', 'cva', 'cx', 'tw', 'twMerge', 'cw'],
    tailwindPreserveWhitespace: false,
    tailwindPreserveDuplicates: false,
  },
});

Extend configuration with your own settings

To edit the provided configuration, simply add the extends key in the definedConfig object parameter.

import {defineConfig} from "@aureldvx/prettier";

export default defineConfig({
  extends: {
    // Your additional configuration here
  },
});

Keywords

prettier

FAQs

Package last updated on 11 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts