Skip to content

Commit

Permalink
Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11 (#10546)
Browse files Browse the repository at this point in the history
* Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.10 to 7.13.11.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.13.11/packages/babel-parser)

Signed-off-by: dependabot[bot] <support@github.com>

* Format type imports in TSImportEqualsDeclaration

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: sosukesuzuki <aosukeke@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
  • Loading branch information
3 people committed Mar 22, 2021
1 parent 199be1a commit 5a789f5
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 6 deletions.
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

0 comments on commit 5a789f5

Please sign in to comment.