(types): enforce stricter typings#475
Merged
swyxio merged 1 commit intojaredpalmer:masterfrom Feb 2, 2020
Merged
Conversation
- noUnusedParameters, noImplicitReturns, and noFallthroughCasesInSwitch - improve typings for 1 unused parameter and 1 implicit return - also remove noImplicitAny as that's redundant with strict: true
agilgur5
commented
Jan 30, 2020
| rootDir, | ||
| writeFile, | ||
| }: CreateEslintConfigArgs): Promise<CLIEngine.Options['baseConfig']> { | ||
| }: CreateEslintConfigArgs): Promise<CLIEngine.Options['baseConfig'] | void> { |
Collaborator
Author
There was a problem hiding this comment.
I typed it as void as well because it seems intentional that when --writeFile succeeds, it doesn't return config (because it does return config when it errors/the catch case), but I'm not sure if that actually is intentional.
Maybe it makes sense to return config in all cases? Idk, I don't normally touch much code outside of tsdx build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
noUnusedParameters, noImplicitReturns, and noFallthroughCasesInSwitch
also remove noImplicitAny as that's redundant with strict: true
This is the same level of strictness as in the templates and I believe the highest level of strictness (I use the same level in my own libraries too).
The description of
noImplicitReturnsis a bit different from the name, not sure if it would've helped with something like #371 or not.