File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -10,27 +10,29 @@ export default iterateJsdoc(({
10
10
} ) => {
11
11
let always ;
12
12
13
+ const targetTagName = utils . getPreferredTagName ( 'param' ) ;
14
+
13
15
if ( _ . has ( context . options , 0 ) ) {
14
16
always = context . options [ 0 ] === 'always' ;
15
17
} else {
16
18
always = true ;
17
19
}
18
20
19
- utils . forEachTag ( 'param' , ( jsdocTag ) => {
21
+ utils . forEachTag ( targetTagName , ( jsdocTag ) => {
20
22
if ( ! jsdocTag . description ) {
21
23
return ;
22
24
}
23
25
24
26
if ( always ) {
25
27
if ( ! jsdocTag . description . startsWith ( '-' ) ) {
26
- report ( 'There must be a hyphen before @param description.' , ( fixer ) => {
28
+ report ( 'There must be a hyphen before @' + targetTagName + ' description.', ( fixer ) => {
27
29
const replacement = sourceCode . getText ( jsdocNode ) . replace ( jsdocTag . description , '- ' + jsdocTag . description ) ;
28
30
29
31
return fixer . replaceText ( jsdocNode , replacement ) ;
30
32
} , jsdocTag ) ;
31
33
}
32
34
} else if ( jsdocTag . description . startsWith ( '-' ) ) {
33
- report ( 'There must be no hyphen before @param description.' , ( fixer ) => {
35
+ report ( 'There must be no hyphen before @' + targetTagName + ' description.', ( fixer ) => {
34
36
const [ unwantedPart ] = / - \s * / . exec ( jsdocTag . description ) ;
35
37
36
38
const replacement = sourceCode
You can’t perform that action at this time.
0 commit comments