Skip to content

Instantly share code, notes, and snippets.

@jlukic
Created March 12, 2025 13:26
Show Gist options
  • Save jlukic/e0f085546ad0cb92795e32594d849703 to your computer and use it in GitHub Desktop.
Save jlukic/e0f085546ad0cb92795e32594d849703 to your computer and use it in GitHub Desktop.
/**
* Commitlint configuration based on best practices from major OS projects.
*/
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [2, 'always', 100],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'release',
'revert',
'style',
'test',
// Additions from projects like Jest & Tailwind CSS for more specific contexts
'improvement', // Jest
'internal', // Jest
'website', // Jest
'dependencies', // Jest/Tailwind CSS - could be 'deps' as in conventional-changelog
'example', // Astro, Next.js, Svelte
'types', // Astro, Svelte, Vue, Next.js - could be 'typings'
'workflow', // Tailwind CSS, Next.js - could be 'workflows' or 'actions'
'content', // Astro - for content-heavy projects
],
],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'scope-case': [2, 'always', 'lower-case'],
'scope-empty': [2, 'allow'], // Allow no scope, but encourage when relevant
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'], // No dot at the end of subject
'subject-case': [2, 'always', 'lower-case'],
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [2, 'always'],
},
helpUrl:
'https://www.conventionalcommits.org/', // Link to Conventional Commits spec for contributors
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment