JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 68
  • Score
    100M100P100Q75465F
  • License MIT

Shareable Config for Prettier.

Package Exports

  • @tiagoporto/prettier-config

Readme

@tiagoporto/prettier-config

Shareable Config for Prettier

Installation

npm install --save-dev prettier @tiagoporto/prettier-config

Usage

// .prettierrc.mjs
import tpConfig from '@tiagoporto/prettier-config'

export default tpConfig

In package.json add the following scripts:

{
  "scripts": {
    "format:check": "prettier --check --ignore-unknown \"**/*\"",
    "format": "npm run format:check -- --write"
  }
}

Lint-staged

Check staged files

// .lintstagedrc.mjs
export default {
  '*': 'prettier --check --ignore-unknown --write'
}

Editor

For VSCode is recommended the following extensions:

// .vscode/settings.json
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

License

@tiagoporto/prettier-config © 2024 by Tiago Porto is licensed under MIT License.