Skip to content

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

Closed
@Raynos

Description

@Raynos

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions