Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Deprecate label-undefined rule (covered by compiler) #877

Closed
jkillian opened this issue Dec 16, 2015 · 3 comments
Closed

Deprecate label-undefined rule (covered by compiler) #877

jkillian opened this issue Dec 16, 2015 · 3 comments

Comments

@jkillian
Copy link
Contributor

I think the label-undefined rule is covered by tsc:

foo: while (false) { }
while (true) { break foo; }
// => error TS1116: A 'break' statement can only jump to a label of an enclosing statement.
@adidahiya
Copy link
Contributor

Is it exactly the same error? Can you try compiling labelundefined.test.ts? From a brief review of the source, it looks very similar but our rule expects labels to be in the same scope, whereas the compiler check expects the break / continue to go to a more specific location?

@jkillian
Copy link
Contributor Author

For the test file, the compiler generates lots of these:

main.ts(6,9): error TS1107: Jump target cannot cross function boundary.

Seems like its got things pretty well-covered, I'm not sure what else this rule could really check for.

@adidahiya
Copy link
Contributor

Cool, let's deprecate the rule.

@adidahiya adidahiya changed the title label-undefined rule is covered by tsc Deprecate label-undefined rule (covered by compiler) Dec 16, 2015
@adidahiya adidahiya added this to the TSLint 4.x milestone Dec 16, 2015
@adidahiya adidahiya modified the milestones: TSLint v4.x, TSLint v4.0 Aug 10, 2016
adidahiya added a commit that referenced this issue Oct 9, 2016
Resolves #877. This rule is already covered by compiler checks.
adidahiya added a commit that referenced this issue Oct 9, 2016
Resolves #877. This rule is already covered by compiler checks.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants