pbomb / flow-immutable-models

Generates model classes from Flow types using Immutable.js
42 stars 8 forks source link

Automatic import for necessary packages #10

Closed object88 closed 7 years ago

object88 commented 7 years ago

Addressing #4, this PR does several things:

1) Treats all code attached to and below the "cutline" comment as disposable, and will be removed and regenerated entirely when the model is rebuilt. 2) If the reference to ImmutableModel is missing, it will be added, below the cutline. 3) If the reference to * as Immutable is missing, it will be added, below the cutline.

There's some refactoring that could be done.

object88 commented 7 years ago

Restarting this PR, merging from object88:master. #

pbomb commented 7 years ago

I think we should add the missing imports as the first non-commented line instead of after the cutline so we don't break common eslint rules like this one