3 ms·
// This can go all the way back to the smallest common type: listenForEvent("mouse", (event: {}) => { }); Typescript {} is a trap that means "any contain
by yencabulator 2y ago
// This can go all the way back to the smallest common type:
listenForEvent("mouse", (event: {}) => { });
Typescript {} is a trap that means "any container of things is fine" (including objects), it's not the empty struct. One of the very ugly oddities of the language..
`Record<string, never>` or something like that is the closest equivalent to an empty struct.
https://github.com/typescript-eslint/typescript-eslint/issues/2063 https://github.com/typescript-eslint/typescript-eslint/issue...