@walrus/plugin-commitlint

Lint your commit messages

Usage no npm install needed!

<script type="module">
  import walrusPluginCommitlint from 'https://cdn.skypack.dev/@walrus/plugin-commitlint';
</script>

README

@walrus/plugin-commitlint

commitlint 封装

🏗 安装

// npm
npm install --save --dev @walrus/cli @walrus/plugin-commitlint

// yarn
yarn add --dev @walrus/cli @walrus/plugin-commitlint

建议直接安装 @walrus/preset-lint

🛡命令

# 检查commit message
walrus commitlint

🌟 commitlint 配置

内置配置请查看 commitlint.config.js

📝 配置

注意: 优先级 Flags >> config commitlint >> config lint

可在 .walrusrc.ts、walrus.config.ts添加如下配置

import { Config } from '@walrus/types';

const config: Config = {
  // ...
  commitlint: {
    edit: string;
    from: string;
    to: string;
    env: string;
    verbose: boolean;
    config?: string;
  }
};

export default config;

⚡ Flags

--edit

从指定文件读取最后的提交消息,或回退到./.git/COMMIT_EDITMSG