From dcd6816b3ecf044180a3ac0981bc93a35783a758 Mon Sep 17 00:00:00 2001 From: escapedcat Date: Sun, 10 Mar 2019 16:43:11 +0800 Subject: [PATCH] docs: add new section #237 --- docs/_sidebar.md | 1 + docs/reference-examples.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 docs/reference-examples.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 9fb4a0d628..72294d1cfb 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -13,3 +13,4 @@ * [Configuration](reference-configuration.md) * [Rules](reference-rules.md) * [API](reference-api.md) + * [Examples](reference-examples.md) diff --git a/docs/reference-examples.md b/docs/reference-examples.md new file mode 100644 index 0000000000..cd6aae28f1 --- /dev/null +++ b/docs/reference-examples.md @@ -0,0 +1,23 @@ +# Examples + +These examples show common usages of how commitlint can be configured. + + +## Validate for issue/ticket numbers + +In your `package.json` add: + +```js + commitlint: { + 'rules': { + 'references-empty': [2, 'never'], + }, + parserPreset: { + parserOpts: { + issuePrefixes: ['PROJ-'] + } + }, + } +``` + +