mirror of
https://github.com/wagoid/commitlint-github-action.git
synced 2026-04-03 08:16:54 +00:00
feat: upgrade to commitlint v19
BREAKING CHANGE: `commitlint.config.js` is not supported anymore, please use `.mjs` extension
This commit is contained in:
parent
9763196e10
commit
732f0ad7d5
24 changed files with 2431 additions and 13465 deletions
28
commitlint.config.mjs
Normal file
28
commitlint.config.mjs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import { maxLineLength } from '@commitlint/ensure'
|
||||
|
||||
const bodyMaxLineLength = 100
|
||||
|
||||
const validateBodyMaxLengthIgnoringDeps = (parsedCommit) => {
|
||||
const { type, scope, body } = parsedCommit
|
||||
const isDepsCommit =
|
||||
type === 'chore' && (scope === 'deps' || scope === 'deps-dev')
|
||||
|
||||
return [
|
||||
isDepsCommit || !body || maxLineLength(body, bodyMaxLineLength),
|
||||
`body's lines must not be longer than ${bodyMaxLineLength}`,
|
||||
]
|
||||
}
|
||||
|
||||
export default {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
plugins: ['commitlint-plugin-function-rules'],
|
||||
rules: {
|
||||
'body-max-line-length': [0],
|
||||
'function-rules/body-max-line-length': [
|
||||
2,
|
||||
'always',
|
||||
validateBodyMaxLengthIgnoringDeps,
|
||||
],
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue