Skip to content

Commit 5ba20da

Browse files
authored
chore: use conventional commits (#221)
* chore: auto-changelog => conventional-changelog (fixes #220) * docs: add conventional commits badge * chore: add commitlint * chore: add husky commit-msg * chore: npm scripts generate-release => release * chore: fix commit msg * fix: angular to conventionalcommits
1 parent f7ab651 commit 5ba20da

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit ""

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 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)
1+
# 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)
22

33
An ESLint plugin for linting ESLint plugins. Rules written in CJS, ESM, and TypeScript are all supported.
44

commitlint.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = { extends: ['@commitlint/config-conventional'] };

package.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:docs": "markdownlint '**/*.md'",
1111
"lint:js": "eslint .",
1212
"generate-readme-table": "node build/generate-readme-table.js",
13-
"generate-release": "release-it",
13+
"release": "release-it",
1414
"test": "nyc --all --check-coverage --include lib mocha tests --recursive"
1515
},
1616
"files": [
@@ -40,6 +40,9 @@
4040
"statements": 99
4141
},
4242
"devDependencies": {
43+
"@commitlint/cli": "^13.2.1",
44+
"@commitlint/config-conventional": "^13.2.0",
45+
"@release-it/conventional-changelog": "^3.3.0",
4346
"@typescript-eslint/parser": "^5.0.0",
4447
"auto-changelog": "^2.3.0",
4548
"chai": "^4.1.0",
@@ -52,6 +55,7 @@
5255
"eslint-plugin-unicorn": "^37.0.0",
5356
"eslint-scope": "^6.0.0",
5457
"espree": "^9.0.0",
58+
"husky": "^7.0.2",
5559
"lodash": "^4.17.2",
5660
"markdownlint-cli": "^0.28.1",
5761
"mocha": "^9.1.2",
@@ -67,8 +71,14 @@
6771
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
6872
},
6973
"release-it": {
70-
"hooks": {
71-
"after:bump": "auto-changelog -p"
74+
"git": {
75+
"commitMessage": "chore: release v${version}"
76+
},
77+
"plugins": {
78+
"@release-it/conventional-changelog": {
79+
"preset": "conventionalcommits",
80+
"infile": "CHANGELOG.md"
81+
}
7282
},
7383
"github": {
7484
"release": true

0 commit comments

Comments
 (0)