Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Flow component syntax #1644

Open
neutraali opened this issue Sep 20, 2024 · 0 comments
Open

Support Flow component syntax #1644

neutraali opened this issue Sep 20, 2024 · 0 comments

Comments

@neutraali
Copy link

Version: [email protected]
Usage: CLI - npx documentation build ./Example.js --shallow
Docs: https://flow.org/en/docs/react/component-syntax/

Code

/** @flow */

component Example( text: string = 'Hello World' ) {
	return <div>{text}</div>;
};

Expected

[
  {
    "description": "",
    "tags": [
      {
        "title": "flow",
        "description": null,
        "lineNumber": 0
      }
    ]
    ...
]

Actual

SyntaxError: Missing semicolon. (3:9)
    at constructor (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:362:19)
    at V8IntrinsicMixin.raise (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:3260:19)
    at V8IntrinsicMixin.semicolon (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:3586:10)
    at V8IntrinsicMixin.parseExpressionStatement (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:12761:10)
    at V8IntrinsicMixin.parseExpressionStatement (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:5073:18)
    at V8IntrinsicMixin.parseStatementContent (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:12376:19)
    at V8IntrinsicMixin.parseStatementLike (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:12239:17)
    at V8IntrinsicMixin.parseStatementLike (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:5051:24)
    at V8IntrinsicMixin.parseModuleItem (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:12216:17)
    at V8IntrinsicMixin.parseBlockOrModuleBlockBody (/home/anttis/Dev/LianaUI/node_modules/@babel/parser/lib/index.js:12792:36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant