mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Use @typedef {Object} X
When you write @typedef {Object} ScanResult, you’re telling both JSDoc and TypeScript’s parser that this typedef represents an object type, not just an abstract name. This is important because it makes tools like IDEs, linters, and TypeScript’s JSDoc inference more reliable. It avoids ambiguity, especially in cases where the typedef might later be confused with something like a primitive, union, or function type. The official TypeScript documentation and the JSDoc spec both show this form as the canonical one for object shapes.
This commit is contained in:
parent
29dd63d1eb
commit
484cbcd960
8 changed files with 9 additions and 9 deletions
|
|
@ -60,7 +60,7 @@ function writeExitWithoutInstallingMaliciousPackages() {
|
|||
}
|
||||
|
||||
/**
|
||||
* @typedef Spinner
|
||||
* @typedef {Object} Spinner
|
||||
* @property {(message: string) => void} succeed
|
||||
* @property {(message: string) => void} fail
|
||||
* @property {() => void} stop
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue