From b58d0de71746ccda5a632f04337eee6b0d1d6b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 17:51:37 +0800 Subject: [PATCH 1/7] chore: auto-changelog => conventional-changelog (fixes #220) --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b3783e58..4aa962de 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "statements": 99 }, "devDependencies": { + "@release-it/conventional-changelog": "^3.3.0", "@typescript-eslint/parser": "^5.0.0", "auto-changelog": "^2.3.0", "chai": "^4.1.0", @@ -67,8 +68,11 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "release-it": { - "hooks": { - "after:bump": "auto-changelog -p" + "plugins": { + "@release-it/conventional-changelog": { + "preset": "angular", + "infile": "CHANGELOG.md" + } }, "github": { "release": true From efa1c03376caa3cf9e0d24b53dbbc730ca60538e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 17:53:00 +0800 Subject: [PATCH 2/7] docs: add conventional commits badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 173a85de97cb781dea286d06448203e64eebe3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 17:56:34 +0800 Subject: [PATCH 3/7] chore: add commitlint --- commitlint.config.js | 1 + package.json | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 commitlint.config.js diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..3347cb96 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = {extends: ['@commitlint/config-conventional']}; diff --git a/package.json b/package.json index 4aa962de..432c8ab7 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,8 @@ "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", From d76f26574d064e9b9c542358d0db76b41c34cdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 17:57:10 +0800 Subject: [PATCH 4/7] chore: add husky commit-msg --- .husky/commit-msg | 4 ++++ commitlint.config.js | 4 +++- package.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 .husky/commit-msg 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/commitlint.config.js b/commitlint.config.js index 3347cb96..0cf61d7e 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1,3 @@ -module.exports = {extends: ['@commitlint/config-conventional']}; +'use strict'; + +module.exports = { extends: ['@commitlint/config-conventional'] }; diff --git a/package.json b/package.json index 432c8ab7..927cd92a 100644 --- a/package.json +++ b/package.json @@ -55,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", From a91f54618e505050955e3c504a80ea4eb3a5a340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 18:01:05 +0800 Subject: [PATCH 5/7] chore: npm scripts generate-release => release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 927cd92a..5b8fa039 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": [ From 5864f5984f4588e582eb3cf9640a340bc8376cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 18 Oct 2021 18:08:04 +0800 Subject: [PATCH 6/7] chore: fix commit msg --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 5b8fa039..7c1d099b 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,9 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "release-it": { + "git": { + "commitMessage": "chore: release v${version}" + }, "plugins": { "@release-it/conventional-changelog": { "preset": "angular", From dbe05184ed69762de995769878cc46e33cb86a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Tue, 19 Oct 2021 10:27:18 +0800 Subject: [PATCH 7/7] fix: angular to conventionalcommits --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c1d099b..f843befa 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ }, "plugins": { "@release-it/conventional-changelog": { - "preset": "angular", + "preset": "conventionalcommits", "infile": "CHANGELOG.md" } },