phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

How can we specify type for sim in Dialog.ts without introducing a dependency on joist? #776

Closed jbphet closed 2 years ago

jbphet commented 2 years ago

In the SelfOptions type definition in Dialog.ts is the following bit of code:

  //TODO https://github.com/phetsims/chipper/issues/1253 type Sim will introduce a dependency on joist
  sim?: any;

In the class definition we have:

  private readonly sim: any; //TODO https://github.com/phetsims/chipper/issues/1253 type Sim will introduce a dependency on joist

The comments are pretty clear - the any keyword is being used to avoid introducing a dependency on joist. The other usages of any in sun were addressed under https://github.com/phetsims/chipper/issues/1253, but I'm not sure what to do about this one, or whether to just disable the rule for these lines. I'm going to disable the check for now, and assign to one of the authors of the code for followup.

samreid commented 2 years ago

Since we are no longer using project references, it is easier for repos to depend on each other when necessary. I specified the Sim type and it seems to be working well. Closing, but @jbphet or anyone feel free to reopen for review or discussion.