Skip to content

Generated tsdoc comments for autocomplete/intellisense #1251

Description

@kyranjamie

Description

To add tsdoc comments to the generated type definitions, containing the contents of a token's description.

Problem Statement/Justification

Consider a design system that has semantic spacing units. While it's best to focus on the semantic tokens, sometimes it's very helpful to know the underlying unit. That space.04 === 4px.

TSDoc allows annotations with /* */ comments, so these could contain the token's description.

This would be a great DX as developers can see immediately what the values are, or other useful information such as common uses, provided they're added to config.

image

With this config, the descriptions could appear:

  spacing: {
    'space.01': { value: '4px', description: '4px' },
    'space.02': { value: '8px', description: '8px' },

Proposed Solution or API

To add tsdoc comments to the generated code.

Alternatives

No response

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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