2.5.15 • Published 3 years ago

@dcm/commitlint-config v2.5.15

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

@dcm/commitlint-config

Commitizen Friendly Version Weekly Downloads

Shareable commitlint and @commitizen config of @dcmhub.

Installation

Use npx to install peerdeps automatically or install peerDependencies with npm/yarn manually.

# Install with npx
$ npx install-peerdeps --dev @dcm/commitlint-config

# Install with NPM
$ npm i -D @commitlint/cli @commitlint/prompt commitizen @dcm/commitlint-config

# Install with yarn
$ yarn add --dev @commitlint/cli @commitlint/prompt commitizen @dcm/commitlint-config

Usage

After installation, you have two methods to use this configuration.

The first method

Create a commitlint.config.js or .commitlintrc.js file in your project root, then require this package in the file.

module.exports = {
  extends: ['@dcm'], // => @dcm/commitlint-config
};

You can also overwrite any rules in this configuration.

module.exports = {
  extends: ['@dcm'], // => @dcm/commitlint-config
  rules: {
    'header-max-length': [0, 'always', 72],
  },
};

The second method

If your project have a package.json file, add "commitlint" key in your this file.

{
  "name": "my-cool-project-name",
  "version": "1.0.0",
  "commitlint": {
    "extends": ["@dcm"]
  }
}

With lerna

If you want to use with lerna monorepo, you should extend from lerna or lerna-emoji version preset.

module.exports = {
  extends: ['@dcm/commitlint-config/lerna'],
  // extends: ['@dcm/commitlint-config/lerna-emoji'],
};

With git emoji 🚀

If you want to add gitmojis in your commit message, you should extend from emoji version preset.

module.exports = {
  extends: ['@dcm/commitlint-config/emoji'],
};

Use with commitizen

Add a "commit" scripts in the package.json, add @commitlint/prompt as commitizen's adapter, now you can use npm run commit or yarn commit to replace the git commit command.

{
  "name": "my-cool-project-name",
  "version": "1.0.0",
  "commitlint": {
    "extends": ["@dcm"]
  },
  "scripts": {
    "commit": "git-cz"
  }
}

Use with husky

With husky, you can add a commit-msg hook to link message before real commit.

{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

License

MIT

2.5.15

3 years ago

2.5.8

3 years ago

2.5.6

3 years ago

2.5.7

3 years ago

2.5.2

3 years ago

2.5.0

3 years ago

2.4.15

3 years ago

2.4.13

4 years ago

2.4.11

4 years ago

2.4.9

4 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.1.2

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago