File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/website/src/theme/MDXComponents Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import type { ESLintPluginDocs } from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules' ;
2
+ import type {
3
+ RuleRecommendation ,
4
+ RuleRecommendationAcrossConfigs ,
5
+ } from '@typescript-eslint/utils/ts-eslint' ;
2
6
3
7
import Link from '@docusaurus/Link' ;
4
8
import { useRulesMeta } from '@site/src/hooks/useRulesMeta' ;
@@ -34,11 +38,19 @@ const isRecommendedDocs = (
34
38
docs : ESLintPluginDocs ,
35
39
) : docs is RecommendedRuleMetaDataDocs => ! ! docs . recommended ;
36
40
41
+ const resolveRecommendation = (
42
+ recommended : RuleRecommendationAcrossConfigs < unknown [ ] > ,
43
+ ) : RuleRecommendation => {
44
+ return recommended . recommended === true ? 'recommended' : 'strict' ;
45
+ } ;
46
+
37
47
const getRecommendation = ( docs : RecommendedRuleMetaDataDocs ) : string [ ] => {
38
48
const recommended = docs . recommended ;
39
49
const recommendation =
40
50
recommendations [
41
- typeof recommended === 'object' ? 'recommended' : recommended
51
+ typeof recommended === 'object'
52
+ ? resolveRecommendation ( recommended )
53
+ : recommended
42
54
] ;
43
55
44
56
return docs . requiresTypeChecking
You can’t perform that action at this time.
0 commit comments