To me the best compromise between using regular javascript and having type safety is to use closure compiler. With closure compiler, you can write a 'header file' which defines the functions of the libraries that you use. Then you can write all you own code with type annotations and even check that you have 100% type coverage (--jscomp_error reportUnknownTypes).
Anywhere in your code where you are using identifiers, there should be a method to check for typos. That holds for css classes and qnames too.
Anywhere in your code where you are using identifiers, there should be a method to check for typos. That holds for css classes and qnames too.