I'm reading through the React source code recently, and just found all the files are .js
instead of .ts
what blows up my mind more is, in those .js
files, they are actually using TypeScript syntax, including types and everything...
this could be super ignorant, but is this some kind of high-level black magic?
here's an image of my vsCode freaked out with me...
answering my own question several days later: (thanks to @Evert)
just in case anyone else has the same question in the future, React source code is written in Flow. the file extension is still .js
, and there are types in those files. if Flow isn't installed, vsCode doesn't understand what it is and just reports a bunch of bugs...
.rofl
extension is STILL a PDF. Literally nothing has changed for its content. If you tell a webapp tool to treat JS as TS files, then it will do so, applying the syntax checks and so on – Spahi.js
extension by default. – Unarmed@flow
tag in the beginning of the file (within a comment) – Illfated