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
Copy file name to clipboardExpand all lines: lib/rule-notices.ts
+31-24
Original file line number
Diff line number
Diff line change
@@ -17,21 +17,15 @@ import {
17
17
RuleDocTitleFormat,
18
18
RULE_DOC_TITLE_FORMAT_DEFAULT,
19
19
}from'./rule-doc-title-format.js';
20
-
21
-
enumMESSAGE_TYPE{
22
-
CONFIGS='configs',
23
-
DEPRECATED='deprecated',
24
-
FIXABLE='fixable',
25
-
HAS_SUGGESTIONS='hasSuggestions',
26
-
REQUIRES_TYPE_CHECKING='requiresTypeChecking',
27
-
}
20
+
import{COLUMN_TYPE}from'./rule-list-columns.js';
28
21
29
22
/**
30
23
* An object containing the text for each notice type (as a string or function to generate the string).
31
24
*/
32
25
constRULE_NOTICES: {
33
-
[keyinMESSAGE_TYPE]:
26
+
[keyinCOLUMN_TYPE]:
34
27
|string
28
+
|undefined
35
29
|((data: {
36
30
configsEnabled: string[];
37
31
configEmojis: ConfigEmojis;
@@ -40,7 +34,7 @@ const RULE_NOTICES: {
40
34
})=>string);
41
35
}={
42
36
// Configs notice varies based on whether the rule is enabled in one or more configs.
43
-
[MESSAGE_TYPE.CONFIGS]: ({
37
+
[COLUMN_TYPE.CONFIGS]: ({
44
38
configsEnabled,
45
39
configEmojis,
46
40
urlConfigs,
@@ -84,7 +78,7 @@ const RULE_NOTICES: {
84
78
},
85
79
86
80
// Deprecated notice has optional "replaced by" rules list.
87
-
[MESSAGE_TYPE.DEPRECATED]: ({
81
+
[COLUMN_TYPE.DEPRECATED]: ({
88
82
replacedBy,
89
83
}: {
90
84
replacedBy?: readonlystring[]|undefined;
@@ -96,9 +90,13 @@ const RULE_NOTICES: {
96
90
}`,
97
91
98
92
// Simple strings.
99
-
[MESSAGE_TYPE.FIXABLE]: `${EMOJI_FIXABLE} This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).`,
100
-
[MESSAGE_TYPE.HAS_SUGGESTIONS]: `${EMOJI_HAS_SUGGESTIONS} This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).`,
101
-
[MESSAGE_TYPE.REQUIRES_TYPE_CHECKING]: `${EMOJI_REQUIRES_TYPE_CHECKING} This rule requires type information.`,
93
+
[COLUMN_TYPE.FIXABLE]: `${EMOJI_FIXABLE} This rule is automatically fixable by the [\`--fix\` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).`,
94
+
[COLUMN_TYPE.HAS_SUGGESTIONS]: `${EMOJI_HAS_SUGGESTIONS} This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).`,
95
+
[COLUMN_TYPE.REQUIRES_TYPE_CHECKING]: `${EMOJI_REQUIRES_TYPE_CHECKING} This rule requires type information.`,
96
+
97
+
// No notice for these.
98
+
[COLUMN_TYPE.DESCRIPTION]: undefined,
99
+
[COLUMN_TYPE.NAME]: undefined,
102
100
};
103
101
104
102
/**
@@ -115,13 +113,15 @@ function ruleNamesToList(ruleNames: readonly string[]) {
0 commit comments