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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11 #10546

Merged
merged 3 commits into from Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@angular/compiler": "11.2.6",
"@babel/code-frame": "7.12.13",
"@babel/parser": "7.13.10",
"@babel/parser": "7.13.11",
"@glimmer/syntax": "0.77.3",
"@iarna/toml": "2.2.5",
"@typescript-eslint/typescript-estree": "4.16.1",
Expand Down
8 changes: 7 additions & 1 deletion src/language-js/print/typescript.js
Expand Up @@ -457,8 +457,14 @@ function printTypescript(path, options, print) {
if (node.isExport) {
parts.push("export ");
}

parts.push("import ");

if (node.importKind && node.importKind !== "value") {
parts.push(node.importKind, " ");
}

parts.push(
"import ",
path.call(print, "id"),
" = ",
path.call(print, "moduleReference")
Expand Down
40 changes: 40 additions & 0 deletions tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -81,3 +81,43 @@ type T = [x<y>: A];

================================================================================
`;

exports[`type-import-equals-declaration.ts format 1`] = `
====================================options=====================================
parsers: ["babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
import type A = require("foo");
export import type = require("A");

import type
A = require("A");

import
type
a = require("a");

export import
type
B = require("B");

export
import
type
b = require("b");

=====================================output=====================================
import type A = require("foo");
export import type = require("A");

import type A = require("A");

import type a = require("a");

export import type B = require("B");

export import type b = require("b");

================================================================================
`;
18 changes: 18 additions & 0 deletions tests/misc/typescript-babel-only/type-import-equals-declaration.ts
@@ -0,0 +1,18 @@
import type A = require("foo");
export import type = require("A");

import type
A = require("A");

import
type
a = require("a");

export import
type
B = require("B");

export
import
type
b = require("b");
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -283,10 +283,10 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@7.13.10", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10":
version "7.13.10"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.10.tgz#8f8f9bf7b3afa3eabd061f7a5bcdf4fec3c48409"
integrity sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ==
"@babel/parser@7.13.11", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10":
version "7.13.11"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.11.tgz#f93ebfc99d21c1772afbbaa153f47e7ce2f50b88"
integrity sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q==

"@babel/plugin-proposal-async-generator-functions@^7.13.8":
version "7.13.8"
Expand Down