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