Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kachkaev/prettier-config

kachkaev212MIT2.0.0

Works with Prettier v2, Compatible with Yarn PnP ans well as Classic Yarn / NPM. Uses default options, except for setting { trailingComma: "all" }. Inc

readme

@kachkaev → prettier config

Works with Prettier v2, Compatible with Yarn PnP ans well as Classic Yarn / NPM. Uses default options, except for setting { trailingComma: "all" }. Includes:

Adding to project

  1. Install the package:

    npm install -D @kachkaev/prettier-config
    ## or
    yarn add -D @kachkaev/prettier-config
  2. Create .prettierrc.js with the following contents:

    module.exports = require("@kachkaev/prettier-config");
  3. Create .prettierignore. For example,

    #######################
    ## Specific to Prettier
    #######################
    
    ## Ignore all files (but still allow sub-folder scanning)
    *
    !*/
    
    ## Allow certain file types
    !*.cjs
    !*.css
    !*.graphql
    !*.js
    !*.json
    !*.jsx
    !*.md
    !*.mjs
    !*.ts
    !*.tsx
    !*.yml
    
    ########################
    ## Same as in .gitignore
    ########################
    
    # (paste lines from .gitignore here)
  4. Optionally, configure package scripts and a pre-commit hook to make sure that all project files are always formatted. See example in njtpackage.json.