How to use the react-docgen-typescript.parse function in react-docgen-typescript

To help you get started, we’ve selected a few react-docgen-typescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / react-autodocs-utils / src / parser / react-docgen-parse.js View on Github external
const parseTypescript = path => ensurePropsKey(typescriptParser.parse(path)[0] || {}); // react-docgen-typescript returns array, so
github meetalva / alva / src / analysis / map-file / map-react-docgen-typescript.ts View on Github external
export const mapReactDocgenTypeScript: T.AnalysisMapper = async (
	path: string,
	ctx: T.AnalysisMapperContext
): Promise => {
	try {
		const info = reactDocgenTypescript.parse(path);
		if (info.length > 0) {
			ctx.analysis.attach(path, { type: label, payload: info });
		}
		// tslint:disable-next-line:no-empty
	} catch (err) {}
};
github blueberryapps / react-bluekit / src / createBlueKit.js View on Github external
function getDocgen(config, filePath) {
  if (filePath.match(/\.tsx$/))
    return require('react-docgen-typescript').parse(filePath);

  let content = fs.readFileSync(filePath).toString()
  if (!config.noSpecialReplacements) {
    content = content
      .replace('_interopRequireDefault(_react)', 'require("react")')
      .replace(/import Component from ["']react-pure-render\/component["']/, 'import {Component} from "react"')
      .replace(/export default .*\((\w*)\)+/m, 'export default $1')
  }
  return docgenParse(content);
}

react-docgen-typescript

[![Build Status](https://github.com/styleguidist/react-docgen-typescript/actions/workflows/nodejs.yml/badge.svg)](https://github.com/styleguidist/react-docgen-typescript/actions/workflows/nodejs.yml)

MIT
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Similar packages