From 07c544c7852fb05da14e84ddbc9d51b71a9e7aee Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Thu, 25 Jan 2024 09:33:59 +0530 Subject: [PATCH] chore: add husky related deps & scripts, pass jest with no tests, add commitlint config Signed-off-by: Sai Sankeerth --- commitlint.config.js | 6 ++++++ package-lock.json | 50 +++++++++++++++++++++++++++++++++++++++++++- package.json | 7 +++++-- 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 commitlint.config.js diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..8ade7fe --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': () => [2, 'always', ['fix', 'feat', 'chore', 'refactor', 'docs', 'test']], + }, +}; diff --git a/package-lock.json b/package-lock.json index 07fd406..702955a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,10 +20,12 @@ "standard-version": "^9.5.0" }, "devDependencies": { + "@commitlint/config-conventional": "^18.5.0", "eslint": "^8.49.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-prettier": "^5.1.3", + "husky": "^8.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "nodemon": "^2.0.15", @@ -716,6 +718,30 @@ "node": ">=12" } }, + "node_modules/@commitlint/config-conventional": { + "version": "18.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-18.5.0.tgz", + "integrity": "sha512-XGmU4u3Z7bCn0H0nTEG9LUn6hMDUIPP4P6dun7PKFhtnt/wwiKAqmPj+QRmFiqWjkOWcmrh7w7xRiDL32cWS5g==", + "dev": true, + "dependencies": { + "conventional-changelog-conventionalcommits": "^7.0.2" + }, + "engines": { + "node": ">=v18" + } + }, + "node_modules/@commitlint/config-conventional/node_modules/conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@commitlint/config-validator": { "version": "17.6.7", "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.6.7.tgz", @@ -5669,6 +5695,7 @@ "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" }, @@ -10994,6 +11021,26 @@ } } }, + "@commitlint/config-conventional": { + "version": "18.5.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-18.5.0.tgz", + "integrity": "sha512-XGmU4u3Z7bCn0H0nTEG9LUn6hMDUIPP4P6dun7PKFhtnt/wwiKAqmPj+QRmFiqWjkOWcmrh7w7xRiDL32cWS5g==", + "dev": true, + "requires": { + "conventional-changelog-conventionalcommits": "^7.0.2" + }, + "dependencies": { + "conventional-changelog-conventionalcommits": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-7.0.2.tgz", + "integrity": "sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==", + "dev": true, + "requires": { + "compare-func": "^2.0.0" + } + } + } + }, "@commitlint/config-validator": { "version": "17.6.7", "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-17.6.7.tgz", @@ -14745,7 +14792,8 @@ "husky": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==" + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true }, "iconv-lite": { "version": "0.6.3", diff --git a/package.json b/package.json index 96638bb..d726ece 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "release": "npx standard-version", "release:github": "DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular --config github-release.config.js", "commit-msg": "commitlint --edit", - "test": "jest", - "pre-commit": "npx lint-staged && npm run test" + "test": "jest --passWithNoTests", + "pre-commit": "npx lint-staged && npm run test", + "prepare": "husky install" }, "lint-staged": { "*.{js,ts}": "eslint --cache --fix", @@ -30,10 +31,12 @@ "standard-version": "^9.5.0" }, "devDependencies": { + "@commitlint/config-conventional": "^18.5.0", "eslint": "^8.49.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-prettier": "^5.1.3", + "husky": "^8.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "nodemon": "^2.0.15",