phetsims / scenery

Scenery is an HTML5 scene graph.
MIT License
55 stars 12 forks source link

TypeScript review of a few classes #1406

Open pixelzoom opened 2 years ago

pixelzoom commented 2 years ago

At 4/14/2022 TypeScript meeting, I volunteered to review:

pixelzoom commented 2 years ago

Text review:

pixelzoom commented 2 years ago

Font review:

pixelzoom commented 2 years ago

DynamicProperty review:

pixelzoom commented 2 years ago

Imageable review:

pixelzoom commented 2 years ago

Pool review:

pixelzoom commented 2 years ago

Review completed.

General questions related to PhET conventions (EDIT: I created 4 issues, one for each bullet):

Over to @jonathanolson.

pixelzoom commented 2 years ago
  • Is it OK to omit void return type, or should all methods and functions have a return type? If we omit void, does that complicate being able to confirm that there's a return type?

Verifying that methods and functions have a return type is done by compiler option noImplicitReturns. It's a boolean, so does not appear to support the option to omit void. So unless there's another way, I recommend enabling noImplicitReturns in tsconfig-core.json, then adding void return types where needed.