From a65d4257a5419fc6d99bfc43c269dcab656bc9f3 Mon Sep 17 00:00:00 2001 From: Mihajlo Date: Tue, 10 May 2022 12:32:05 +0200 Subject: [PATCH] chore: running lint as pre-commit hook --- .git-hooks/pre-commit | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 .git-hooks/pre-commit diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit new file mode 100755 index 0000000..8f1c776 --- /dev/null +++ b/.git-hooks/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh + +npm run --silent lint:fix + +exit 0 \ No newline at end of file diff --git a/package.json b/package.json index 2be4b9a..02f528b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "rimraf build && rimraf node && mkdir node && copyfiles -u 1 \"./src/**/*\" ./node && webpack && rimraf build/src && rimraf node", "package:lib": "npm run build && copyfiles ./package.json ./checkNodeVersion.js build && cd build && npm version \"5.0.0\" && npm pack", "publish:lib": "npm run build && cd build && npm publish", - "lint:fix": "npx prettier --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --write \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", + "lint:fix": "npx prettier --loglevel silent --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --loglevel silent --write \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", "lint": "npx prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --check \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", "test": "jest --silent --coverage", "prepublishOnly": "cp -r ./build/* . && rm -rf ./build",