Skip to content

react-docgen generates platform specific structure #199

@chaliy

Description

@chaliy
react-docgen --pretty -o lib/metadata.json src/components

On Windows produces:

{
  "src\\components\\ExampleComponent.react.js": {
    "description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
    "methods": [],
    "props": {
      "label": {
        "type": {
          "name": "string"
        },
        "required": true,
        "description": "A label that will be printed when this component is rendered."
      }
    }
  }
}

On Linux produces:

{
  "src/components/ExampleComponent.react.js": {
    "description": "ExampleComponent is an example component.\r\nIt takes a single property, `label`, and\r\ndisplays it.",
    "methods": [],
    "props": {
      "label": {
        "type": {
          "name": "string"
        },
        "required": true,
        "description": "A label that will be printed when this component is rendered."
      }
    }
  }
}

This makes some scripts which use results of react-docgen for code generation fail. One example is plotly/dash component generator. Would you consider this is as a bug?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions