From 280ec5e39f71370e44bf49aef97822520af84b28 Mon Sep 17 00:00:00 2001 From: seven Date: Thu, 19 Sep 2024 16:13:50 +0800 Subject: [PATCH] add husky pre-commit Signed-off-by: seven --- .husky/pre-commit | 1 + package-lock.json | 22 ++++++++++++++++++++++ package.json | 4 +++- src/types.ts | 12 ------------ 4 files changed, 26 insertions(+), 13 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..5c9ec7e1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint:check diff --git a/package-lock.json b/package-lock.json index a3174079..71e209ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", + "husky": "^9.1.6", "jest": "^29.7.0", "prettier": "^3.2.4", "ts-jest": "^29.1.1", @@ -4170,6 +4171,21 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "dev": true, + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/i18n": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.15.1.tgz", @@ -9505,6 +9521,12 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, + "husky": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "dev": true + }, "i18n": { "version": "0.15.1", "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.15.1.tgz", diff --git a/package.json b/package.json index 3d3ce125..86e66356 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "test:ci": "jest --runInBand --ci --coverage --coverageReporters json-summary text html lcov", "build": "tsc --build", "lint:fix": "eslint --fix ./", - "lint:check": "eslint ./" + "lint:check": "eslint ./", + "prepare": "husky" }, "repository": { "type": "git", @@ -65,6 +66,7 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", + "husky": "^9.1.6", "jest": "^29.7.0", "prettier": "^3.2.4", "ts-jest": "^29.1.1", diff --git a/src/types.ts b/src/types.ts index e9dda930..1c05d878 100644 --- a/src/types.ts +++ b/src/types.ts @@ -28,18 +28,6 @@ type Functions = { [key: string]: IacFunction; }; -type Gateway = { - type: string; - name: string; - description: string; - protocol: string; - method: string; -}; - -type Gateways = { - [key: string]: Gateway; -}; - type Event = { type: string; source: string;