From 08befbe27de15434067aa75053168435d32170a7 Mon Sep 17 00:00:00 2001 From: Vithal Reddy Date: Thu, 30 Mar 2023 17:33:21 +0530 Subject: [PATCH] chore: husky git hooks setup --- .husky/pre-commit | 4 ++++ package-lock.json | 16 ++++++++++++++++ package.json | 8 +++++--- tsconfig.json | 1 + 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..83af404 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint:fix diff --git a/package-lock.json b/package-lock.json index 639c20e..6bd83a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^4.2.1", + "husky": "^8.0.0", "prettier": "^2.8.7", "serverless": "^3.29.0", "serverless-api-gateway-throttling": "^2.0.3", @@ -6570,6 +6571,21 @@ "node": ">=12.20.0" } }, + "node_modules/husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index fa72960..58c2f76 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "data-import": "ts-node -T scripts/import-users-data.ts", "gen-openapi": "sls openapi generate -f json -a 3.0.3 -o docs/openapi.json -p docs/postman.json", "lint": "tsc --noEmit && eslint src/**/*.ts --cache --max-warnings=0", - "lint:fix": "eslint src/**/*.ts --fix", - "test": "echo \"Error: no test specified\" && exit 1" + "lint:fix": "tsc --noEmit && eslint src/**/*.ts --fix", + "test": "echo \"Error: no test specified\" && exit 1", + "prepare": "husky install" }, "keywords": [ "serverless", @@ -40,7 +41,8 @@ "serverless-offline": "^12.0.4", "serverless-openapi-documenter": "^0.0.48", "ts-node": "^10.9.1", - "typescript": "^5.0.2" + "typescript": "^5.0.2", + "husky": "^8.0.0" }, "dependencies": { "@aws-sdk/credential-providers": "^3.301.0", diff --git a/tsconfig.json b/tsconfig.json index 47b8122..9060d4e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "moduleResolution": "node", "allowSyntheticDefaultImports": true, "allowJs": true, + "skipLibCheck": true, "importHelpers": true, "alwaysStrict": true, "sourceMap": true,