@commitlint/config-conventional

Shareable commitlint config enforcing conventional commits

Lint your conventional commits

@commitlint/config-conventional

Shareable commitlintconfig enforcing conventional commits. Use with @commitlint/cliand @commitlint/prompt-cli.

:warning:
IMPORTANTThis is a direct replacement for @commitlint/config-angularprior to version 4. config-angulardiverged from the conventional commit convention as of version 5. See #146for details.

Getting started

npm install --save-dev @commitlint/config-conventional @commitlint/cli
echo "module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js

Rules

Problems

The following rules are considered problems for @commitlint/config-conventionaland will yield a non-zero exit code when not met.

Consult docs/rulesfor a list of available rules.

type-enum

  • condition: typeis found in value

  • rule: always

  • value

    [
      'build',
      'ci',
      'chore',
      'docs',
      'feat',
      'fix',
      'perf',
      'refactor',
      'revert',
      'style',
      'test'
    ]
echo "foo: some message" # fails
echo "fix: some message" # passes

type-case

  • description: typeis in case value
  • rule: always
  • value
    'lowerCase'
echo "FIX: some message" # fails
echo "fix: some message" # passes

type-empty

  • condition: typeis empty
  • rule: never
echo ": some message" # fails
echo "fix: some message" # passes

scope-case

  • condition: scopeis in case value
  • rule: always
    'lowerCase'
echo "fix(SCOPE): some message" # fails
echo "fix(scope): some message" # passes

subject-case

  • condition: subjectis in one of the cases ['sentence-case', 'start-case', 'pascal-case', 'upper-case']
  • rule: never
echo "fix(SCOPE): Some message" # fails
echo "fix(SCOPE): Some Message" # fails
echo "fix(SCOPE): SomeMessage" # fails
echo "fix(SCOPE): SOMEMESSAGE" # fails
echo "fix(scope): some message" # passes
echo "fix(scope): some Message" # passes

subject-empty

  • condition: subjectis empty
  • rule: never
echo "fix:" # fails
echo "fix: some message" # passes

subject-full-stop

  • condition: subjectends with value
  • rule: never
  • value
    '.'
echo "fix: some message." # fails
echo "fix: some message" # passes

header-max-length

  • condition: headerhas valueor less characters
  • rule: always
  • value
    72
echo "fix: some message that is way too long and breaks the line max-length by several characters" # fails
echo "fix: some message" # passes

HomePage

https://github.com/conventional-changelog/commitlint#readme

Repository

https+https://github.com/conventional-changelog/commitlint


上一篇:sao
下一篇:@dmail/shared-config

相关推荐

  • 配置vue.config.js 处理static文件夹下的静态文件

    最近开发过程中遇到个小需求,需要根据需求动态配置一些静态数据,但我不想直接把这个静态文件引入进来,build时就会把数据打包到js文件中,造成js文件很大;呃呃。。。。

    2 个月前
  • 跨域编辑器的编码习惯editorConfig

    编辑器就是生产力,符合个人编程习惯和风格的编辑器能给开发带来轻松愉快的心情和生产力。前端开发中越来越多东西需要通过配置文件来进行配置,现在编辑器也使用了这一方法。 意义 存在的目的是项目代码在不...

    2 年前
  • 解决tsconfig.json配置paths, 却依然报错can't find module?

    NodeJs程序中若使用typescript经常会遇到一个问题, 即明明在tsconfig.json里配置了paths映射,为啥import使用路径别名,例如@test/a.ts时,会报错can't ...

    3 个月前
  • 理解webpack.config.js的四个核心概念

    webpack是需要自己编写自己需要的一个配置对象,取决你如何使用webpack,下面指定了所有的可用的配置选项。 参考文档:https://doc.webpackchina.org...(https...

    3 年前
  • 没有webpack.config.js如何配置less ??安装配置less必看

    首先我们最新创建的项目;无论是vue或者react项目,你都找不到webpack.config.js,甚至没有原来的build文件夹,那我们如何配置less或者jq这种插件呢?接下来进入正题 配置le...

    5 个月前
  • 微信公众号wx.config权限通不过config:invalid signature,显示无效签名

    一、vue引入weixinjssdk(yarn或npm) 二、大家可以尝试下官方的案例http://demo.open.weixin.qq.co...(http://demo.open.weix...

    1 年前
  • 如何配置Web.config允许任何长度的要求

    djvsomebloodyfool(https://stackoverflow.com/users/832052/djv)提出了一个问题:How to configure the web.config...

    2 年前
  • 基于config-component转向面向数据的编程?

    面向数据编程 面向数据编程是什么样的体验? 其实是数据驱动式编程更向前走一步,我们知道现在MVVM框架,像React、vue、Angular这些给前端带来了很大的进步,更优雅的工程化体系结构,...

    1 年前
  • 利用react-router4的react-router-config做路由鉴权

    一、reactrouterconfig 是一个帮助我们配置静态路由的小助手。 其源码就是一个高阶函数 利用一个map函数生成静态路由 //router.js 假设这是我们设置的路由数组(这种写法...

    2 年前
  • 使用commitlint规范git提交

    在我们开始一个项目的时候通常会用eslint去规范js代码。我们还可以用一些命令行工具去规范我们的git提交信息以及在每次git操作过程中执行一些测试,最快可以依据git提交信息生成CHANGELOG...

    2 年前

官方社区

扫码加入 JavaScript 社区