Skip to content

A universal prettier.io config file for all repositories at Wearsafe

License

Notifications You must be signed in to change notification settings

Broadshield/prettier-config

Repository files navigation

prettier-config

A universal prettier.io config file for all repositories at Wearsafe

Usage

Install using NPM:

# Install in a package.json file
npm i -SD "github:@broadshield/prettier-config"

Install using Yarn:

# Install in a package.json file
yarn add -D "github:@broadshield/prettier-config"

Add a .prettierrc.yjs example ./example.prettierrc.js:

module.exports = {
  ...require('@broadshield/prettier-config'),
  semi: true, // You can add your own custom settings/overrides here
};

Or edit package.json example ./package.json:

{
  "prettier": "@broadshield/prettier-config"
}

Copy the .prettierignore file after installing

# Copy the .prettierignore file to the root of your repository
cp node-modules/@broadshield/prettier-config/.prettierignore .prettierignore

Setup auto-formatting on changed files when committing

npx mrm@2 lint-staged

Or run it on changed files manually

prettier --write $(git diff --name-only --diff-filter d | grep '\.ts$' | xargs)

About

A universal prettier.io config file for all repositories at Wearsafe

Resources

License

Stars

Watchers

Forks

Packages