clasp
clasp copied to clipboard
"Unattached" JSDoc Comments Removed on Push
Expected Behavior
When I have a JSDoc comment that doesn't have code immediately after it and run clasp push, the comment should be pushed to the GAS editor.
Actual Behavior
Running clasp push removes all JSDoc comments without code immediately after them.
Steps to Reproduce the Problem
Rather than steps, here's a real life example. Copy the local file and evaluate what gets pushed.
// local file
/**
* @callback EventPredicate
* @param {Calendar.CalendarEvent} event
* @returns {boolean}
*/
/**
* @callback EventPredicate
* @param {Calendar.CalendarEvent} event
* @returns {void}
*/
/**
* @typedef {Object} EventTransformationMetaData
* @property {string} eventType A string identifier so that you know why you made this object
* @property {EventPredicate} predicate The predicate used to test against an event
* @property {EventTransform} transform The transformation to run against the event when the predicate returns true
*/
/**
* @type {Array<EventTransformationMetaData>}
*/
const eventTransforms: EventTransformationMetaData[] = [];
For me, the file in the GAS editor becomes the following:
/**
​* @type {Array<EventTransformationMetaData>}
​*/
var eventTransforms = [];
Specifications
- Node version (
node -v): 16.12.0 - Version (
clasp -v): 2.4.1 - OS (Mac/Linux/Windows): Mac
This is likely a Typescript issue. See https://github.com/microsoft/TypeScript/issues/16727 if it relates to what you are experiencing.