You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use this plugin in your project's commitlint configuration by specifying it as item in the `plugins` array. All rules have same name as the [commitlint][commitlint]rules, but with the `function-rules` prefix.
34
+
Use this plugin in your project's [**commitlint**][commitlint] configuration by specifying it as item in the `plugins` array. All rules have same name as rules that are [available in **commitlint**][rules], but with the `function-rules` prefix. The example `commitlint.config.js`, or `commitlint.config.cjs` if the package is an ES module, shows the usage of a function rule.
40
35
41
-
> **_Note:_** The available rules are the same as in [commitlint][commitlint], so it is recommended to disable the [commitlint][commitlint] rule when specifying a function rule to avoid undefined behaviour.
36
+
> **Note** The available rules are the same as in [**commitlint**][commitlint], so it is recommended to disable the [**commitlint**][commitlint] rule when specifying a function rule to avoid undefined behaviour.
42
37
43
38
```js
44
39
module.exports= {
@@ -50,31 +45,26 @@ module.exports = {
50
45
2, // level: error
51
46
'always',
52
47
(parsed) => {
53
-
if (parsed.type==='chore'&&parsed.header.length<20) {
48
+
// Allow longer headers for commits with "deps" scope.
49
+
if (parsed.scope==='deps'&&parsed.header.length<=200) {
54
50
return [true];
55
51
}
56
-
return [false, 'chore header must not be longer than 120 characters'];
52
+
return [false, 'deps header must not be longer than 200 characters'];
57
53
},
58
54
],
59
55
},
60
56
};
61
57
```
62
58
63
-
## Documentation
64
-
65
59
## Contributing
66
60
67
-
Please [create an issue](https://github.com/vidavidorra/commitlint-plugin-function-rules/issues/new/choose) if you have a bug report, feature proposal or question that does not yet exist.
68
-
69
-
Please give this project a star ⭐ if you like it and consider becoming a [sponsor](https://github.com/sponsors/jdbruijn) to support this project.
61
+
Please [create an issue](https://github.com/vidavidorra/commitlint-plugin-function-rules/issues/new/choose) if you have a bug report or feature proposal, or [create a discussion](https://github.com/vidavidorra/commitlint-plugin-function-rules/discussions) if you have a question. If you like this project, please consider giving it a star ⭐ and/or become a [sponsor](https://github.com/sponsors/jdbruijn) to support my work.
70
62
71
63
Refer to the [contributing guide](https://github.com/vidavidorra/.github/blob/main/CONTRIBUTING.md) detailed information about other contributions, like pull requests.
0 commit comments