@@ -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 ;
@@ -135,7 +135,7 @@ exports.defineTags = function (dictionary) {
135
135
}
136
136
throw new Error ( "Missing closing '}'" ) ;
137
137
} ;
138
- }
138
+ } ,
139
139
) ;
140
140
} ;
141
141
@@ -229,10 +229,10 @@ exports.astNodeVisitor = {
229
229
if (
230
230
leadingComments . length === 0 ||
231
231
( leadingComments [ leadingComments . length - 1 ] . value . indexOf (
232
- '@classdesc'
232
+ '@classdesc' ,
233
233
) === - 1 &&
234
234
noClassdescRegEx . test (
235
- leadingComments [ leadingComments . length - 1 ] . value
235
+ leadingComments [ leadingComments . length - 1 ] . value ,
236
236
) )
237
237
) {
238
238
// Create a suitable comment node if we don't have one on the class yet
@@ -250,7 +250,7 @@ exports.astNodeVisitor = {
250
250
if ( node . superClass ) {
251
251
// Remove the `@extends` tag because JSDoc does not does not handle generic type. (`@extends {Base<Type>}`)
252
252
const extendsIndex = lines . findIndex ( ( line ) =>
253
- line . includes ( '@extends' )
253
+ line . includes ( '@extends' ) ,
254
254
) ;
255
255
if ( extendsIndex !== - 1 ) {
256
256
lines . splice ( extendsIndex , 1 ) ;
@@ -262,7 +262,7 @@ exports.astNodeVisitor = {
262
262
if ( identifier ) {
263
263
const absolutePath = path . resolve (
264
264
path . dirname ( currentSourceName ) ,
265
- identifier . value
265
+ identifier . value ,
266
266
) ;
267
267
// default to js extension since .js extention is assumed implicitly
268
268
const extension = getExtension ( absolutePath ) ;
@@ -295,7 +295,7 @@ exports.astNodeVisitor = {
295
295
// Replace typeof Foo with Class<Foo>
296
296
comment . value = comment . value . replace (
297
297
/ t y p e o f ( [ ^ , \| \} \> ] * ) ( [ , \| \} \> ] ) / g,
298
- 'Class<$1>$2'
298
+ 'Class<$1>$2' ,
299
299
) ;
300
300
301
301
// Remove `@override` annotations to avoid JSDoc breaking the inheritance chain
@@ -323,7 +323,7 @@ exports.astNodeVisitor = {
323
323
if ( replaceAttempt > 100 ) {
324
324
// infinite loop protection
325
325
throw new Error (
326
- `Invalid docstring ${ comment . value } in ${ currentSourceName } .`
326
+ `Invalid docstring ${ comment . value } in ${ currentSourceName } .` ,
327
327
) ;
328
328
}
329
329
} else {
@@ -332,7 +332,7 @@ exports.astNodeVisitor = {
332
332
lastImportPath = importExpression ;
333
333
const rel = path . resolve (
334
334
path . dirname ( currentSourceName ) ,
335
- importSource
335
+ importSource ,
336
336
) ;
337
337
// default to js extension since .js extention is assumed implicitly
338
338
const extension = getExtension ( rel ) ;
@@ -356,7 +356,7 @@ exports.astNodeVisitor = {
356
356
if ( replacement ) {
357
357
comment . value = comment . value . replace (
358
358
importExpression ,
359
- replacement + remainder
359
+ replacement + remainder ,
360
360
) ;
361
361
}
362
362
}
@@ -377,13 +377,13 @@ exports.astNodeVisitor = {
377
377
Object . keys ( identifiers ) . forEach ( ( key ) => {
378
378
const eventRegex = new RegExp (
379
379
`@(event |fires )${ key } ([^A-Za-z])` ,
380
- 'g'
380
+ 'g' ,
381
381
) ;
382
382
replace ( eventRegex ) ;
383
383
384
384
const typeRegex = new RegExp (
385
385
`@(.*[{<|,(!?:]\\s*)${ key } ([^A-Za-z].*?\}|\})` ,
386
- 'g'
386
+ 'g' ,
387
387
) ;
388
388
replace ( typeRegex ) ;
389
389
@@ -392,7 +392,7 @@ exports.astNodeVisitor = {
392
392
const identifier = identifiers [ key ] ;
393
393
const absolutePath = path . resolve (
394
394
path . dirname ( currentSourceName ) ,
395
- identifier . value
395
+ identifier . value ,
396
396
) ;
397
397
// default to js extension since .js extention is assumed implicitly
398
398
const extension = getExtension ( absolutePath ) ;
@@ -408,11 +408,11 @@ exports.astNodeVisitor = {
408
408
: getDelimiter ( moduleId , exportName , parser ) ;
409
409
const replacement = `module:${ moduleId . replace (
410
410
slashRegEx ,
411
- '/'
411
+ '/' ,
412
412
) } ${ exportName ? delimiter + exportName : '' } `;
413
413
comment . value = comment . value . replace (
414
414
regex ,
415
- '@$1' + replacement + '$2'
415
+ '@$1' + replacement + '$2' ,
416
416
) ;
417
417
}
418
418
}
0 commit comments