conventional-changelog / conventional-changelog/commitlint

Improve documentation "Working with Plugins"

Open
#699 1 comment 3 reactions 0 assignees View on GitHub
documentation help wanted
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

Description

I would like to write a plugin for commitlint.

Currently, the [Working with Plugins](https://commitlint.js.org/#/reference-plugins?id=working-with-plugins) page shows the following example:

```js
module.exports = {
rules: {
"dollar-sign": function(parsed, when, value) {
// rule implementation ...
}
}
};
```

The problem is that this just leaves me puzzling what values `parsed`, `when` and `value` will take at runtime. There's no single word on the semantics of a plugin, what a "rule implementation" is, and so forth.

Please describe the interface better, by stating the contract of the sketched function. Explain what the three parameters are used for, and equally important, what the function should return and how the return value is interpreted.

In addition to that, provide an example plugin. For example, fill out the body of the function above by checking that there is at least one dollar symbol in the header of the commit message and that at least two lines of the body of the commit message start with a dollar. Of course this is a totally made-up example, but it would show how to interpret the parameters.

Contributor guide

Open the contributing guide

Research direction

Start with the Working with Plugins page linked in the issue and inspect the existing JavaScript example. Document the contract for parsed, when, and value, explain how the rule return value is interpreted, and add the requested dollar-sign example covering the commit header and body.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.