File tree Expand file tree Collapse file tree 6 files changed +33
-6
lines changed Expand file tree Collapse file tree 6 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
+ "$schema" : " https://json.schemastore.org/mocharc.json" ,
2
3
"timeout" : 5000 ,
3
4
"spec" : [" src/test/**/*.test.ts" ],
4
- "exclude" : [" src/test/packages/**" , " src/test/slow/**" ]
5
+ "exclude" : [" src/test/packages/**" , " src/test/slow/**" ],
6
+ "watch-files" : [" src/**/*.ts" ],
7
+ "extension" : [" ts" , " tsx" ]
5
8
}
Original file line number Diff line number Diff line change 7
7
- Search results will no longer include random items when the search bar is empty, #1881 .
8
8
- Comments on overloaded constructors will now be detected in the same way that overloaded functions/methods are.
9
9
- Fixed ` removeReflection ` not completely removing reflections from the project, #1898 .
10
+ - Fixed ` @hidden ` / ` @ignore ` / ` @exclude ` comments on default exports with no associated variable, #1903 .
10
11
11
12
### Thanks!
12
13
Original file line number Diff line number Diff line change @@ -281,9 +281,9 @@ export class CommentPlugin extends ConverterComponent {
281
281
) as DeclarationReflection [ ] ,
282
282
( method ) => method . signatures ?. length === 0
283
283
) ;
284
- allRemoved . forEach ( ( reflection ) =>
285
- project . removeReflection ( reflection )
286
- ) ;
284
+ allRemoved . forEach ( ( reflection ) => {
285
+ project . removeReflection ( reflection ) ;
286
+ } ) ;
287
287
someRemoved . forEach ( ( reflection ) => {
288
288
reflection . sources = unique (
289
289
reflection . signatures ! . reduce < SourceReference [ ] > (
Original file line number Diff line number Diff line change @@ -170,6 +170,18 @@ export function convertSymbol(
170
170
flags = removeFlag ( flags , ts . SymbolFlags . Property ) ;
171
171
}
172
172
173
+ // A default exported function with no associated variable is a property, but
174
+ // we should really convert it as a variable for documentation purposes
175
+ // export default () => {}
176
+ // export default 123
177
+ if (
178
+ flags === ts . SymbolFlags . Property &&
179
+ symbol . name === "default" &&
180
+ context . scope . kindOf ( ReflectionKind . Module | ReflectionKind . Project )
181
+ ) {
182
+ flags = ts . SymbolFlags . BlockScopedVariable ;
183
+ }
184
+
173
185
for ( const flag of getEnumFlags ( flags ^ allConverterFlags ) ) {
174
186
if ( ! ( flag & allConverterFlags ) ) {
175
187
context . logger . verbose (
@@ -178,8 +190,8 @@ export function convertSymbol(
178
190
}
179
191
}
180
192
181
- // Note: This method does not allow skipping earlier converters, defined according to the order of
182
- // the ts.SymbolFlags enum. For now, this is fine... might not be flexible enough in the future.
193
+ // Note: This method does not allow skipping earlier converters.
194
+ // For now, this is fine... might not be flexible enough in the future.
183
195
let skip = 0 ;
184
196
for ( const flag of conversionOrder ) {
185
197
if ( ! ( flag & flags ) ) continue ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @hidden
3
+ */
4
+ export default ( ) => { } ;
Original file line number Diff line number Diff line change @@ -356,4 +356,11 @@ export const issueTests: {
356
356
) ;
357
357
logger . expectNoOtherMessages ( ) ;
358
358
} ,
359
+
360
+ gh1903 ( project ) {
361
+ equal (
362
+ Object . values ( project . reflections ) . map ( ( r ) => r . name ) ,
363
+ [ "typedoc" ]
364
+ ) ;
365
+ } ,
359
366
} ;
You can’t perform that action at this time.
0 commit comments