Skip to content

Commit b3007ee

Browse files
authored
docs: use RuleConfigSeverity in config docs (#3521)
There is the following enum for checking rule config severity in `commitlint/@commitlint/types/src/rules` that we should use in typescript plugins instead of 0, 1, and 2 numbers to make the code clearer. ``` export enum RuleConfigSeverity { Disabled = 0, Warning = 1, Error = 2, } ```
1 parent 00178db commit b3007ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: docs/reference-configuration.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ module.exports = Configuration;
7272

7373
```ts
7474
import type {UserConfig} from '@commitlint/types';
75+
import { RuleConfigSeverity } from "@commitlint/types";
7576

7677
const Configuration: UserConfig = {
7778
/*
@@ -93,7 +94,7 @@ const Configuration: UserConfig = {
9394
* Any rules defined here will override rules from @commitlint/config-conventional
9495
*/
9596
rules: {
96-
'type-enum': [2, 'always', ['foo']],
97+
'type-enum': [RuleConfigSeverity.Error, 'always', ['foo']],
9798
},
9899
/*
99100
* Functions that return true if commitlint should ignore the given message.

0 commit comments

Comments
 (0)