Documentation comment not found for arrow function
unique
101 const [modalOpen, modalHandler] = useDisclosure(false)
102 const { t } = useTranslation(['suggestOrg', 'attribute'])
103 const selectedCurr = useMemo(() => form.values.communityFocus ?? [], [form.values.communityFocus])
104 const unique = (ids: string[]) => [...new Set(ids)]105 const selectedCountIcon = useMemo(() => {
106 const selectedItems = form.values.communityFocus?.length ?? 0
107 return selectedItems > 0 ? <Text className={classes.count}>{selectedItems}</Text> : null
Documentation comment not found for arrow function
Communities
94 communities: NonNullable<ApiOutput['organization']['suggestionOptions']>['communities']
95}
96
97export const Communities = ({ disabled, communities }: CommunitiesModalProps) => { 98 const { classes } = useStyles()
99 const form = useFormContext()
100 const variants = useCustomVariant()
Documentation comment not found for arrow function
Loading
510
511 return 'useMenu' in iconRender ? menuComponent : buttonComponent
512}
513const Loading = () => <Skeleton h={22} w={70} radius={8} />514
515ActionButtons.Loading = Loading
516ActionButtons.Save = Save
Documentation comment not found for arrow function
action
380 * @returns A function which returns a JSX.Element
381 */
382 const generic = (Component: Polymorphic | ComponentType) => {
383 const action = ({ isMenu, children, props }: Generic) => {384 if (isMenu)
385 return (
386 <Component component={Menu.Item} className={classes.item} {...{ isMenu, ...props }}>
Documentation comment not found for arrow function
handleCopy
334 /** Strip out unused props to prevent react errors */
335 const { organizationId: _org, serviceId: _serv, isMenu: _isMenu, ...restProps } = props
336
337 const handleCopy = () => {338 const href = `${window.location.origin}${asPath}`
339 clipboard.copy(href)
340 copiedToClipboard()
Documentation comment not found for arrow function
clickHandler
149 },
150 onError: errorRemoving,
151 })
152 const clickHandler = () => {153 if (action === 'save') {
154 saveItem.mutate(data)
155 } else {
Documentation comment not found for arrow function
useNotifications
14
15import { useStyles } from './styles'
16
17const useNotifications = (listName: string) => { 18 const { t } = useTranslation('common')
19
20 return {
Description
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
Bad Practice
function sum(a, b) {
return a + b;
}
Recommended
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}