File tree 9 files changed +94
-53
lines changed
build-tests/install-test-workspace/workspace/common
libraries/rush-lib/src/logic/base
9 files changed +94
-53
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,25 @@ export const enum ExtractorMessageId {
17
17
*/
18
18
ExtraReleaseTag = 'ae-extra-release-tag' ,
19
19
20
+ /**
21
+ * "Missing documentation for ___."
22
+ * @remarks
23
+ * The `ae-undocumented` message is only generated if the API report feature is enabled.
24
+ *
25
+ * Because the API report file already annotates undocumented items with `// (undocumented)`,
26
+ * the `ae-undocumented` message is not logged by default. To see it, add a setting such as:
27
+ * ```json
28
+ * "messages": {
29
+ * "extractorMessageReporting": {
30
+ * "ae-undocumented": {
31
+ * "logLevel": "warning"
32
+ * }
33
+ * }
34
+ * }
35
+ * ```
36
+ */
37
+ Undocumented = 'ae-undocumented' ,
38
+
20
39
/**
21
40
* "This symbol has another declaration with a different release tag."
22
41
*/
@@ -106,6 +125,7 @@ export const enum ExtractorMessageId {
106
125
107
126
export const allExtractorMessageIds : Set < string > = new Set < string > ( [
108
127
'ae-extra-release-tag' ,
128
+ 'ae-undocumented' ,
109
129
'ae-different-release-tags' ,
110
130
'ae-incompatible-release-tags' ,
111
131
'ae-missing-release-tag' ,
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export class ApiItemMetadata {
76
76
public tsdocComment : tsdoc . DocComment | undefined ;
77
77
78
78
// Assigned by DocCommentEnhancer
79
- public needsDocumentation : boolean = true ;
79
+ public undocumented : boolean = true ;
80
80
81
81
public docCommentEnhancerVisitorState : VisitorState = VisitorState . Unvisited ;
82
82
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class DocCommentEnhancer {
73
73
// Constructors always do pretty much the same thing, so it's annoying to require people to write
74
74
// descriptions for them. Instead, if the constructor lacks a TSDoc summary, then API Extractor
75
75
// will auto-generate one.
76
- metadata . needsDocumentation = false ;
76
+ metadata . undocumented = false ;
77
77
78
78
// The class that contains this constructor
79
79
const classDeclaration : AstDeclaration = astDeclaration . parent ! ;
@@ -135,12 +135,12 @@ export class DocCommentEnhancer {
135
135
136
136
if ( metadata . tsdocComment ) {
137
137
// Require the summary to contain at least 10 non-spacing characters
138
- metadata . needsDocumentation = ! tsdoc . PlainTextEmitter . hasAnyTextContent (
138
+ metadata . undocumented = ! tsdoc . PlainTextEmitter . hasAnyTextContent (
139
139
metadata . tsdocComment . summarySection ,
140
140
10
141
141
) ;
142
142
} else {
143
- metadata . needsDocumentation = true ;
143
+ metadata . undocumented = true ;
144
144
}
145
145
}
146
146
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import { AstNamespaceImport } from '../analyzer/AstNamespaceImport';
20
20
import type { AstEntity } from '../analyzer/AstEntity' ;
21
21
import type { AstModuleExportInfo } from '../analyzer/AstModule' ;
22
22
import { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter' ;
23
+ import { ExtractorMessageId } from '../api/ExtractorMessageId' ;
23
24
24
25
export class ApiReportGenerator {
25
26
private static _trimSpacesRegExp : RegExp = / + $ / gm;
@@ -522,8 +523,14 @@ export class ApiReportGenerator {
522
523
}
523
524
}
524
525
525
- if ( apiItemMetadata . needsDocumentation ) {
526
+ if ( apiItemMetadata . undocumented ) {
526
527
footerParts . push ( '(undocumented)' ) ;
528
+
529
+ collector . messageRouter . addAnalyzerIssue (
530
+ ExtractorMessageId . Undocumented ,
531
+ `Missing documentation for "${ astDeclaration . astSymbol . localName } ".` ,
532
+ astDeclaration
533
+ ) ;
527
534
}
528
535
529
536
if ( footerParts . length > 0 ) {
Original file line number Diff line number Diff line change 69
69
"logLevel" : " warning" ,
70
70
"addToApiReportFile" : true
71
71
},
72
+ "ae-undocumented" : {
73
+ "logLevel" : " none"
74
+ },
72
75
"ae-unresolved-inheritdoc-reference" : {
73
76
"logLevel" : " warning" ,
74
77
"addToApiReportFile" : true
Original file line number Diff line number Diff line change
1
+ {
2
+ "changes" : [
3
+ {
4
+ "packageName" : " @microsoft/api-extractor" ,
5
+ "comment" : " Add a new message \" ae-undocumented\" to support logging of undocumented API items" ,
6
+ "type" : " minor"
7
+ }
8
+ ],
9
+ "packageName" : " @microsoft/api-extractor"
10
+ }
Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ export const enum ExtractorMessageId {
144
144
PreapprovedBadReleaseTag = " ae-preapproved-bad-release-tag" ,
145
145
PreapprovedUnsupportedType = " ae-preapproved-unsupported-type" ,
146
146
SetterWithDocs = " ae-setter-with-docs" ,
147
+ Undocumented = " ae-undocumented" ,
147
148
UnresolvedInheritDocBase = " ae-unresolved-inheritdoc-base" ,
148
149
UnresolvedInheritDocReference = " ae-unresolved-inheritdoc-reference" ,
149
150
UnresolvedLink = " ae-unresolved-link" ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export interface IInstallManagerOptions {
53
53
recheckShrinkwrap : boolean ;
54
54
55
55
/**
56
- * Do not attempt to access the network. Report an error if the required dependencies
56
+ * Do not attempt to access the network. Report an error if the required dependencies
57
57
* cannot be obtained from the local cache.
58
58
*/
59
59
offline : boolean ;
You can’t perform that action at this time.
0 commit comments