Skip to content

Instantly share code, notes, and snippets.

@funkytaco
Forked from yungblud/precommit.md
Created October 24, 2019 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkytaco/7f1fcbe570640b85a2d94960208243d1 to your computer and use it in GitHub Desktop.
Save funkytaco/7f1fcbe570640b85a2d94960208243d1 to your computer and use it in GitHub Desktop.
Pre Commit

package.json

  "scripts": {
    "precommit": "npm run precommit:client && npm run precommit:server",
    "precommit:client": "cd client && npm run precommit",
    "precommit:server": "cd server && npm run precommit"
  },

server/package.json

  "scripts": {
    ...
    "precommit": "pretty-quick --staged && npm run lint:fix",
    "lint": "tslint --project tsconfig.json",
    "lint:fix": "tslint --project tsconfig.json --fix",
  }

client/package.json

  "scripts": {
    ...
    "precommit": "pretty-quick --staged && npm run lint:fix",
    "lint": "eslint src/",
    "lint:fix": "eslint --fix src --ext .js",
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment