The linting is failing because we're embedding functions inside a while, which unfortunately does unintuitive thing with JavaScript's function scoping. I think we should trust the linter on this one.

Also, I think there might be an issue with this.

1. We iterate over `resource.models[i].properties` and collecting the models into `requiredModelNames`
2. When we find a new model, we indicate that we have more things to process
3. However, when we indicate that we have more things to process, we don't actually add anything new to `resource.models` or `resource.models[i].properties`, therefore I don't see how subsequent iterations will result in anything new being processed

New things are added to `resource.models` after the `while` loop, when it is too late to recursively process them.

This seems it might be better suited for a recursive function to fix the scoping issue, and a bit of re-thought if my thoughts about a bug here are warranted.