egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.46k stars 209 forks source link

arrow style functions are missing comments #1131

Open darrenvechain opened 1 month ago

darrenvechain commented 1 month ago

I'm not sure if this is the expected behaviour, but arrow style functions are missing comments when building with tsup

myfile.ts

/**
 * Comment 1
 */
function formatUnits(
    value: bigint | number | string,
    decimalsOrUnit: bigint | number | WEI_UNITS = VET_DECIMAL_EXPONENT
): string { ... }

/**
 * Comment 2
 */
const formatVET = (value: bigint | number | string): string => {
    return formatUnits(value, VET_DECIMAL_EXPONENT);
};

export const unitsUtils = {
    formatUnits, // function
    formatVET, // arrow function
};

dist/index.d.ts


/**
 * Comment 1
 */
declare function formatUnits(value: bigint | number | string, decimalsOrUnit?: bigint | number | WEI_UNITS): string;

declare const unitsUtils: {
    formatUnits: typeof formatUnits; // navigates to the type with original comments
    formatVET: (value: bigint | number | string) => string; // is missing the original comments
};

Upvote & Fund

Fund with Polar