Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set esModuleInterop as default config of parse #511

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HUST-SE-LY
Copy link

The React namespace is exported as CommonJs. As stated in TypeScript's Doc, we should always enable esModuleInterop.

Without esModuleInterop, example below will produce incorrect result because tsc cannot handle the default import(such as import React from 'react') of a CommonJs module correctly

import React from 'react';

export interface JumbotronProps {
  /** prop1 description */
  prop1: string;
}

/**
 * Jumbotron description
 */
export const Jumbotron: React.FC<JumbotronProps> = props => {
  return <div>Test</div>;
};

Currently, we always import React using the default import syntax. Additionally, when using tsc --init, esModuleInterop is enabled by default. For these reasons, I believe it is time to set esModuleInterop as the default configuration for the parse API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant