简体   繁体   中英

JSDoc syntax error when trying to deploy Firebase functions

I'm getting a JSDoc syntax error pointing to the first line of my JSDoc comment where it says /** . Not sure what else I need to fix.

/**
 * Gets any field value from a user's User collection.
 * @param {number} IDType 0 = uid, 1 = username.
 * @param {string} inputID the input ID, based on the IDType.
 * @param {string} desiredField the desired field value.
 * @returns {number, string, string} 1/0, error message, desired info.
 */
async function getUserInfo(
    IDType: number
    , inputID: string
    , desiredField: string
): Promise<[number, string, string]> {
 //...

Just install JSDoc Lint... while three return values appear strange to me:

@returns {number, string, string} 1/0, error message, desired info.

And I'm probably right, because the documentation doesn't use any comma.

@returns {number|string} 1/0, error message or desired info.

The return type should be just Promise as documentation shows.

/**
 * ...
 * @returns {Promise} 1/0, error message, desired info.
 */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM