@brixtol/prettier-config

1.2.1 • Public • Published

@brixtol/prettier-config

This package includes the shareable Prettier configuration consumed by Brixtol Textiles.

Install

pnpm

pnpm add prettier @brixtol/prettier-config --save-dev

Prettier is an optionalDependency so you will need to install it within your project.

Usage

We extend configuration from within package.json files.

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

Text Editor (VSCode)

Install the esbenp.prettier-vscode extension from the marketplace. Depending on how your editor is configured, one may require setting global configuration in a user settings.json file:

{
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[markdown]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode" // disabled in brixtol packages
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode" // disabled in brixtol packages
  }
}
Pnpm monorepo

If you are working within a pnpm monorepo workspace there are 2 ways you can leverage prettier. For us here at brixtol we provide prettier and the shareable config in the root as developement dependency. You may wish to refer a certain workspace (package) to the shareable config within .vscode/settings.json file:

{
  "prettier.configPath": "node_modules/@brixtol/prettier-config/index.js"
}

Ignored Files

We do not leverage prettier for various file types because it is extremely opionated and conflicts with our code styles, especially that found in JavaScript and TypeScript based projects. In almost all packages within our monorepo a .prettierignore file is included to prevent prettier from wreaking utter havoc in our development workspace. Below is standard ignores we assert:

*.toml
*.mjs
*.js
*.ts
*.css
*.scss
*.liquid
*.html

Related

License

MIT


We open source!

Package Sidebar

Install

npm i @brixtol/prettier-config

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

4.95 kB

Total Files

4

Last publish

Collaborators

  • sissel