Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-var-before-return: add fixer #33

Open
ajafff opened this issue Sep 30, 2017 · 1 comment
Open

no-var-before-return: add fixer #33

ajafff opened this issue Sep 30, 2017 · 1 comment

Comments

@ajafff
Copy link
Owner

ajafff commented Sep 30, 2017

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";
}
@ajafff
Copy link
Owner Author

ajafff commented Oct 2, 2017

turn out to be not as easy as I thought. The fixer needs to handle destructuring as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant