@@ -7,12 +7,12 @@ const addInherited = require('jsdoc/augment').addInherited; // eslint-disable-li
7
7
const config = env . conf . typescript ;
8
8
if ( ! config ) {
9
9
throw new Error (
10
- 'Configuration "typescript" for jsdoc-plugin-typescript missing.'
10
+ 'Configuration "typescript" for jsdoc-plugin-typescript missing.' ,
11
11
) ;
12
12
}
13
13
if ( ! ( 'moduleRoot' in config ) ) {
14
14
throw new Error (
15
- 'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.'
15
+ 'Configuration "typescript.moduleRoot" for jsdoc-plugin-typescript missing.' ,
16
16
) ;
17
17
}
18
18
const moduleRoot = config . moduleRoot ;
@@ -21,7 +21,7 @@ if (!fs.existsSync(moduleRootAbsolute)) {
21
21
throw new Error (
22
22
'Directory "' +
23
23
moduleRootAbsolute +
24
- '" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript'
24
+ '" does not exist. Check the "typescript.moduleRoot" config option for jsdoc-plugin-typescript' ,
25
25
) ;
26
26
}
27
27
@@ -47,7 +47,7 @@ function getModuleInfo(moduleId, extension, parser) {
47
47
const absolutePath = path . join (
48
48
process . cwd ( ) ,
49
49
moduleRoot ,
50
- moduleId + extension
50
+ moduleId + extension ,
51
51
) ;
52
52
if ( ! fs . existsSync ( absolutePath ) ) {
53
53
return null ;
@@ -186,7 +186,7 @@ exports.defineTags = function (dictionary) {
186
186
// Bracket notation to dot notation
187
187
. replace (
188
188
/ ( \w + | > | \) | \] ) \[ (?: ' ( [ ^ ' ] + ) ' | " ( [ ^ " ] + ) " ) \] / g,
189
- '$1.$2$3'
189
+ '$1.$2$3' ,
190
190
) ;
191
191
192
192
return head + replaced + tail ;
@@ -293,10 +293,10 @@ exports.astNodeVisitor = {
293
293
if (
294
294
leadingComments . length === 0 ||
295
295
( leadingComments [ leadingComments . length - 1 ] . value . indexOf (
296
- '@classdesc'
296
+ '@classdesc' ,
297
297
) === - 1 &&
298
298
noClassdescRegEx . test (
299
- leadingComments [ leadingComments . length - 1 ] . value
299
+ leadingComments [ leadingComments . length - 1 ] . value ,
300
300
) )
301
301
) {
302
302
// Create a suitable comment node if we don't have one on the class yet
@@ -314,7 +314,7 @@ exports.astNodeVisitor = {
314
314
if ( node . superClass ) {
315
315
// Remove the `@extends` tag because JSDoc does not does not handle generic type. (`@extends {Base<Type>}`)
316
316
const extendsIndex = lines . findIndex ( ( line ) =>
317
- line . includes ( '@extends' )
317
+ line . includes ( '@extends' ) ,
318
318
) ;
319
319
if ( extendsIndex !== - 1 ) {
320
320
lines . splice ( extendsIndex , 1 ) ;
@@ -326,7 +326,7 @@ exports.astNodeVisitor = {
326
326
if ( identifier ) {
327
327
const absolutePath = path . resolve (
328
328
path . dirname ( currentSourceName ) ,
329
- identifier . value
329
+ identifier . value ,
330
330
) ;
331
331
// default to js extension since .js extention is assumed implicitly
332
332
const extension = getExtension ( absolutePath ) ;
@@ -359,7 +359,7 @@ exports.astNodeVisitor = {
359
359
// Replace typeof Foo with Class<Foo>
360
360
comment . value = comment . value . replace (
361
361
/ t y p e o f ( [ ^ , \| \} \> ] * ) ( [ , \| \} \> ] ) / g,
362
- 'Class<$1>$2'
362
+ 'Class<$1>$2' ,
363
363
) ;
364
364
365
365
// Remove `@override` annotations to avoid JSDoc breaking the inheritance chain
@@ -387,7 +387,7 @@ exports.astNodeVisitor = {
387
387
if ( replaceAttempt > 100 ) {
388
388
// infinite loop protection
389
389
throw new Error (
390
- `Invalid docstring ${ comment . value } in ${ currentSourceName } .`
390
+ `Invalid docstring ${ comment . value } in ${ currentSourceName } .` ,
391
391
) ;
392
392
}
393
393
} else {
@@ -396,7 +396,7 @@ exports.astNodeVisitor = {
396
396
lastImportPath = importExpression ;
397
397
const rel = path . resolve (
398
398
path . dirname ( currentSourceName ) ,
399
- importSource
399
+ importSource ,
400
400
) ;
401
401
// default to js extension since .js extention is assumed implicitly
402
402
const extension = getExtension ( rel ) ;
@@ -420,7 +420,7 @@ exports.astNodeVisitor = {
420
420
if ( replacement ) {
421
421
comment . value = comment . value . replace (
422
422
importExpression ,
423
- replacement + remainder
423
+ replacement + remainder ,
424
424
) ;
425
425
}
426
426
}
@@ -441,13 +441,13 @@ exports.astNodeVisitor = {
441
441
Object . keys ( identifiers ) . forEach ( ( key ) => {
442
442
const eventRegex = new RegExp (
443
443
`@(event |fires )${ key } ([^A-Za-z])` ,
444
- 'g'
444
+ 'g' ,
445
445
) ;
446
446
replace ( eventRegex ) ;
447
447
448
448
const typeRegex = new RegExp (
449
449
`@(.*[{<|,(!?:]\\s*)${ key } ([^A-Za-z].*?\}|\})` ,
450
- 'g'
450
+ 'g' ,
451
451
) ;
452
452
replace ( typeRegex ) ;
453
453
@@ -456,7 +456,7 @@ exports.astNodeVisitor = {
456
456
const identifier = identifiers [ key ] ;
457
457
const absolutePath = path . resolve (
458
458
path . dirname ( currentSourceName ) ,
459
- identifier . value
459
+ identifier . value ,
460
460
) ;
461
461
// default to js extension since .js extention is assumed implicitly
462
462
const extension = getExtension ( absolutePath ) ;
@@ -472,11 +472,11 @@ exports.astNodeVisitor = {
472
472
: getDelimiter ( moduleId , exportName , parser ) ;
473
473
const replacement = `module:${ moduleId . replace (
474
474
slashRegEx ,
475
- '/'
475
+ '/' ,
476
476
) } ${ exportName ? delimiter + exportName : '' } `;
477
477
comment . value = comment . value . replace (
478
478
regex ,
479
- '@$1' + replacement + '$2'
479
+ '@$1' + replacement + '$2' ,
480
480
) ;
481
481
}
482
482
}
0 commit comments