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

Show bind errors in js files #5785

Closed
mhegazy opened this issue Nov 25, 2015 · 2 comments
Closed

Show bind errors in js files #5785

mhegazy opened this issue Nov 25, 2015 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Nov 25, 2015

Bind errors for JS files should be valid errors, we should show them. The following errors i would expect to be flagged:

let C = "sss";
let C = 0;  // Error: Cannot redeclare block-scoped variable 'C'.

function f() {
    return;
    return;  // Error: Unreachable code detected.
}

function b() {
    "use strict";
    var arguments = 0;  // Error: Invalid use of 'arguments' in strict mode.
}
@mhegazy mhegazy added the Bug A bug in TypeScript label Nov 25, 2015
@mhegazy mhegazy added this to the TypeScript 1.8 milestone Nov 25, 2015
@kitsonk
Copy link
Contributor

kitsonk commented Nov 25, 2015

Isn't the second issue really a linting issue versus a syntax issue? Also, if you want to trap that as an error, you need to account for break, catch, throw as well as return. I think jshint, jslint and tslint trap all those already.

@vladima
Copy link
Contributor

vladima commented Nov 25, 2015

Reachability checks are already in master (#4788), they just were not reported for javascript files.

sheetalkamat added a commit that referenced this issue Nov 30, 2015
@sheetalkamat sheetalkamat added the Fixed A PR has been merged for this issue label Dec 7, 2015
@mhegazy mhegazy closed this as completed Dec 8, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants