tslint-consistent-codestyle
tslint-consistent-codestyle copied to clipboard
no-var-before-return: add fixer
trafficstars
Should be easy to implement.
Some things to consider:
function f() {
var a = foo(), b = bar(a, a);
return b;
}
function f() {
var a = foo();
return bar(a, a);
}
function f() {
var a: {} = "foo"; // move annotation to funtion signature, iff this is the only return
return a;
}
function f(): {} {
return "foo";
}
turn out to be not as easy as I thought. The fixer needs to handle destructuring as well