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
Update typings for handlebars: Add options param to parse #31380
Update typings for handlebars: Add options param to parse #31380
Conversation
- Add optional options param to parse. This reflects the options param in the Handlebars source code. Also defines interface ParseOptions, which includes the options that have an effect on Handlebars parsing. - Fix duplicate properties in tsconfig.json. - Fix typo in import in handlebars-tests.ts. Reference Source: https://github.com/wycats/handlebars.js/blob/master/lib/handlebars/compiler/base.js#L11 Non-breaking change (new param is optional).
@zimmi88 Thank you for submitting this PR! 🔔 @borisyankov @evil-shrike - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped! |
LGTM |
@@ -1,6 +1,6 @@ | |||
|
|||
//import Handlebars = require('handlebars'); | |||
import * as Handlerbars from 'handlebars'; | |||
import * as Handlebars from 'handlebars'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This typo is good evidence that handlebars should switch to the new global syntax:
``ts
export = Handlebars;
export as namespace Handlebars;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! In parallel, I've been working to have Handlebars provide its own typings as part of the package (handlebars-lang/handlebars.js#1487), so I'll look into making this change over there (likely in a follow-up PR).
options
param toparse
. This reflects theoptions
paramin the Handlebars source code. Also defines interface
ParseOptions
,which includes the options that have an effect on Handlebars parsing.
tsconfig.json
.handlebars-tests.ts
.Reference Source:
https://github.com/wycats/handlebars.js/blob/master/lib/handlebars/compiler/base.js#L11
Non-breaking change (new param is optional).
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
.