Skip to content

Use export type syntax and update es build #5552

Closed

Description

@thompsongl

Rather than use the proptypes-from-ts-props plugin to remove type exports from es build output, we should move towards using the type indicator syntax and upgrade any babel tooling to take advantage.

Before:

export { EuiButton, EuiButtonProps } from './button';

After:

export { EuiButton } from './button';
export type { EuiButtonProps } from './button';

eslint can be configured to replace these automatically.

Activity

  1. cee-chen commented on Jan 24, 2022

    @cee-chen
    Contributor

    Options for automatic eslint catching/fixing:

    I'm leaning towards the first since we already have @typescript-eslint listed as a devDependency. I'll spike out an investigation into adding the rule and running --fix on it and get you a working draft PR @thompsongl

  2. cee-chen commented on Jan 24, 2022

    @cee-chen
    Contributor

    Ah neat, I had assumed based on your above example you would want fixMixedExportsWithInlineTypeSpecifier: false which disallows inline types, e.g. export { x, type T };

    Any preference?

  3. cee-chen commented on Jan 24, 2022

    @cee-chen
    Contributor

    #5554

    The above draft PR adds export type fixing, but does not do any extra work around removing proptypes-from-ts-props or updating our compile scripts - I wasn't sure what that entailed and didn't want to fuck it up, so was hoping you could carry the PR the rest of the way 🤞

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