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.
39
+
40
+
> **_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.
41
+
42
+
```js
43
+
module.exports= {
44
+
extends: ['@commitlint/config-conventional'],
45
+
plugins: ['commitlint-plugin-function-rules'],
46
+
rules: [
47
+
'header-max-length': [0], // level: disabled
48
+
'function-rules/header-max-length': [
49
+
2, // level: error
50
+
'always',
51
+
(parsed) => {
52
+
if (parsed.type==='chore'&&parsed.header.length<20) {
53
+
return [true];
54
+
}
55
+
return [false, 'chore header must not be longer than 120 characters'];
| <ahref="https://www.npmjs.com/package/commitlint-plugin-function-rules"><imgalt="npm version"src="https://img.shields.io/npm/v/commitlint-plugin-function-rules?style=flat-square"></a> | npm version | npm |
64
+
## Contributing
65
+
66
+
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.
67
+
68
+
Please give this project a star ⭐ if you like it and consider becoming a [sponsor](https://github.com/sponsors/jdbruijn) to support this project.
69
+
70
+
Refer to the [contributing guide](https://github.com/vidavidorra/.github/CONTRIBUTING.md) detailed information about other contributions, like pull requests.
Please refer to the [Security Policy on GitHub](https://github.com/vidavidorra/commitlint-plugin-function-rules/security/) for the security policy.
24
81
25
82
## License
26
83
@@ -47,3 +104,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
47
104
The full text of the license is available in the [LICENSE](LICENSE.md) file in this repository and [online](https://www.gnu.org/licenses/gpl.html).
0 commit comments