Created by: lacker
I tried applying these lint rules to a couple random projects I had lying around and ran into some frustrations. I suggest these two tweaks.
-
no-new
is now a warning instead of an error. Sometimes you have an API where all you need to do is create an object; you don't need to do anything else with it. You can usually get around the lint rule by doing something trivial, but there's no reason not to run the resulting code. -
no-unused-vars
is now a warning instead of an error, and doesn't apply to function arguments. There's plenty of times when you have a variable and haven't used it yet but you want to see the intermediate results. Also, there are cases when it's weird to omit unused function arguments. Like when you are creating a promise with new Promise(resolve, reject), it is odd to omit reject. Or if you are using an API based on inheritance, it is odd to omit args from the signature that you don't use.