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

[ts] Add `asserts: false` to `TSTypePredicate` node #12167

Merged
merged 1 commit into from Oct 13, 2020

Conversation

@sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Oct 13, 2020

Q                       A
Fixed Issues? N/A
Patch: Bug Fix? Y
Major: Breaking Change? N
Minor: New Feature? N
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

When babel-parser parses asserts function, it attach asserts: true to TSTypePredicate.

However, when parsing the normal type predication function, it doesn't attach asserts: false to TSTypePredicate.

typescript-eslint/typescript-estree adds asserts: true/false to both. This PR aligns AST for Babel and typescript-estree. (ref: https://github.com/typescript-eslint/typescript-eslint/blob/c41dbe56e0514846e4d21fc5fcd8847da50e92c6/packages/typescript-estree/tests/ast-alignment/utils.ts#L259-L268)

Please close this PR if the current behavior is intentional😄

@babel-bot
Copy link
Collaborator

@babel-bot babel-bot commented Oct 13, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/29855/

@codesandbox
Copy link

@codesandbox codesandbox bot commented Oct 13, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5f78410:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration
@nicolo-ribaudo nicolo-ribaudo merged commit a5bed04 into babel:main Oct 13, 2020
15 of 16 checks passed
15 of 16 checks passed
Prepare Cache
Details
Test on Node.js Latest
Details
Build Babel Artifacts
Details
Test on Node.js (13)
Details
Test on Node.js (12)
Details
Test on Node.js (10)
Details
Test on Node.js (8)
Details
Test on Node.js (6)
Details
test262-pr Workflow: test262-pr
Details
Gitpod Open an online workspace in Gitpod
Details
Travis CI - Pull Request Build Passed
Details
babel/repl REPL preview is available
Details
build-standalone Workflow: build-standalone
Details
ci/codesandbox Building packages succeeded.
Details
codecov/project 91.75% (target 90.00%)
Details
e2e Workflow: e2e
Details
@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 13, 2020

Thanks!

@sosukesuzuki sosukesuzuki deleted the sosukesuzuki:align-asserts-property branch Oct 13, 2020
@fisker fisker mentioned this pull request Oct 15, 2020
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.