1.0.3 • Published 8 months ago

@kiforks/prettier-config v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@kiforks/prettier-config

npm version Build Status Downloads per month

Usage

You first need to install your published configuration, for example:

npm install --save-dev prettier @kiforks/prettier-config
yarn add --dev prettier @kiforks/prettier-config
pnpm add --save-dev prettier @kiforks/prettier-config
bun add --dev prettier @kiforks/prettier-config

Then, you can reference it in your package.json:

{
  "name": "my-cool-library",
  "version": "1.0.0",
  "prettier": "@kiforks/prettier-config"
}

If you don’t want to use package.json, you can use any of the supported extensions to export a string, e.g. .prettierrc:

"@kiforks/prettier-config"

Extending

To extend the configuration to overwrite some properties from the configuration, import the file in a .prettierrc.mjs file and export the modifications, e.g:

import kiforPrettierConfig from "@kiforks/prettier-config";

/**
 * @type {import("prettier").Config}
 */
const config = {
  ...kiforPrettierConfig,
  semi: false,
};

export default config;