Re: Attempting to join to one file

19 views
Skip to first unread message

Michael J Kauzmann

unread,
Jan 3, 2022, 12:31:33 PMJan 3
to Bob Bumgarner, Developing Interactive Simulations in HTML5

Hello Bob,

Thanks for reaching out to PhET and sorry for the trouble. That error is from our linting software (code quality enforcer). At PhET we have a need to seed a sim to have identical runtimes. Because of this, we use a single instance of Random called `DOT/dotRandom`. You can take a look at usages of that and see if it would work for you.

Otherwise, this is just a lint error, and not an actual problem with the code. To get around it you can do any of the following:
* add `--lint=false` to the build command, like `grunt --brands=adapted-from-phet --lint=false`
* add `// eslint-disable-line bad-sim-text` to the end of the line that you are creating or using Random on. If you search for this string in our codebase, you should see other usages just like yours where we are alright with an unseeded random instance (like https://github.com/phetsims/kite/blob/bc7e09afea97bab68aad30aeb0fd9e57bd4fd515/js/Shape.js#L38).

I hope this is helpful. Please let us know if you run into any more issues.

Best,
Michael


Michael Kauzmann
PhET Interactive Simulations
University of Colorado
Pronouns: he/him
Michael....@Colorado.edu


On Wed, Dec 29, 2021 at 9:44 AM Bob Bumgarner <robert.r....@gmail.com> wrote:
My simulation is hung up on one message which holds up the grunt process to compile the simulation into a single file.

The command in the appropriate folder:
grunt --brands=adapted-from-phet

C:\PHET2\example-sim\js\magnets\view\MagnetsControlPanel.js
  120:25  error  bad code text: "new Random()"  bad-sim-text


This also seems to occur when I attempt to use the Math.random() in the same function.

Any help about what this message is, how it can be fixed, or where I can read more about this issue would be much appreciated.

--
You received this message because you are subscribed to the Google Groups "Developing Interactive Simulations in HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developing-interactive-simu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/developing-interactive-simulations-in-html5/17f8b028-1c78-4a23-ae22-aa167029f160n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages