cli icon indicating copy to clipboard operation
cli copied to clipboard

Support for JSDoc style comments

Open degrootsam opened this issue 2 years ago • 1 comments

Having JSDoc styled comments in the component set crashes the compiler. Here is an example

/**
 * Prints a greeting message with the given name.
 * If no name is provided, it defaults to 'world'.
 *
 * @param {string} [name] - The name to greet.
 * @returns {void}
 */
const helloWorld = (name = 'world') => {
    console.log(`Hello ${name}!`);
}

The example above causes the following error message:

TypeError in customFilterComponent.js: Cannot read properties of undefined (reading 'reduce')

This feature can help a lot of developers get started faster when customizing the already existing component set library. It can also help developers when collaborating on a custom component ^^.

degrootsam avatar Jan 29 '24 12:01 degrootsam

@degrootsam it only seems to work when you include the name tag as well, like so:

/**
 * Prints a greeting message with the given name.
 * If no name is provided, it defaults to 'world'.
 *
 * @name helloWorld
 * @param {string} [name] - The name to greet.
 * @returns {void}
 */
const helloWorld = (name = 'world') => {
    console.log(`Hello ${name}!`);
}

But I agree that it should also work without this tag, because in some cases it would make no sense.

RobD-tech avatar Jun 24 '24 19:06 RobD-tech