@@ -27,27 +27,15 @@ const curryUtils = (
27
27
jsdoc ,
28
28
{
29
29
tagNamePreference,
30
- exampleCodeRegex,
31
- rejectExampleCodeRegex,
32
30
additionalTagNames,
33
- baseConfig,
34
- configFile,
35
- captionRequired,
36
- matchingFileName,
37
- eslintrcForExamples,
38
- allowInlineConfig,
39
31
allowEmptyNamepaths,
40
- reportUnusedDisableDirectives,
41
- noDefaultExampleRules,
42
32
overrideReplacesDocs,
43
33
implementsReplacesDocs,
44
34
augmentsExtendsReplacesDocs,
45
35
allowOverrideWithoutParam,
46
36
allowImplementsWithoutParam,
47
37
allowAugmentsExtendsWithoutParam,
48
- checkSeesForNamepaths,
49
- forceRequireReturn,
50
- avoidExampleOnConstructors
38
+ checkSeesForNamepaths
51
39
} ,
52
40
ancestors ,
53
41
sourceCode ,
@@ -83,18 +71,6 @@ const curryUtils = (
83
71
return jsdocUtils . getPreferredTagName ( name , tagNamePreference ) ;
84
72
} ;
85
73
86
- utils . getExampleCodeRegex = ( ) => {
87
- return exampleCodeRegex ;
88
- } ;
89
-
90
- utils . getRejectExampleCodeRegex = ( ) => {
91
- return rejectExampleCodeRegex ;
92
- } ;
93
-
94
- utils . getMatchingFileName = ( ) => {
95
- return matchingFileName ;
96
- } ;
97
-
98
74
utils . isValidTag = ( name ) => {
99
75
return jsdocUtils . isValidTag ( name , additionalTagNames ) ;
100
76
} ;
@@ -107,34 +83,6 @@ const curryUtils = (
107
83
return jsdocUtils . hasTag ( jsdoc , name ) ;
108
84
} ;
109
85
110
- utils . useEslintrcForExamples = ( ) => {
111
- return eslintrcForExamples ;
112
- } ;
113
-
114
- utils . allowInlineConfig = ( ) => {
115
- return allowInlineConfig ;
116
- } ;
117
-
118
- utils . reportUnusedDisableDirectives = ( ) => {
119
- return reportUnusedDisableDirectives ;
120
- } ;
121
-
122
- utils . hasNoDefaultExampleRules = ( ) => {
123
- return noDefaultExampleRules ;
124
- } ;
125
-
126
- utils . getBaseConfig = ( ) => {
127
- return baseConfig ;
128
- } ;
129
-
130
- utils . getConfigFile = ( ) => {
131
- return configFile ;
132
- } ;
133
-
134
- utils . isCaptionRequired = ( ) => {
135
- return captionRequired ;
136
- } ;
137
-
138
86
// These settings are deprecated and may be removed in the future along with this method.
139
87
utils . avoidDocsParamOnly = ( ) => {
140
88
// These three checks are all for deprecated settings and may be removed in the future
@@ -188,10 +136,6 @@ const curryUtils = (
188
136
return jsdocUtils . isTagWithType ( tagName ) ;
189
137
} ;
190
138
191
- utils . avoidExampleOnConstructors = ( ) => {
192
- return avoidExampleOnConstructors ;
193
- } ;
194
-
195
139
utils . passesEmptyNamepathCheck = ( tag ) => {
196
140
return ! tag . name && allowEmptyNamepaths &&
197
141
jsdocUtils . isPotentiallyEmptyNamepathTag ( tag . tag ) ;
@@ -211,10 +155,6 @@ const curryUtils = (
211
155
} ) ;
212
156
} ;
213
157
214
- utils . isForceRequireReturn = ( ) => {
215
- return forceRequireReturn ;
216
- } ;
217
-
218
158
utils . filterTags = ( filter ) => {
219
159
return ( jsdoc . tags || [ ] ) . filter ( filter ) ;
220
160
} ;
@@ -310,7 +250,14 @@ export {
310
250
parseComment
311
251
} ;
312
252
313
- export default ( iterator , opts = { } ) => {
253
+ /**
254
+ * @typedef {ReturnType<typeof curryUtils> } Utils
255
+ * @typedef {ReturnType<typeof getSettings> } Settings
256
+ *
257
+ * @param {(arg: {utils: Utils, settings: Settings}) => any } iterator
258
+ * @param {{returns?: any} } opts
259
+ */
260
+ export default function iterateJsdoc ( iterator , opts = { } ) {
314
261
return {
315
262
/**
316
263
* The entrypoint for the JSDoc rule.
@@ -396,6 +343,7 @@ export default (iterator, opts = {}) => {
396
343
jsdocNode,
397
344
node,
398
345
report,
346
+ settings,
399
347
sourceCode,
400
348
utils
401
349
} ) ;
@@ -424,4 +372,4 @@ export default (iterator, opts = {}) => {
424
372
} ,
425
373
meta : opts . meta
426
374
} ;
427
- } ;
375
+ }
0 commit comments