-
-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Description
Consider this code:
import { ReactNode } from 'react';
import styles from './hero-section.module.css';
interface HeroSectionProperties {
/** Background image URL */
src: string;
/** Content to render centered within the hero */
children: ReactNode;
/** Additional CSS class names to merge */
extraClasses?: string;
/** Optional accessible label describing the background image */
backgroundLabel?: string;
}
/**
* Full-bleed hero section with background image.
*
* @returns JSX Element
*/
export function HeroSection({
src,
children,
extraClasses,
backgroundLabel,
}: HeroSectionProperties) {
// Inline style for background image to keep CSS module generic
const style = { backgroundImage: `url(${src})` } as const;
return (
<section
className={[styles['hero-section'], extraClasses].filter(Boolean).join(' ')}
style={style}
aria-label={backgroundLabel}
>
<div className={styles.content}>{children}</div>
</section>
);
}
export default HeroSection;
Using jsdoc.configs['flat/recommended-typescript'
, which includes jsdoc/require-param
, it warns about this:
Missing JSDoc @param "root0" declaration.eslint[jsdoc/require-param](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header)
Missing JSDoc @param "root0.src" declaration.eslint[jsdoc/require-param](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header)
Missing JSDoc @param "root0.children" declaration.eslint[jsdoc/require-param](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header)
Missing JSDoc @param "root0.extraClasses" declaration.eslint[jsdoc/require-param](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header)
Missing JSDoc @param "root0.backgroundLabel" declaration.eslint[jsdoc/require-param](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md#repos-sticky-header)
However, the best practice in modern code with TypeScript is to describe component properties directly using an interface or type for props, rather than relying on JSDoc @param comments for property descriptions.
Should jsdoc.configs['flat/recommended-typescript'
prefer to NOT include jsdoc/require-param
?
I did not want to open either a bug or feature request since I am not sure if this is even feasible.