CleverCloud / clever-components

Collection of Web Components by Clever Cloud
https://www.clever-cloud.com/doc/clever-components/
Apache License 2.0
215 stars 19 forks source link

cem: get rid of primitives in BUILTIN_TYPES in the typedef plugin #1028

Open Galimede opened 2 months ago

Galimede commented 2 months ago

We use primitives in the plugin (String, Boolean, Number, BigInt) with a starting uppercase. While it can be okay for TS as it replicates them in an interface, they're not considered as true primitives by TypeScript. It causes some problems for the numbers, if you try to add two numbers with a Number type, TS will not understand it. As it's inconsistent and not true primitives, we should remove them from the array and maybe throw an error.

Please note: these are used for the events too, but we already type the primitives as lowercase in this case.