Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore the subject-case?

Tags:

commitlint

I am trying to ignore the case in commitlint, but unfortunately there is not enough documentation how to ignore a specific rule.

I tried to add and allow all cases always in the subject-case rule, but this won't allow mixed sentences like (sentence-case and camel-case in one subject)

git commit -m "feat(auth): New userModel"

My configuration file:

import type { UserConfig } from '@commitlint/types';

const Configuration: UserConfig = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'subject-case': [
      2,
      'always',
      [
        'lower-case',
        'upper-case',
        'camel-case',
        'kebab-case',
        'pascal-case',
        'sentence-case',
        'snake-case',
        'start-case',
      ]
    ]
  }
};

module.exports = Configuration;

like image 350
Hugo B. Avatar asked Oct 15 '25 13:10

Hugo B.


1 Answers

Keep the config as below,

const Configuration: UserConfig = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'subject-case': [
      2,
      'never',
      [
        'upper-case',
        'pascal-case',
        'start-case',
      ]
    ]
  }
};

like image 127
Saravanan Rajaraman Avatar answered Oct 19 '25 14:10

Saravanan Rajaraman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!