11
0
Fork 0
mirror of https://github.com/wagoid/commitlint-github-action.git synced 2026-04-04 16:56:52 +00:00

fix: rollback update of commitlint to support configs that use commonjs

This commit is contained in:
Wagner Santos 2024-03-28 16:29:46 -03:00
parent e15adf3661
commit 06143b235b
17 changed files with 3576 additions and 5435 deletions

View file

@ -1,28 +0,0 @@
/* 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,
],
},
}