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

publicOnly to handle more export formats #288

Closed
3 of 4 tasks
brettz9 opened this issue Jun 23, 2019 · 8 comments
Closed
3 of 4 tasks

publicOnly to handle more export formats #288

brettz9 opened this issue Jun 23, 2019 · 8 comments

Comments

@brettz9
Copy link
Collaborator

brettz9 commented Jun 23, 2019

The new publicOnly of require-jsdoc seems not to be able to handle exports of any of these forms (with esm: true) as these fail to report missing jsdoc:

  • export default function () {, export default class {}, export default () => {} - (The first two of these anonymous defaults were giving errors, but this is now fixed.)
  • The named variety: export var a = function () {} (export {name} is already implemented)
  • Checking scopes
  • TSInterfaceDeclaration (see require-jsdoc: contexts and publicOnly lead to false negatives #492)

With some strange structures like the following, besides the fact of adding support, it would let us remove some /* istanbul ignore next */ directives (see #286 , an issue interrelated with this one), but this won't pass now, and would need to support scopes (which the code comments indicate is not yet supported) and may in some cases be more complexity than its worth (e.g., parsing template properties):

var a = {};
if (true) {
  a = {q: function () {}};
}
var test = a[`q`];

class Clss {}
var test2 = a[Clss];

export { test, test2 }

@Extersky


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Extersky
Copy link
Contributor

As the first two items are fixed, I can take a look at the object keys, scoping and writing test cases for uncovered lines of exportparser file. Scoping likely requires more strict tracking of ECMAScript specification than the resolver does so far, to not give wrong results.
Implementing static analysis of if blocks also opens other questions, such as, what values should be statically analyzable.

@brettz9
Copy link
Collaborator Author

brettz9 commented Jun 25, 2019

Sounds good... Re: object keys, FWIW, while there are probably better examples, I happened to find in exploring the uncovered lines a little, that, per my example, putting a template and function in the position of a key handled a couple of those uncovered lines (now exempted from coverage)--as unusual as the latter is.

@orlov-vo

This comment was marked as off-topic.

@brettz9

This comment was marked as off-topic.

@orlov-vo

This comment was marked as off-topic.

@apowers313

This comment was marked as off-topic.

@brettz9

This comment was marked as off-topic.

@brettz9
Copy link
Collaborator Author

brettz9 commented May 28, 2023

I think the most critical items are discoverable, so closing.

@brettz9 brettz9 closed this as completed May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants