google / tern-closure

A Tern plugin adding Closure support.
Apache License 2.0
32 stars 18 forks source link

Validation for goog.require('classWichDoesn'tExists #2

Open angelozerr opened 10 years ago

angelozerr commented 10 years ago

For your information, I have started tern lint https://github.com/angelozerr/tern.lint

You can validate too custom validation, like goog.require('classWichDoesn'tExists

I will happy to explain you how it works and we could discuss too how to improve it.

jgiles commented 10 years ago

This could be tricky, since at the moment we are using goog.require to define stand-in types for required names. If we were going to do validation, we would have to depend on a file finder, and flag an error if the name wasn't found. I'm not sure that we will be able to identify classes that aren't provided reliably enough to provide helpful lint errors.

angelozerr commented 10 years ago

If we were going to do validation, we would have to depend on a file finder, and flag an error if the name wasn't found.

What is the problem with file finder? If you tell me that file finder is the solution, tern lint can manage that because you can define your own lint function.

jgiles commented 10 years ago

The challenge is that a finder isn't always present, and also that finders operate asynchronously. We could probably make it work, though.