0.0.1 • Published 1 year ago

@flixlix/config-prettier v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Shared prettier configuration

The purpose of the prettier is formatting many language formats (js, ts, tsx, md, json, yaml).


Contents

Setup

  • Add workspace reference to @flixlix/config-prettier and its peer dependencies:

    pnpm add -w @flixlix/config-prettier prettier
  • Add prettier configuration file:

    // .prettierrc.js
    
    module.exports = require('@flixlix/config-prettier');
  • Add prettier ignore patterns file:

    # .prettierignore
    
    node_modules/
    pnpm-lock.yaml
    
    # Next ignore patterns
    .next/
    .build/
    .coverage/
    
    # Custom ignore patterns
    ...
  • Add prettier scripts:

    // package.json
    
    "scripts": {
      ...
      "format": "prettier",
      "format:check": "pnpm format --check --debug-check",
      "format:fix": "pnpm format --write"
      ...
    }

Automation

Usage

  • Automatic format file with prettier on save.
  • Automatic format of staged files with prettier on commit.
  • Manual usage from command line:

    pnpm format:check .
    pnpm format:fix .

Donation

If you found this project helpful, consider\ buying me a coffee, donate by paypal or just leave a star⭐\ Thanks for your support, it is much appreciated!

License

MIT © Luca Félix


⬅ Back


0.0.1

1 year ago