BeyondCodeBootcamp / BeyondCodeBootcamp/js-with-types-jsdoc-tsc-starter

Bug in tsc: can't use `@function ...` (must use `@callback ...`)

Open
#7 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
19
Forks
1
PR merge metrics
No merged PRs in 30d

Description

See https://github.com/microsoft/TypeScript/issues/50274

## ❌ Invalid for `tsc`: `@typedef {Function}`

```js
/**
* @typedef {Function} PersonGreet
* @param {String} name - other's name
* @returns {String} - the greeting
*/
```

```js
/**
* @function PersonGreet
* @param {String} name - other's name
* @returns {String} - the greeting
*/
```

## ⚠️ Workaround: `@callback`

It's confusing, but it's our option.

```js
/**
* @callback PersonGreet
* @param {String} name - other's name
* @returns {String} - the greeting
*/
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.