prettier eslint – Something feels wrong with Typescript settings in project
While developing API routes and UI components, I have been in the habit of creating jsdocs for the functions.
Lately I have noticed a change I am not very happy with that is no longer allowing the exact defined object or interface to be written into the jsdoc, but instead is wanting only primitive values.
Previous code, that is now throwing linting errors:
/**
* @param {string} id The mongo-generated unique id for the Request.
* @param {ContactEntity} data The request body for creating a new entity.
* @returns {Promise>} Returns a Promise that resolves to the Generic Response structure containing the newly created entity
* @throws {object} throws BadRequestException when the incoming request fails due to invalid parameters.
*/
New code it wants.
/**
* @param {string} id The mongo-generated unique id for the Request.
* @param {object} data The request body for creating a new entity.
* @returns {Promise
While I believe there is a time and place for using primitive values, I feel it loses much of the luster to typecasting and documentation.
Read more here: Source link
