Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

fix(typescript) remove extraneous imports #955

Closed
arichiv opened this issue Jun 28, 2019 · 2 comments
Closed

fix(typescript) remove extraneous imports #955

arichiv opened this issue Jun 28, 2019 · 2 comments

Comments

@arichiv
Copy link
Contributor

arichiv commented Jun 28, 2019

#953 adds a bunch of imports to fix an error in typescript type expansion. They should be removed at some point.

Each one looks like:

import {
  [...]
  // @ts-ignore TODO(issues/955) Remove once possible
  RippledComponentProps, // eslint-disable-line @typescript-eslint/no-unused-vars
} from '@material/react-ripple';

Each one should be reduced to:

import {
  [...]
} from '@material/react-ripple';
@arichiv
Copy link
Contributor Author

arichiv commented Jul 8, 2019

@moog16 I traced this to a typescript error not unlike microsoft/TypeScript#24874 (cc: @weswigham)

If we do not explicitly import RippledComponentProps the resulting typefile attempts a relative import at the bottom (import("../ripple").RippledComponentProps).

If we do explicitly import RippledComponentProps (and use/export it as required to avoid lint errors) the resulting typefile is able to directly use the imported type (RippledComponentProps).

This appears to be an issue in typescript resolution/expansion itself. The import at the top is left alone, but the generated one at the bottom will default to a relative import.

@arichiv arichiv changed the title [BLOCKED] fix(typescript) remove extraneous imports fix(typescript) remove extraneous imports Jul 8, 2019
@moog16
Copy link

moog16 commented Jul 8, 2019

Thanks for doing some more investigation. It sounds like this is a TypeScript bug then? We can leave this open until there is a fix and we update to that version. How does that sound?

@arichiv arichiv closed this as completed Feb 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants