0.1.15 • Published 3 months ago

@clabnet/configs-prettier v0.1.15

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

Shared prettier configuration

npm.io License: MIT

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


Contents

Setup

  • Add workspace reference to @clabnet/configs-prettier and its peer dependencies:

    pnpm add -w @clabnet/configs-prettier prettier
  • Add prettier configuration file:

    // .prettierrc.js
    
    module.exports = require('@clabnet/configs-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 .

⬅ Back


0.1.15

3 months ago

0.1.10

3 months ago

0.1.11

3 months ago

0.1.12

3 months ago

0.1.13

3 months ago

0.1.14

3 months ago

0.1.8

3 months ago

0.1.6

3 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago