Relax a couple lint rules #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.