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

Lint and build break on documented class properties declared in constructor #1617

Open
stalgiag opened this issue Nov 14, 2023 · 0 comments
Open

Comments

@stalgiag
Copy link

stalgiag commented Nov 14, 2023

If you're reporting a bug, please include input code, output documentation,
a description of what you expected to happen, and what happened instead.

  • What version of documentation.js are you using?:
    • v14.0.2
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?):
    • Node, tested with both documentation.build() and documentation.lint(), same error on both.

Error

Running either documentation.build() or documentation.lint() on this file throws an error:

scope.path.parentPath.parentPath.node.id.name,
                                                   ^
TypeError: Cannot read properties of null (reading 'name')
    at ThisExpression (file:///Users/stalgia/Desktop/Work/p5-scratch-pad/node_modules/documentation/src/infer/membership.js:98:52)
    at NodePath._call (/Users/stalgia/Desktop/Work/p5-scratch-pad/node_modules/@babel/traverse/lib/path/context.js:46:20)

Expectation

That these functions will run without throwing errors.

This seems to be an issue with the documentation of the properties declared inside of the constructor. Removing those comments allows both linting and building to work as expected. I understand that this style of inline docs for classes is not recommended but it should be possible to lint without throwing an error on this.

We are evaluating options for replacing our current inline doc parser and this issue is a blocker for documentation.js.

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