Skip to content

Poor type alias emitted in composite project declaration files #36551

@JasonGore

Description

@JasonGore

TypeScript Versions: 3.7.4, 3.8.0-dev.20200131

Search Terms:

composite project declaration type alias emitted

Code

Steps to repro:

  • git clone https://github.com/JasonGore/office-ui-fabric-react.git
  • cd office-ui-fabric-react
  • git checkout jg/ts-composite-emit
  • yarn
  • yarn buildto styling

A build error will result due to an API error. This API error is caused by the emit described below.

Expected behavior:

The code in getFocusStyle.ts:

export const getInputFocusStyle = (
  ...
  borderRadius: string | number,

emits in packages/styling/lib/styles/getFocusStyle.d.ts as:

export declare const getInputFocusStyle: (
...
borderRadius: string | number,

Actual behavior:

getFocusStyle.ts emits as:

export declare const getInputFocusStyle: (
...
borderRadius: import("@uifabric/merge-styles/lib/IRawStyleBase").ICSSPixelUnitRule,

ICSSPixelUnitRule is a type that's used nowhere inside of packages/styling. The correct output can be obtained by commenting out composite in packages/styling/tsconfig.json and tsBuildInfoFile in ts.js (to prevent a TS error on having it specified without composite.)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions