react-docgen-typescript
react-docgen-typescript copied to clipboard
@version tag does not return the version string in the generated description.
I have these two different components. A TypeScript Button.tsx
with a JsDoc with version number like here:
/**
* _Buttons let users to perform important, clearly expressed actions._
*
* @version 3.0
*/
and a second JavaScript component ButtonRow.js
with a JsDoc with version number like here:
/**
* _Group of related buttons that spaces and positions them responsively in a row or a stack._
* components.
*
* @version 3.0
*/
.
The problem I'm having is that when generating the components with react-docgen
I get a description of the component with a version number like here:
but with
react-docgen-typescript
I do not get the version number:
My propsParser
looks like this:
const propsParserOptions = {
propFilter: (prop, component) => {
if (prop.declarations !== undefined && prop.declarations.length > 0) {
const hasPropAdditionalDescription = prop.declarations.find(
(declaration) => {
return !declaration.fileName.includes('node_modules');
}
);
return Boolean(hasPropAdditionalDescription);
}
return true;
},
savePropValueAsString: true,
};
const jsParse = require('react-docgen');
const tsParser = require('react-docgen-typescript').withDefaultConfig(
propsParserOptions
);
propsParser(filePath, source, resolver, handlers) {
if (/tsx?$/.test(filePath)) return tsParser.parse(filePath);
return jsParse.parse(source, resolver, handlers);
}
Do you know where styleguidist expect to have this field? In other words where the parser should put it?
There was no activity for a long time. The issue will be closed soon.
Closing this issue as obsolete.