Open dtinth opened 2 years ago
Just remove _2
from .api.json
file. Here’s an example shell script that you can rush after running api-extractor
#!/bin/bash -e
# A weird issue with API Extractor adds `_2` suffix to some function names.
# See: https://github.com/microsoft/rushstack/issues/2895
sed -i.bak 's/_2//g' temp/package-name.api.json
Related issues:
Noticed the same thing in some interfaces and enums:
declare enum ImageOrientation_2 {
// ...
}
export { ImageOrientation_2 as ImageOrientation }
declare enum DocumentType_2 {
// ...
}
export { DocumentType_2 as DocumentType }
Noticed the same thing in some interfaces and enums:
declare enum ImageOrientation_2 { // ... } export { ImageOrientation_2 as ImageOrientation } declare enum DocumentType_2 { // ... } export { DocumentType_2 as DocumentType }
Still have the same problem ...
Summary
I am trying to generate a doc model for a TypeScript library. I found that some names in the resulting documentation has
_2
added to it.The generated documentation model specified the function name as
"invariant_2"
instead of just"invariant"
.Repro steps
Expected result: The included test in the repro,
validate.js
, is passing.Actual result: It fails here:
Details
An npm package
@types/invariant
is installed inpackage.json
, which happens to have the same name as a function:If I remove
"@types/invariant"
then the issue does not happen.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/api-extractor
version?node -v
)?