diff --git a/.husky/commit-msg b/.husky/commit-msg index 6057b40..f2b14e2 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,6 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npx commitlint --edit "$1" \ No newline at end of file +npx commitlint --edit "$1" + + diff --git a/commitlint.config.js b/commitlint.config.js index 8e0692d..891deb2 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,11 +1,16 @@ module.exports = { extends: ['@commitlint/config-conventional'], // Add any custom rules here if needed - // rules: { - // 'scope-enum': [ - // 2, - // 'always', - // ['api', 'ui', 'docs', 'build', 'release', 'deps', 'config'] - // ], - // }, -}; \ No newline at end of file + rules: { + // Ensure the commit type is never empty + 'type-empty': [2, 'never'], + // Ensure the commit subject is never empty + 'subject-empty': [2, 'never'], + // Example of a custom rule for scope enumeration (uncomment and modify if needed) + // 'scope-enum': [ + // 2, + // 'always', + // ['api', 'ui', 'docs', 'build', 'release', 'deps', 'config'] + // ], + }, +}; diff --git a/package-lock.json b/package-lock.json index c5640b5..5b19661 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "js-quality-starter", + "name": "js-quality-starter-with-release", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "js-quality-starter", + "name": "js-quality-starter-with-release", "version": "1.0.0", "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index 0efb09d..1cd3de7 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,6 @@ "audit:ci": "npm audit --production", "prepare": "husky install" }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, "keywords": [ "javascript", "template", @@ -36,6 +31,8 @@ "node": ">=18.0.0" }, "devDependencies": { + "@commitlint/cli": "^19.2.1", + "@commitlint/config-conventional": "^19.1.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-jest": "^28.2.0",