3 ms·
I tried to find an example to see what you mean, take this file - https://github.com/microsoft/vscode/blob/main/src/vs/editor/common/tokenizationRegistry.ts ht
by bottlepalm 4y ago
I tried to find an example to see what you mean, take this file -
https://github.com/microsoft/vscode/blob/main/src/vs/editor/common/tokenizationRegistry.ts https://github.com/microsoft/vscode/blob/main/src/vs/editor/...
The typings on the class variables are useful to have. There are also typings on the function signatures, not a huge deal.
In the method bodies there are almost no typings as all of it is already inferred. Seems pretty readable to me.
- DogLover_ 4y agoI agree that in your example it is not bad. Throughout that codebase it is clear though that they don't have a formatter that enforces a char-limit per line. It is when you combine those things it gets messy. Prettier uses a default of 80. Looking at the code there is an awful lot of 'null's returned which I find hard to work with but that is a different topic.
- hbrn 4y agoHow about this one: https://github.com/microsoft/vscode/blob/427530e884b33be2451bb37d726841b897ba6b77/src/vs/base/browser/event.ts https://github.com/microsoft/vscode/blob/427530e884b33be2451... export interface IDomEvent { <K extends keyof HTMLElementEventMap>(element: EventHandler, type: K, useCapture?: boolean): BaseEvent<HTMLElementEventMap[K]>; (element: EventHandler, type: string, useCapture?: boolean): BaseEvent<unknown>; }