Skip to content

Commit a07a2c1

Browse files
committed
Add "upcoming" rules category
1 parent dfcd26e commit a07a2c1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/update-rules.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ const categories = [
3737
'base',
3838
'essential',
3939
'strongly-recommended',
40-
'recommended'
40+
'recommended',
41+
'use-with-caution',
42+
'uncategorized',
43+
'upcoming'
4144
// Only include categories with existing rules
4245
].filter(category =>
4346
rules.some(entry =>
@@ -63,7 +66,8 @@ const categoryTitles = {
6366
'strongly-recommended': 'Priority B: Strongly Recommended (Improving Readability)',
6467
'recommended': 'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)',
6568
'use-with-caution': 'Priority D: Use with Caution (Potentially Dangerous Patterns)',
66-
'uncategorized': 'Uncategorized'
69+
'uncategorized': 'Uncategorized',
70+
'upcoming': 'Upcoming: New rules, that are not enabled in any preset config by default (Awaiting next major release to be categorized)'
6771
}
6872

6973
// Throw if no title is defined for a category
@@ -79,7 +83,7 @@ const deprecatedRules = rules
7983
let rulesTableContent = categories.map(category => `
8084
### ${categoryTitles[category]}
8185
${
82-
category === 'uncategorized' ? '' : `
86+
['uncategorized', 'upcoming'].indexOf(category) > -1 ? '' : `
8387
Enforce all the rules in this category, as well as all higher priority rules, with:
8488
8589
\`\`\` json
@@ -138,7 +142,7 @@ if (deprecatedRules.length) {
138142
}
139143

140144
categories.forEach((category, categoryIndex) => {
141-
if (category === 'uncategorized') return
145+
if (['uncategorized', 'upcoming'].indexOf(category) > -1) return
142146
createRulesFile(category, categories.slice(0, categoryIndex + 1))
143147
})
144148

0 commit comments

Comments
 (0)