Skip to content

Behavior difference: Side-effect imports of custom file extension are emitted by tsgo but not tsc #4046

@hkleungai

Description

@hkleungai

Steps to reproduce

  1. Start a plain new project
    • "@typescript/native-preview": "7.0.0-dev.20260525.1",
    • "typescript": "6.0.3"
  2. Run npx tsgo --init to get the default tsconfig. Turn on these flags as well.
    • "allowJs": true,
    • "checkJs": true,
    • "stableTypeOrdering": true,
  3. Add src/main.js & src/module.d.ts. Run npx tsc --noEmit & npx tsgo --noEmit to see the difference.
// src/main.js
import './foo.custom';

// src/module.d.ts
declare module '*.custom';

Behavior with typescript@6.0

export {};
//# sourceMappingURL=main.d.ts.map

Behavior with tsgo

import './foo.custom';
//# sourceMappingURL=main.d.ts.map

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions