From 7c1ee80912122760c2d8385aeb782b876f56e7fd Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 25 Jan 2024 18:25:32 +0530 Subject: [PATCH] Add husky for precommit lint --- .husky/pre-commit | 1 + package.json | 20 +++++++++++--------- yarn.lock | 5 +++++ 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..39abe4d --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +yarn lint diff --git a/package.json b/package.json index c10065c..4d5dba9 100644 --- a/package.json +++ b/package.json @@ -12,18 +12,19 @@ "@types/lodash": "^4.14.182", "@types/node": "^17.0.25", "@types/yargs": "^17.0.10", - "jest": "29.0.0", - "ts-jest": "^29.0.2", - "dotenv": "^16.3.2", - "eslint": "^8.35.0", - "eslint-config-standard": "^16.0.3", - "eslint-config-semistandard": "^15.0.1", "@typescript-eslint/eslint-plugin": "^5.47.1", "@typescript-eslint/parser": "^5.47.1", + "dotenv": "^16.3.2", + "eslint": "^8.35.0", + "eslint-config-semistandard": "^15.0.1", + "eslint-config-standard": "^16.0.3", "eslint-plugin-import": "^2.27.5", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", + "husky": "^9.0.2", + "jest": "29.0.0", + "ts-jest": "^29.0.2", "typescript": "^4.6.3" }, "dependencies": { @@ -35,12 +36,13 @@ "yargs": "^17.4.1" }, "scripts": { - "test": "jest --runInBand --verbose test/cli.test.ts", + "test": "jest --runInBand --verbose test/*.test.ts", "lint": "eslint .", "clean": "rm -rf ./dist", - "build": "tsc" + "build": "tsc", + "prepare": "husky" }, "bin": { "laconic": "bin/laconic" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a2494ce..acdb9ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2895,6 +2895,11 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +husky@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.2.tgz#7ac26cb63719e91a159991039187b35e7358557e" + integrity sha512-0yR5R3OPjl8bYApi6T4QMOAwhtLhBjdYIVg5S6zSzIO8DIvQMh/b7Q8jW3WLbHLHtzpwiyMLBNB4R0Eb6x5+AA== + ieee754@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"