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

Clearer message for no-var-keyword rule #1124

Merged
merged 2 commits into from
Apr 13, 2016
Merged

Clearer message for no-var-keyword rule #1124

merged 2 commits into from
Apr 13, 2016

Conversation

ChrisMBarr
Copy link
Contributor

Instead of just telling someone what they can't do, give suggestions about how to fix it and what they should do as an alternative.

Currently the rule no-var-keyword complains with

forbidden var keyword

But that really doesn't help, especially if someone is new to TypeScript and is not even aware that let and const are possibilities.

Now it will complain with this message

forbidden 'var' keyword, use 'let' or 'const' instead

ChrisMBarr and others added 2 commits April 13, 2016 11:34
Instead of just telling someone what they can't do, give suggestions about how to fix it and what they should do as an alternative.

Currently the rule `no-var-keyword` complains with 
>forbidden var keyword
But that really doesn't help, especially if someone is new to TypeScript and is not even aware that `let` and `const` are possibilities.

Now it will complain with this message
>forbidden 'var' keyword, use 'let' or 'const' instead
@adidahiya
Copy link
Contributor

lgtm 👍 thanks @ChrisMBarr!

@adidahiya adidahiya merged commit 747f371 into palantir:master Apr 13, 2016
@ChrisMBarr ChrisMBarr deleted the patch-1 branch April 13, 2016 17:43
@ChrisMBarr
Copy link
Contributor Author

Awesome! Should this also be put in the 3.8 milestone?

@adidahiya adidahiya added this to the TSLint 3.8 milestone Apr 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants