Skip to content
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

add assertShape to validate templateElement #10198



Copy link

@tanhauhau tanhauhau commented Jul 11, 2019

Should we update the templateElement's validator and update the docs as well?

@sebmck need your advice, because i saw you left a TODO there.

Q                       A
Fixed Issues? Fixes #10195
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT
@tanhauhau tanhauhau force-pushed the tanhauhau:tanhauhau/validate-template-element branch from 0342134 to 5dc839d Jul 11, 2019
Copy link

@babel-bot babel-bot commented Jul 11, 2019

Build successful! You can test your changes in the REPL here:

Copy link

@nicolo-ribaudo nicolo-ribaudo commented Jul 11, 2019

If you run make build does it updates the generated flow/typescript types?

Copy link
Member Author

@tanhauhau tanhauhau commented Jul 11, 2019


// index.js.flow
declare function templateElement(value: {raw:string, cooked:string}, tail?: boolean): BabelNodeTemplateElement;

// index.d.ts
export function templateElement(value: {raw:string, cooked:string}, tail?: boolean): TemplateElement;
Co-Authored-By: Nicolò Ribaudo <>
@nicolo-ribaudo nicolo-ribaudo merged commit ee68d6d into babel:master Jul 14, 2019
4 checks passed
4 checks passed
babel/repl REPL preview is available
ci/circleci Your tests passed on CircleCI!
codecov/project 87.58% (target 80%)
continuous-integration/travis-ci/pr The Travis CI build passed
AdamRamberg added a commit to AdamRamberg/babel that referenced this pull request Jul 17, 2019
* add assertShape to validate templateElement

* Update packages/babel-types/src/definitions/utils.js

Co-Authored-By: Nicolò Ribaudo <>

* templateElement optional cooked
@lock lock bot added the outdated label Oct 13, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants