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

Expose the jsdoc field in the AST without @internal. #42407

Closed
5 tasks done
Raynos opened this issue Jan 19, 2021 · 2 comments
Closed
5 tasks done

Expose the jsdoc field in the AST without @internal. #42407

Raynos opened this issue Jan 19, 2021 · 2 comments

Comments

@Raynos
Copy link

Raynos commented Jan 19, 2021

Suggestion

Currently the jsDoc field on JSDocContainer is marked as @internal.

It would be nice to be able to use the jsDoc field in linting tools like eslint in custom rules.

here's an example where the jsDoc field is used ( typescript-eslint/typescript-eslint#2939 (comment) ).

🔍 Search Terms

jsDoc, jsdoc, internal

✅ Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

Remove the @internal declaration on the jsDoc field.

📃 Motivating Example

typescript-eslint/typescript-eslint#2939 (comment)

💻 Use Cases

To be able to use the jsDoc field without casting in linting rules.

@ajafff
Copy link
Contributor

ajafff commented Jan 19, 2021

Duplicate of #7393

There's a function getJsDoc in my package tsutils that does exactly what you want: https://github.com/ajafff/tsutils/blob/752e8024003afc23c55f1fae8fbfb015068b9c10/util/util.ts#L1226

@Raynos
Copy link
Author

Raynos commented Jan 19, 2021

Awesome, that resolves this issue.

@Raynos Raynos closed this as completed Jan 19, 2021
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

2 participants