Skip to content

Commit

Permalink
fix: update to use esModuleInterop in the TypeScript configuration fi…
Browse files Browse the repository at this point in the history
…les (microsoft#1211)

BREAKING CHANGE: This will affect how imports will be handled by
consumers
  • Loading branch information
janechu authored and chrisdholt committed Mar 25, 2019
1 parent 53ba14c commit 2ec0644
Show file tree
Hide file tree
Showing 475 changed files with 613 additions and 587 deletions.
2 changes: 1 addition & 1 deletion build/convert-readme.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const srcDir = argv.src || "./src/**/README.md";
*/
const startFile = `// Generated file from ../../build
/* tslint:disable */
import * as React from "react";
import React from "react";
export default class Documentation extends React.Component<{}, {}> {
public render(): JSX.Element {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from "path";
import path from "path";
import { includesAllSubdirectoriesAsNamedExports } from "./file-includes-all-subdirectories-as-named-exports";

describe("file-includes-all-subdirectories-as-named-exports.ts", (): void => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from "path";
import * as fs from "fs";
import path from "path";
import fs from "fs";
import { pascalCase } from "../../packages/fast-web-utilities";

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-animation/client/examples/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import TestPage from "./components/TestPage";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tslint:disable:no-var-requires */
import * as React from "react";
import React from "react";
const doSvg1: string = require("../assets/images/do-check.svg");
const easingCurve: string = require("../assets/images/easing-curve.svg");
const sass: string = require("../assets/styles/test-page.css");
Expand Down
1 change: 1 addition & 0 deletions packages/fast-animation/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "react",
"target": "es5",
Expand Down
1 change: 1 addition & 0 deletions packages/fast-application-utilities/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-breakpoint-tracker-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BreakpointTracker.breakpoints = [0, 800, 1024, 1559];
## Usage

```jsx
import * as React from "react";
import React from "react";
import BreakpointTracker from "@microsoft/fast-breakpoint-tracker-react";

export interface AppProps {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import React from "react";
import { configure, mount } from "enzyme";
import * as Adapter from "enzyme-adapter-react-16";
import Adapter from "enzyme-adapter-react-16";
import { Breakpoints, defaultBreakpoints } from "./breakpoints";
import BreakpointTracker from "./breakpoint-tracker";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { canUseDOM } from "exenv-es6";
import { throttle } from "lodash-es";
import { Breakpoints, defaultBreakpoints, identifyBreakpoint } from "./breakpoints";
Expand Down
1 change: 1 addition & 0 deletions packages/fast-breakpoint-tracker-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
1 change: 1 addition & 0 deletions packages/fast-browser-extensions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "react",
"target": "es5",
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-colors/src/contrast.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { adjustContrast, contrast, ensureContrast } from "./contrast";
import * as Chroma from "chroma-js";
import Chroma from "chroma-js";

const white: string = "#FFF";
const black: string = "#000";
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-colors/src/luminosity.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { luminance, luminanceSwitch } from "./luminosity";
import * as Chroma from "chroma-js";
import Chroma from "chroma-js";

describe("luminance", (): void => {
test("should adjust a color to an approximate luminance value", (): void => {
Expand Down
1 change: 1 addition & 0 deletions packages/fast-colors/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-foundation-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The foundation component for FAST component packages in React. The default expor
### Basic implementation

```jsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import Foundation from "@microsoft/fast-components-foundation-react";

class MyComponent extends Foundation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* tslint:disable:max-classes-per-file */
/* tslint:disable:no-string-literal */
import * as React from "react";
import React from "react";
import Foundation, { HandledProps, ReferenceResolver } from "./foundation";
import * as ReactTestUtils from "react-dom/test-utils";
import ReactTestUtils from "react-dom/test-utils";
import { has, merge } from "lodash-es";

class GetRefTestComponent extends Foundation<{}, {}, {}> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { get, isPlainObject, pick, set } from "lodash-es";
import { FoundationProps } from "./foundation.props";

Expand Down
1 change: 1 addition & 0 deletions packages/fast-components-foundation-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"esModuleInterop": true,
"moduleResolution": "node",
"module": "ES6",
"target": "ES6",
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Base components are the structural, semantic, and interactive core of a piece of
An example of using one of the components from the `@microsoft/fast-components-react-base` package:

```tsx
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import { ClassNames, IButtonClassNameContract } from "@microsoft/fast-components-class-name-contracts-base";
import { Button } from "@microsoft/fast-components-react-base";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";

export interface ReactHTMLElementProps {
tag?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/app/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import Site, {
componentFactory,
formChildFromExamplesFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
ChildOptionItem,
Plugin,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";

export interface AutoSuggestContextType {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
AutoSuggestClassNameContract,
ManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as Adapter from "enzyme-adapter-react-16";
import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { configure, mount, render, shallow } from "enzyme";
import AutoSuggest, { AutoSuggestUnhandledProps } from "./auto-suggest";
import ListboxItem from "../listbox-item";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import { get, isEqual } from "lodash-es";
import { KeyCodes } from "@microsoft/fast-web-utilities";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { ComponentFactoryExample } from "@microsoft/fast-development-site-react";
import schema from "./auto-suggest.schema.json";
import AutoSuggest, { AutoSuggestManagedClasses, AutoSuggestProps } from "./auto-suggest";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
BadgeClassNameContract,
ManagedClasses,
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/src/badge/badge.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as Adapter from "enzyme-adapter-react-16";
import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { configure, mount, shallow } from "enzyme";
import Badge, { BadgeHandledProps, BadgeProps, BadgeUnhandledProps } from "./index";

Expand Down
2 changes: 1 addition & 1 deletion packages/fast-components-react-base/src/badge/badge.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import { BadgeClassNameContract } from "@microsoft/fast-components-class-name-contracts-base";
import { BadgeHandledProps, BadgeUnhandledProps } from "./badge.props";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Badge, { BadgeProps } from "./index";
import schema from "./badge.schema.json";
import Documentation from "./.tmp/documentation";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
BreadcrumbClassNameContract,
ManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as Adapter from "enzyme-adapter-react-16";
import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { configure, mount, shallow, ShallowWrapper } from "enzyme";
import Breadcrumb, {
BreadcrumbClassNameContract,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import { BreadcrumbClassNameContract } from "@microsoft/fast-components-class-name-contracts-base";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { ComponentFactoryExample } from "@microsoft/fast-development-site-react";
import schema from "./breadcrumb.schema.json";
import Breadcrumb, { BreadcrumbManagedClasses, BreadcrumbProps } from "./breadcrumb";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
ButtonClassNameContract,
ManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import React from "react";
import * as ShallowRenderer from "react-test-renderer/shallow";
import * as Adapter from "enzyme-adapter-react-16";
import Adapter from "enzyme-adapter-react-16";
import { configure, shallow } from "enzyme";
import examples from "./examples.data";
import Button, {
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/src/button/button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import { get } from "lodash-es";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import { ButtonHandledProps, ButtonUnhandledProps } from "./button.props";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Button, {
ButtonHandledProps,
ButtonManagedClasses,
Expand Down
2 changes: 1 addition & 1 deletion packages/fast-components-react-base/src/card/card.props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
CardClassNameContract,
ManagedClasses,
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/src/card/card.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as Adapter from "enzyme-adapter-react-16";
import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { configure, shallow } from "enzyme";
import examples from "./examples.data";
import Card, {
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/src/card/card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import { get } from "lodash-es";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Card, {
CardHandledProps,
CardManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
CheckboxClassNameContract,
ManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import React from "react";
import * as ShallowRenderer from "react-test-renderer/shallow";
import * as Adapter from "enzyme-adapter-react-16";
import Adapter from "enzyme-adapter-react-16";
import { configure, mount, shallow, ShallowWrapper } from "enzyme";
import examples from "./examples.data";
import Checkbox, {
Expand Down
4 changes: 2 additions & 2 deletions packages/fast-components-react-base/src/checkbox/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as ReactDOM from "react-dom";
import React from "react";
import ReactDOM from "react-dom";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import {
CheckboxHandledProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Checkbox, {
CheckboxHandledProps,
CheckboxManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
ContextMenuItemClassNameContract,
ManagedClasses,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import * as Adapter from "enzyme-adapter-react-16";
import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { configure, shallow } from "enzyme";
import ContextMenuItem, {
ContextMenuItemHandledProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import Foundation, { HandledProps } from "@microsoft/fast-components-foundation-react";
import { get } from "lodash-es";
import { ContextMenuItemClassNameContract } from "@microsoft/fast-components-class-name-contracts-base";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import { ComponentFactoryExample } from "@microsoft/fast-development-site-react";
import ContextMenuItem, {
ContextMenuItemHandledProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from "react";
import React from "react";
import {
ContextMenuClassNameContract,
ManagedClasses,
Expand Down
Loading

0 comments on commit 2ec0644

Please sign in to comment.