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

[Typescript] Cannot parse private/public fields of classes #356

Closed
redallen opened this issue May 8, 2019 · 1 comment
Closed

[Typescript] Cannot parse private/public fields of classes #356

redallen opened this issue May 8, 2019 · 1 comment

Comments

@redallen
Copy link

redallen commented May 8, 2019

Like enums, these tokens can be discarded, but as someone using react-docgen I don't want to live that regex life!

SyntaxError: unknown: Unexpected token (22:9)

  20 | 
  21 | export class SkipToContent extends React.Component<SkipToContentProps> {
> 22 |   public static defaultProps = {
     |          ^
  23 |     component: 'a',
  24 |     className: '',
  25 |     show: false
    at Object.raise (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:6322:17)
    at Object.unexpected (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:7638:16)
    at Object.parseClassMemberWithIsStatic (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:10711:12)
    at Object.parseClassMember (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:10607:10)
    at withTopicForbiddingContext (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:10562:14)
    at Object.withTopicForbiddingContext (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:9657:14)
    at Object.parseClassBody (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:10539:10)
    at Object.parseClass (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:10513:22)
    at Object.parseStatementContent (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:9805:21)
    at Object.parseStatement (/home/redallen/src/patternfly-react/node_modules/@babel/parser/lib/index.js:9763:17)

SkipToContent.tsx

Again, let me know how I can contribute!

@redallen
Copy link
Author

See #355

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant