cli
cli copied to clipboard
Support for JSDoc style 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 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.