bad.ts(1,10): error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.
bad.ts(1,10): error TS1484: 'Date' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
bad.ts(1,10): error TS2866: Import 'Date' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled.
bad.ts(1,16): error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.
bad.ts(1,16): error TS1484: 'Event' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
bad.ts(1,16): error TS2866: Import 'Event' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled.
good.ts(2,10): error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.


==== ./types.ts (0 errors) ====
    export interface Date {
        day: number;
        month: number;
        year: number;
    }
    
    export namespace Event {
        export type T = any;
    }
    
==== ./node.d.ts (0 errors) ====
    declare module 'node:console' {
        global {
            interface Console {
                Console: console.ConsoleConstructor;
            }
            namespace console {
                interface ConsoleConstructor {
                    prototype: Console;
                    new (): Console;
                }
            }
            var console: Console;
        }
        export = globalThis.console;
    }
    
==== ./bad.ts (6 errors) ====
    import { Date, Event } from './types';
             ~~~~
!!! error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.
             ~~~~
!!! error TS1484: 'Date' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
             ~~~~
!!! error TS2866: Import 'Date' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled.
                   ~~~~~
!!! error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.
                   ~~~~~
!!! error TS1484: 'Event' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
                   ~~~~~
!!! error TS2866: Import 'Event' conflicts with global value used in this file, so must be declared with a type-only import when 'isolatedModules' is enabled.
    function foo(a: Date) {
        const b = new Date(a.year, a.month, a.day);
        return b.getTime();
    }
    function bar() {
        return new Event('bar') as Event.T;
    }
    
==== ./good.ts (1 errors) ====
    import type { Date, Event } from './types';
    import { Console } from 'node:console';
             ~~~~~~~
!!! error TS1295: ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript.
    function foo(a: Date) {
        const b = new Date(a.year, a.month, a.day);
        return b.getTime();
    }
    function bar() {
        return new Event('bar') as Event.T;
    }
    const baz: Console = new Console();
    