Skip to content

Instantly share code, notes, and snippets.

@yungblud
Created September 18, 2019 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yungblud/819d7050618c4e06017e5a75cca4c8b4 to your computer and use it in GitHub Desktop.
Save yungblud/819d7050618c4e06017e5a75cca4c8b4 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