diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..fe4c17a2 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit "" diff --git a/README.md b/README.md index dbeee95a..1fc0d131 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# eslint-plugin-eslint-plugin ![CI](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/eslint-plugin-eslint-plugin.svg?style=flat)](https://npmjs.org/package/eslint-plugin-eslint-plugin) +# eslint-plugin-eslint-plugin ![CI](https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/eslint-plugin-eslint-plugin.svg?style=flat)](https://npmjs.org/package/eslint-plugin-eslint-plugin) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) An ESLint plugin for linting ESLint plugins. Rules written in CJS, ESM, and TypeScript are all supported. diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..0cf61d7e --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/package.json b/package.json index b3783e58..f843befa 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint:docs": "markdownlint '**/*.md'", "lint:js": "eslint .", "generate-readme-table": "node build/generate-readme-table.js", - "generate-release": "release-it", + "release": "release-it", "test": "nyc --all --check-coverage --include lib mocha tests --recursive" }, "files": [ @@ -40,6 +40,9 @@ "statements": 99 }, "devDependencies": { + "@commitlint/cli": "^13.2.1", + "@commitlint/config-conventional": "^13.2.0", + "@release-it/conventional-changelog": "^3.3.0", "@typescript-eslint/parser": "^5.0.0", "auto-changelog": "^2.3.0", "chai": "^4.1.0", @@ -52,6 +55,7 @@ "eslint-plugin-unicorn": "^37.0.0", "eslint-scope": "^6.0.0", "espree": "^9.0.0", + "husky": "^7.0.2", "lodash": "^4.17.2", "markdownlint-cli": "^0.28.1", "mocha": "^9.1.2", @@ -67,8 +71,14 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "release-it": { - "hooks": { - "after:bump": "auto-changelog -p" + "git": { + "commitMessage": "chore: release v${version}" + }, + "plugins": { + "@release-it/conventional-changelog": { + "preset": "conventionalcommits", + "infile": "CHANGELOG.md" + } }, "github": { "release": true