phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
3 stars 5 forks source link

ts-status shell script #274

Closed marlitas closed 2 years ago

marlitas commented 2 years ago

A shell script that counts and keeps track of javascript and typescript lines of code and percent completeness in relevant common code repositories.

Info tracked:

zepumph commented 2 years ago

Now ts-ignore and private searches are only in typescript files.

jonathanolson commented 2 years ago

Added some additional review notes above.

marlitas commented 2 years ago

@jonathanolson Looked into the use of Number() vs. parseInt() and it seems like it's very dependent on context. Here is a pretty thorough discussion on stackOverflow.

General overview from my understanding:

Might require further discussion to determine which is better for PhET use, but I went with Number() because it would return NaN if an incorrect string was passed in and would be easier to trace errors. But maybe there's a more efficient way to do this?

jonathanolson commented 2 years ago

I wasn't actually familiar that parseInt would ignore certain content in the string (eek).

It looks like Number(...) is equivalent to a + operator cast. Since it NaNs more easily, it seems better to use in general for numbers. Perhaps we could add an integer variety that only outputs integers.

Might be worthy of dev meeting discussion.

marlitas commented 2 years ago

Created new issue for dev meeting discussion. https://github.com/phetsims/perennial/issues/275

marlitas commented 2 years ago

TS-Status script is completed and reviewed. Closing.