Skip to content

API: fix types for strict null checks #20909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2018
Merged

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Dec 27, 2017

While experimenting with ParseConfigHost I noticed that not all parameters to readDirectory are always defined. This PR updates these parameter's type annotations.

In addition I implemented a CompilerHost and noticed that I cannot simply return the result of ts.resolveModuleName(...).resolvedModule from CompilerHost.resolveModuleNames because the returned array does not accept undefined values. The code that uses this array has checks for undefined values, so I figured the return type annotation is not correct.

@ajafff ajafff changed the title API: fix types to undefined union API: fix types for strict null checks Jan 5, 2018
@ajafff ajafff closed this Jan 5, 2018
@ajafff ajafff reopened this Jan 5, 2018
@mhegazy mhegazy merged commit bc2983d into microsoft:master Jan 6, 2018
errendir added a commit to errendir/TypeScript that referenced this pull request Jan 7, 2018
* origin/master: (61 commits)
  Add release-2.7 to covered branches
  LEGO: check in for master to temporary branch.
  LEGO: check in for master to temporary branch.
  API: fix types to undefined union (microsoft#20909)
  Fix conflict between formatting rules (microsoft#21038)
  Switch to block-bodied lambda
  Better name for deferred mapped type:ReverseMapped
  Slightly simplify getCodeActions
  Make fixCannotFindModule return an empty array if there is no code action
  In checkAndAggregateReturnExpressionTypes, treat MethodDeclaration in an object literal same as a FunctionExpression (microsoft#20052)
  Return string completions for indexed access types
  Check for unused getter/setter in classes (microsoft#21013)
  Only replace `implements` with a comma if the heritage clauses are sensible
  Refine extends-to-implements code fix
  Fix version of @types/node to 8.5.5 (microsoft#21019)
  fix microsoft#20449, insert space between decorators (microsoft#20491)
  findConfigFile can return undefined (microsoft#20556)
  Allowed trailing commas in type parameter/argument lists (microsoft#20599)
  Added localization instructions to CONTRIBUTING.md (microsoft#20451)
  Simplify marker names
  ...
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
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