Skip to content

positive-js/prettier-config

Repository files navigation

prettier-config

CircleCI npm David-DM

Usage

  1. npm install --save-dev @ptsecurity/prettier-config prettier

  2. In your project create .prettierrc.js with line: module.exports = require('@ptsecurity/prettier-config');

Usage with tslint

Better if prettier and tslint will handle different files especcially if there are custom rules.

Optional using (as git hook)

This may not work as expected in Webstorm.

  1. npm install --save-dev husky lint-staged

  2. Add lines to your package.json, select type of files for formatting. As example:

    "scripts": {
        "precommit": "lint-staged"
    },
    "lint-staged": {
        "linters": {
            "*.{js,css,less,md}": ["prettier --write", "git add"]
        }
    }
  1. Optionally add plugins depending on the using and priorities your tools.