milesj / packemon

📦 Build and prepare packages for npm distribution using standardized configurations and practices. Gotta pack 'em all!
https://packemon.dev
MIT License
208 stars 3 forks source link

Types *must* be imported with `type` keyword when TS `compilerOptions.verbatimModuleSyntax` is `true` #249

Closed BinToss closed 4 months ago

BinToss commented 5 months ago

If this file is intended to be built with verbatimModuleSyntax disabled or if this file shouldn't be imported by other packages, then close this issue as "not planned".


Types.ts imports interfaces from @babel/core, rollup, and @boost/common without the type keyword. Typescript prohibits this when 'verbatimModuleSyntax' is enabled.

node_modules/packemon/src/types.ts:1:10 - error TS1484: 'OutputOptions' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

1 import { OutputOptions as RollupOutputOptions, RollupOptions } from 'rollup';
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/packemon/src/types.ts:1:48 - error TS1484: 'RollupOptions' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

1 import { OutputOptions as RollupOutputOptions, RollupOptions } from 'rollup';
                                                 ~~~~~~~~~~~~~

node_modules/packemon/src/types.ts:2:10 - error TS1484: 'TransformOptions' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

2 import { TransformOptions as BabelOptions } from '@babel/core';
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/packemon/src/types.ts:3:10 - error TS1484: 'PackageStructure' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

3 import { PackageStructure } from '@boost/common';
           ~~~~~~~~~~~~~~~~