Add a new tsdoc.json setting "noStandardTags" #279
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TSDocConfigFile.loadFromParser()
generates a tsdoc.json file from the API object, which can be used to produce a single file that rolls up another tsdoc.json file, plus its"extends"
references, plus the predefined standard tags for the current TSDoc version. This is useful for serializing the exact TSDoc configuration for later usage.However, normally tsdoc.json files are loaded with a set of predefined standard tags, which would conflict with the serialized copy of those definitions. This PR solves that problem by adding a
"noStandardTags"
that instructs the loader not to predefine any tags.It might also be useful for a custom tsdoc.json configuration that wants to be substantially different from the standard tags. Or for example, if we wanted to publish tsdoc.json config files that represent previous versions of the TSDoc standard. So this feature can be generally useful.
Design note
I initially approached this by moving the standard definitions into a standard-tsdoc.json file (rather than having them declared in code). The idea was that a custom tsdoc.json file would always have a line like this:
This seemed elegant, because the predefined values are now in a nice JSON file, and their existence is explicitly specified using the familiar
"extends"
mechanism. But I realized that it would be clunky in practice:@microsoft/tsdoc
package