Skip to content

boar-network/prettier-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prettier-config

Prettier code formatter configuration.

Usage

Setting up a project

  1. Install dependencies:

    npm install --save-dev github:boar-network/prettier-config prettier
  2. Configure prettier:

    The easiest way to configure prettier to use this configuration is to define prettier property in the project’s package.json:

    "prettier": "@boar-network/prettier-config"

    For more sophisticated configuration instead of adding this entry add a configuration file (see: Plugins section).

  3. Define scripts property in package.json, e.g.:

    "scripts": {
      "format": "prettier --check .",
      "format:fix": "prettier --write ."
    }
  4. Run npm run format or npm run format:fix

Plugins

To handle .sh or .toml files you need to install dedicated plugins:

  • for sh: npm install --save-dev prettier-plugin-sh

  • for toml: npm install --save-dev prettier-plugin-toml

And configure the plugins usage in .prettierrc.js, e.g.:

module.exports = {
  ...require("@boar-network/prettier-config"),
  plugins: ["prettier-plugin-sh", "prettier-plugin-toml"],
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published