Skip to content

example template should enable ES module interop #538

@slikts

Description

@slikts

Currently the React template uses the non-standard TS default import syntax:

import * as React from 'react';
import * as ReactDOM from 'react-dom';

This is unnecessarily confusing for users and exists in the language for legacy reasons, and instead the esModuleInterop compiler option should be used that enables just using standard ES6 default import syntax:

import React from 'react';
import ReactDOM from 'react-dom';

The main tsconfig.json already has esModuleInterop enabled, but the Parcel example even disables allowSyntheticDefaultImports for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: templatesRelated to an init template, not necessarily to core (but could influence core)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions