-
Notifications
You must be signed in to change notification settings - Fork 9
/
.eslint-doc-generatorrc.js
61 lines (60 loc) · 1.78 KB
/
.eslint-doc-generatorrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/** @type {import('eslint-doc-generator').GenerateOptions} */
const config = {
ignoreConfig: ['all', 'flat/all'],
configEmoji: [
["recommended", "🔵"],
["flat/recommended", "🟢"],
],
pathRuleList: ['README.md', 'docs/rules/index.md'],
ruleDocSectionInclude: ['Rule Details', 'Version', 'Implementation'],
ruleDocSectionOptions: false,
ruleDocTitleFormat: 'prefix-name',
ruleListColumns: [
// All standard columns except `deprecated` since we split the list such that there's a dedicated "Deprecated" section.
'name',
'description',
'configsError',
'configsWarn',
'configsOff',
'fixable',
'hasSuggestions',
'requiresTypeChecking',
],
ruleListSplit(rules) {
return [
{
title: 'Possible Errors',
rules: rules.filter(
([, rule]) => rule.meta.docs.category === 'Possible Errors' && !rule.meta.deprecated
),
},
{
title: 'Best Practices',
rules: rules.filter(
([, rule]) => rule.meta.docs.category === 'Best Practices' && !rule.meta.deprecated
),
},
{
title: 'Stylistic Issues',
rules: rules.filter(
([, rule]) => rule.meta.docs.category === 'Stylistic Issues' && !rule.meta.deprecated
),
},
...rules.some(([, rule]) => rule.meta.deprecated)
? [
{
title: 'Deprecated',
rules: rules.filter(([, rule]) => rule.meta.deprecated),
}
]
: [],
];
},
urlRuleDoc(name, page) {
if (page === 'README.md') {
// Use URLs only in the README to link to the vitepress SPA. Otherwise, fallback to relative URLs.
return `https://ota-meshi.github.io/eslint-plugin-regexp/rules/${name}.html`;
}
},
};
module.exports = config;