Files
tsgo/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).errors.txt

38 lines
1.6 KiB
Plaintext

/main.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
/main.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
==== /node_modules/@types/node/index.d.ts (0 errors) ====
declare var require: (...args: any[]) => any;
==== /ambient.d.ts (0 errors) ====
declare module "fs" {
export function readFileSync(path: string, encoding?: string): string;
}
declare module "path" {
import fs = require("fs"); // ok
namespace path {
export const sep: string;
}
export = path; // ok
}
==== /mainJs.js (0 errors) ====
import {} from "./a";
import("./a");
const _ = require("./a");
_.a; // any
==== /main.ts (2 errors) ====
import {} from "./a";
import _ = require("./a"); // Error in esnext
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
export = {}; // Error
~~~~~~~~~~~~
!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
export {};
==== /a.ts (0 errors) ====
export const a = "a";