From fc3d4bdc25622370c781c8c584772f9e07985972 Mon Sep 17 00:00:00 2001 From: realmarv Date: Sat, 4 Feb 2023 13:16:27 +0330 Subject: [PATCH] docs: use RuleConfigSeverity in config docs 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, } ``` --- docs/reference-configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference-configuration.md b/docs/reference-configuration.md index 8406c441eb..b21ae52b05 100644 --- a/docs/reference-configuration.md +++ b/docs/reference-configuration.md @@ -72,6 +72,7 @@ module.exports = Configuration; ```ts import type {UserConfig} from '@commitlint/types'; +import { RuleConfigSeverity } from "@commitlint/types"; const Configuration: UserConfig = { /* @@ -93,7 +94,7 @@ const Configuration: UserConfig = { * Any rules defined here will override rules from @commitlint/config-conventional */ rules: { - 'type-enum': [2, 'always', ['foo']], + 'type-enum': [RuleConfigSeverity.Error, 'always', ['foo']], }, /* * Functions that return true if commitlint should ignore the given message.