[–] [S] 2 points 1 year ago

After a bit of experimentation, I've managed to find a cleaner solution to enforcing the ticket number in the subject:

module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    // Enforce scope to match JIRA ticket format like PER-123
    'jira-ticket-rule': [2, 'always'],
    'subject-case': [0],
  },
  plugins: [
    {
      rules: {
        'jira-ticket-rule': ({ subject }) => {
          return [
             subject && subject.match(/[A-Z]+-\d+/),
            'Your subject should contain a JIRA ticket eg PER-123',
          ];
        },
      },
    },
  ],
};
  • source
  • [–] 1 point 1 year ago (1 child)

    To clarify, when you say freelancer, do you mean on a part-time basis? Or do you mean having a contract and working on a full-time basis for that client? Also, where are you based? I'm happy to give advice as a UK based contractor, who does a tiny bit of freelance work

  • source
  • view more: ‹ prev next ›