The root package.json sets "type": "module", so Node treated commitlint.config.js as ESM and threw "module is not defined" when loading the CommonJS module.exports — the config never applied. Switch to `export default` so the conventional filename stays valid and the rules are actually enforced by the CLI.
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
export default {
|
|
extends: ['@commitlint/config-conventional'],
|
|
rules: {
|
|
// Enforce conventional commit types
|
|
'type-enum': [
|
|
2,
|
|
'always',
|
|
[
|
|
'feat', // New feature
|
|
'fix', // Bug fix
|
|
'docs', // Documentation changes
|
|
'style', // Code style changes (formatting, etc.)
|
|
'refactor', // Code refactoring
|
|
'perf', // Performance improvements
|
|
'test', // Adding or updating tests
|
|
'chore', // Maintenance tasks
|
|
'revert', // Revert a previous commit
|
|
'build', // Build system changes
|
|
'ci', // CI/CD changes
|
|
],
|
|
],
|
|
// Scope is optional
|
|
'scope-empty': [1, 'never'],
|
|
// Subject must not be empty
|
|
'subject-empty': [2, 'never'],
|
|
// Subject must be in sentence case
|
|
'subject-case': [0],
|
|
// Subject line length
|
|
'subject-max-length': [2, 'always', 72],
|
|
// Body line length
|
|
'body-max-line-length': [2, 'always', 100],
|
|
// Footer line length
|
|
'footer-max-line-length': [2, 'always', 100],
|
|
},
|
|
};
|