Skip to content

Commit 0cd45ef

Browse files
committed
Updated JSON schema to include new options
1 parent 1602a61 commit 0cd45ef

3 files changed

Lines changed: 74 additions & 10 deletions

File tree

‎apps/api-extractor/src/api/IExtractorConfig.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export const enum ExtractorMessageLogLevel {
296296
}
297297

298298
/**
299-
* Configures how API Extractor messages are reported.
299+
* Configures reporting for a given message identifier.
300300
*
301301
* @public
302302
*/
@@ -318,22 +318,22 @@ export interface IExtractorMessageReportingRuleConfig {
318318
}
319319

320320
/**
321-
* Specifies a table of reporting rules for different message IDs, and also the default rule used for IDs that
322-
* do not appear in the table.
321+
* Specifies a table of reporting rules for different message identifiers, and also the default rule used for
322+
* identifiers that do not appear in the table.
323323
*
324324
* @public
325325
*/
326326
export interface IExtractorMessageReportingTableConfig {
327327
/**
328-
* The key is a message ID for the associated type of message, or "default" to specify the default policy.
328+
* The key is a message identifier for the associated type of message, or "default" to specify the default policy.
329329
* For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),
330330
* or `ae-extra-release-tag` (a message related to the API Extractor analysis).
331331
*/
332332
[messageId: string]: IExtractorMessageReportingRuleConfig;
333333
}
334334

335335
/**
336-
* Configures how API Extractor reports issues that it encounters.
336+
* Configures how API Extractor reports error and warning messages produced during analysis.
337337
*
338338
* @public
339339
*/
@@ -345,14 +345,14 @@ export interface IExtractorMessagesConfig {
345345
compilerMessageReporting: IExtractorMessageReportingTableConfig;
346346

347347
/**
348-
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
348+
* Configures handling of messages reported by API Extractor during its analysis.
349349
*/
350-
tsdocMessageReporting: IExtractorMessageReportingTableConfig;
350+
extractorMessageReporting: IExtractorMessageReportingTableConfig;
351351

352352
/**
353-
* Configures handling of messages reported by API Extractor during its analysis.
353+
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
354354
*/
355-
extractorMessageReporting: IExtractorMessageReportingTableConfig;
355+
tsdocMessageReporting: IExtractorMessageReportingTableConfig;
356356
}
357357

358358
/**

‎apps/api-extractor/src/schemas/api-extractor-defaults.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,24 @@
4242
"tsdocMetadataPath": ""
4343
},
4444

45+
"messages": {
46+
"compilerMessageReporting": {
47+
"default": {
48+
"logLevel": "Warning"
49+
}
50+
},
51+
"extractorMessageReporting": {
52+
"default": {
53+
"logLevel": "Warning"
54+
}
55+
},
56+
"tsdocMessageReporting": {
57+
"default": {
58+
"logLevel": "Warning"
59+
}
60+
}
61+
},
62+
4563
"skipLibCheck": false,
4664
"testMode": false
4765
}

‎apps/api-extractor/src/schemas/api-extractor.schema.json‎

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,26 @@
183183
"additionalProperties": false
184184
},
185185

186+
"messages": {
187+
"description": "Configures how API Extractor reports error and warning messages produced during analysis.",
188+
"type": "object",
189+
"properties": {
190+
"compilerMessageReporting": {
191+
"description": "Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the input .d.ts files.",
192+
"$ref": "#/definitions/extractorMessageReportingTable"
193+
},
194+
"extractorMessageReporting": {
195+
"description": "Configures handling of messages reported by API Extractor during its analysis.",
196+
"$ref": "#/definitions/extractorMessageReportingTable"
197+
},
198+
"tsdocMessageReporting": {
199+
"description": "Configures handling of messages reported by the TSDoc parser when analyzing code comments.",
200+
"$ref": "#/definitions/extractorMessageReportingTable"
201+
}
202+
},
203+
"additionalProperties": false
204+
},
205+
186206
"skipLibCheck": {
187207
"description": "This option causes the typechecker to be invoked with the --skipLibCheck option. This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses for its analysis. If this option is used, it is strongly recommended that broken dependencies be fixed or upgraded.",
188208
"type": "boolean"
@@ -193,5 +213,31 @@
193213
}
194214
},
195215
"required": [ "compiler", "project" ],
196-
"additionalProperties": false
216+
"additionalProperties": false,
217+
218+
"definitions": {
219+
"extractorMessageReportingTable": {
220+
"type":"object",
221+
"description": "Specifies a table of reporting rules for different message identifiers, and also the default rule used for identifiers that do not appear in the table. The key is a message identifier for the associated type of message, or \"default\" to specify the default policy. For example, the key might be \"TS2551\" (a compiler message), \"tsdoc-link-tag-unescaped-text\" (a TSDOc message), or \"ae-extra-release-tag\" (a message related to the API Extractor analysis).",
222+
"patternProperties": {
223+
".+": {
224+
"type": "object",
225+
"description": "Configures reporting for a given message identifier.",
226+
"properties": {
227+
"logLevel": {
228+
"type": "string",
229+
"description": "Specifies whether the message should be written to the the tool's output log. Note that the \"addToApiReviewFile\" property may supersede this option.",
230+
"enum": [ "Error", "Warning", "None" ]
231+
},
232+
"addToApiReviewFile": {
233+
"type": "boolean",
234+
"description": "If API Extractor is configured to write an API review file (.api.ts), then the message will be written inside that file. If the API review file is NOT being written, then the message is instead logged according to the \"logLevel\" option."
235+
}
236+
},
237+
"additionalProperties": false
238+
}
239+
},
240+
"additionalProperties": false
241+
}
242+
}
197243
}

0 commit comments

Comments
 (0)