Skip to content

js-yaml: more strict loader return types#24385

Merged
sandersn merged 3 commits into
DefinitelyTyped:masterfrom
FredKSchott:patch-4
Mar 26, 2018
Merged

js-yaml: more strict loader return types#24385
sandersn merged 3 commits into
DefinitelyTyped:masterfrom
FredKSchott:patch-4

Conversation

@FredKSchott
Copy link
Copy Markdown
Contributor

@FredKSchott FredKSchott commented Mar 19, 2018

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

Rationale:

A typescript consumer should be responsible for typing the output of load(), safeLoad(), etc. However, with the current any return type, it's easy for the user to assume that these methods always return an object or an array of objects. With this fix, TS will now warn if the user defines their own return type without handling for undefined.

@FredKSchott FredKSchott requested a review from Bartvds as a code owner March 19, 2018 17:53
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Mar 19, 2018

@FredKSchott Thank you for submitting this PR!

🔔 @Bartvds @sclausen - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added Awaiting reviewer feedback Unmerged The author did not merge the PR when it was ready. labels Mar 19, 2018
@typescript-bot
Copy link
Copy Markdown
Contributor

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@sandersn sandersn merged commit ca5f99a into DefinitelyTyped:master Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Unmerged The author did not merge the PR when it was ready.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants