palantir/tslint — pull request #120 by brainling (2014-03-23 07:17:20+00:00)
Title: Split variable decleration rules in to regular and member variants

In my code, I tend to use implicit typing (inference) on local variables, but I like to have clearly defined types on class members. I made a small tweak to tslint to allow you to specify the rules for member variables and other types of declarations separately.

To do this, we need to handle walking VariableDeclaration and MemberVariableDeclaration separately in the rule, which requires a slight tweak to the way normal variables are handled. As you can see, we now loop through the list of declarators and check each individually as we are walking through the root declaration node.

I also tweaked the test slightly to test for variable lists in the form var x = y, z = a, since we are now walking the declarator list ourselves rather than visiting each declarator.