From d33e4adce3a70ca9c641dc06e6da60cad523a890 Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sun, 13 Feb 2022 10:51:54 +0530 Subject: [PATCH 01/10] added husky precommit hook --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ 10 | 15 +++++++++++++++ package.json | 12 ++++++------ 4 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .husky/.gitignore create mode 100644 .husky/pre-commit create mode 100644 10 diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..36af2198 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx lint-staged diff --git a/10 b/10 new file mode 100644 index 00000000..bc838940 --- /dev/null +++ b/10 @@ -0,0 +1,15 @@ + +up to date, audited 2334 packages in 20s + +123 packages are looking for funding + run `npm fund` for details + +31 vulnerabilities (19 moderate, 12 high) + +To address issues that do not require attention, run: + npm audit fix + +To address all issues (including breaking changes), run: + npm audit fix --force + +Run `npm audit` for details. diff --git a/package.json b/package.json index ef407561..2cbab8ee 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "acceptance-test": "lerna exec --scope @laconia/acceptance-test npm run test", "posttest": "npm run test:types && npm run test:jslint && npm run test:packagelint", "publish:coverage": "cat ./coverage/lcov.info | coveralls", - "commit": "npx git-cz" + "commit": "npx git-cz", + "prepare": "husky install" }, "repository": { "type": "git", @@ -59,6 +60,7 @@ "jest": "^26.0.1", "jest-extended": "^0.11.1", "lerna": "^4.0.0", + "lint-staged": "^12.3.3", "lodash": "^4.17.5", "npm-package-json-lint": "^5.1.0", "prettier": "^1.16.4", @@ -88,14 +90,12 @@ "jest-extended" ] }, - "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } + }, + "lint-staged": { + "*.js": "eslint --cache --fix" } } From 0e1c0b285417ae350dc39e014a6c4bdde2f4a3ae Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Mon, 14 Feb 2022 00:50:55 +0530 Subject: [PATCH 02/10] removed 10 --- 10 | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 10 diff --git a/10 b/10 deleted file mode 100644 index bc838940..00000000 --- a/10 +++ /dev/null @@ -1,15 +0,0 @@ - -up to date, audited 2334 packages in 20s - -123 packages are looking for funding - run `npm fund` for details - -31 vulnerabilities (19 moderate, 12 high) - -To address issues that do not require attention, run: - npm audit fix - -To address all issues (including breaking changes), run: - npm audit fix --force - -Run `npm audit` for details. From d35429bc448f303c9b830f1fbbf55419a5c57cf7 Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Mon, 14 Feb 2022 10:19:19 +0530 Subject: [PATCH 03/10] run chmod command --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af2198..c37466e2 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged +npx lint-staged \ No newline at end of file From 66789348804aa55255a91984af31acf563edfd10 Mon Sep 17 00:00:00 2001 From: Samriddhi Date: Mon, 14 Feb 2022 23:09:19 +0530 Subject: [PATCH 04/10] updated pre-commit with test --- .husky/pre-commit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index c37466e2..598cd889 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged \ No newline at end of file +npx lint-staged +npm test From a1db94f19d2d2d14d83aff5dc09e9885d7898a8e Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Fri, 18 Feb 2022 13:58:31 +0530 Subject: [PATCH 05/10] feat: precommit added --- .husky/.gitignore | 1 - .husky/commit-msg | 4 ++++ .husky/pre-commit | 2 -- .lintstagedrc.json | 3 +++ package.json | 9 +++++---- 5 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 .husky/.gitignore create mode 100644 .husky/commit-msg create mode 100644 .lintstagedrc.json diff --git a/.husky/.gitignore b/.husky/.gitignore deleted file mode 100644 index 31354ec1..00000000 --- a/.husky/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_ diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 00000000..7cd8dd9a --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit index 598cd889..3fb47d4c 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,3 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged -npm test diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 00000000..ab30e7de --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,3 @@ +{ + "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write"] +} \ No newline at end of file diff --git a/package.json b/package.json index 2cbab8ee..d77e2806 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "posttest": "npm run test:types && npm run test:jslint && npm run test:packagelint", "publish:coverage": "cat ./coverage/lcov.info | coveralls", "commit": "npx git-cz", - "prepare": "husky install" + "prepare": "husky install", + "pre-commit": "lint-staged" }, "repository": { "type": "git", @@ -56,14 +57,14 @@ "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", - "husky": "^7.0.1", + "husky": "^7.0.0", "jest": "^26.0.1", "jest-extended": "^0.11.1", "lerna": "^4.0.0", - "lint-staged": "^12.3.3", + "lint-staged": "^12.3.4", "lodash": "^4.17.5", "npm-package-json-lint": "^5.1.0", - "prettier": "^1.16.4", + "prettier": "^1.19.1", "typescript": "^4.0.2" }, "jest": { From 3734671977268175306b6188ff2cff6cdd687a9e Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sat, 19 Feb 2022 16:19:21 +0530 Subject: [PATCH 06/10] fix: inconsistency --- .husky/.gitignore | 1 + .husky/pre-commit | 1 + package.json | 5 ++--- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .husky/.gitignore diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit index 3fb47d4c..36af2198 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +npx lint-staged diff --git a/package.json b/package.json index d77e2806..e21dac51 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "posttest": "npm run test:types && npm run test:jslint && npm run test:packagelint", "publish:coverage": "cat ./coverage/lcov.info | coveralls", "commit": "npx git-cz", - "prepare": "husky install", - "pre-commit": "lint-staged" + "prepare": "husky install" }, "repository": { "type": "git", @@ -99,4 +98,4 @@ "lint-staged": { "*.js": "eslint --cache --fix" } -} +} \ No newline at end of file From 2679fa2f25653e66300021aa1563d54e0ffc7f3d Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sat, 19 Feb 2022 16:29:47 +0530 Subject: [PATCH 07/10] fix: inconsistency --- .lintstagedrc.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index ab30e7de..cd0dfb9a 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,5 @@ { - "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write"] + "*.{js,jsx,ts,tsx,json,css,scss,md}": [ + "prettier --write" + ] } \ No newline at end of file From 15856df06daa90a68f7b9c9dca32929bd27e13ff Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sat, 19 Feb 2022 16:38:43 +0530 Subject: [PATCH 08/10] fix: inconsistency --- .lintstagedrc.json | 3 ++- package.json | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index cd0dfb9a..3fc79c32 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,6 @@ { "*.{js,jsx,ts,tsx,json,css,scss,md}": [ - "prettier --write" + "prettier --write", + "git add" ] } \ No newline at end of file diff --git a/package.json b/package.json index e21dac51..bf869e7a 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,8 @@ } }, "lint-staged": { - "*.js": "eslint --cache --fix" + "*.{js,css,md,ts,tsx}": [ + "prettier --write" + ] } } \ No newline at end of file From 006c2e27b874c303248b493d75c1e04bbc4574b7 Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sat, 19 Feb 2022 17:00:41 +0530 Subject: [PATCH 09/10] fix: lint-check --- .husky/pre-commit | 2 +- .lintstagedrc.json | 8 +++++--- package.json | 10 +++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 36af2198..d0612ad3 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -npx lint-staged +npm run pre-commit diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 3fc79c32..788bb3a4 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,6 +1,8 @@ { - "*.{js,jsx,ts,tsx,json,css,scss,md}": [ - "prettier --write", - "git add" + "src/**/*.+(js|json|ts|tsx)": [ + "eslint" + ], + "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ + "prettier --write" ] } \ No newline at end of file diff --git a/package.json b/package.json index bf869e7a..f271b07a 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "posttest": "npm run test:types && npm run test:jslint && npm run test:packagelint", "publish:coverage": "cat ./coverage/lcov.info | coveralls", "commit": "npx git-cz", - "prepare": "husky install" + "prepare": "husky install", + "pre-commit": "lint-staged" }, "repository": { "type": "git", @@ -56,7 +57,7 @@ "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", - "husky": "^7.0.0", + "husky": "^6.0.0", "jest": "^26.0.1", "jest-extended": "^0.11.1", "lerna": "^4.0.0", @@ -94,10 +95,5 @@ "commitizen": { "path": "./node_modules/cz-conventional-changelog" } - }, - "lint-staged": { - "*.{js,css,md,ts,tsx}": [ - "prettier --write" - ] } } \ No newline at end of file From 34dede15e17f035dc9bad8756448735a6830719b Mon Sep 17 00:00:00 2001 From: Samridhi-98 Date: Sat, 19 Feb 2022 19:02:43 +0530 Subject: [PATCH 10/10] fix: lint-check --- .lintstagedrc.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 788bb3a4..25a530ae 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,8 +1,4 @@ { - "src/**/*.+(js|json|ts|tsx)": [ - "eslint" - ], - "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ - "prettier --write" - ] -} \ No newline at end of file + "*.+(js|json|ts|tsx)": ["eslint"], + "*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write"] +}