Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@hideoo/prettier-config

HiDeoo476MIT2.0.1

HiDeoo's Prettier configuration

prettier, config, prettier-config

readme

@hideoo/prettier-config 📐

HiDeoo's Prettier configuration

Usage

Install

$ pnpm add -D prettier @hideoo/prettier-config

Configure

Reference the configuration in your package.json file:

{
  "prettier": "@hideoo/prettier-config"
}

Alternatively, you can also extends the configuration through a configuration file. This is particularly useful when using some Prettier plugins, e.g. with a .prettierrc.cjs file:

const baseConfig = require('@hideoo/prettier-config')

/**
 * @type {import('prettier').Config}
 */
const prettierConfig = {
  ...baseConfig,
  overrides: [
    {
      files: '*.astro',
      options: {
        parser: 'astro',
      },
    },
  ],
  plugins: ['prettier-plugin-astro'],
}

module.exports = prettierConfig

As of 07/19/2023, Prettier v3 does support ESM configuration files but using an import statement will result in an error in the VSCode Prettier extension.

Run

Add a script in your package.json file to run Prettier:

{
  "scripts": {
    "lint": "prettier -c --cache ."
  }
}

License

Licensed under the MIT License, Copyright © HiDeoo.

See LICENSE for more information.