diff --git a/package.json b/package.json index b88cdb6e8..70290f04e 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "dependencies": { "@angular/compiler": "15.1.1", "@babel/code-frame": "7.18.6", - "@babel/parser": "7.20.7", + "@babel/parser": "7.20.13", "@babel/types": "7.20.7", "@glimmer/syntax": "0.84.2", "@iarna/toml": "2.2.5", diff --git a/tests/format/typescript/const/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/const/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..5037245d4 --- /dev/null +++ b/tests/format/typescript/const/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,43 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`initializer-ambient-context.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +declare module N { + enum E { + ok = 0 + } + + export const string = "2"; + export const number = 1.; + export const bigint = 0n; + export const negative_bigint = -0n; + export const negative_number = -1; + export const template = \`-2\`; + export const False = false; + export const True = true; + export const E_ok = E.ok; +} + +=====================================output===================================== +declare module N { + enum E { + ok = 0, + } + + export const string = "2"; + export const number = 1; + export const bigint = 0n; + export const negative_bigint = -0n; + export const negative_number = -1; + export const template = \`-2\`; + export const False = false; + export const True = true; + export const E_ok = E.ok; +} + +================================================================================ +`; diff --git a/tests/format/typescript/const/initializer-ambient-context.ts b/tests/format/typescript/const/initializer-ambient-context.ts new file mode 100644 index 000000000..4571e8b96 --- /dev/null +++ b/tests/format/typescript/const/initializer-ambient-context.ts @@ -0,0 +1,15 @@ +declare module N { + enum E { + ok = 0 + } + + export const string = "2"; + export const number = 1.; + export const bigint = 0n; + export const negative_bigint = -0n; + export const negative_number = -1; + export const template = `-2`; + export const False = false; + export const True = true; + export const E_ok = E.ok; +} diff --git a/tests/format/typescript/const/jsfmt.spec.js b/tests/format/typescript/const/jsfmt.spec.js new file mode 100644 index 000000000..29084a9c8 --- /dev/null +++ b/tests/format/typescript/const/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(import.meta, ["typescript"]); diff --git a/yarn.lock b/yarn.lock index 96ebfdcaf..4c2684302 100644 --- a/yarn.lock +++ b/yarn.lock @@ -228,12 +228,12 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:7.20.7, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.11": - version: 7.20.7 - resolution: "@babel/parser@npm:7.20.7" +"@babel/parser@npm:7.20.13, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.18.10, @babel/parser@npm:^7.18.11": + version: 7.20.13 + resolution: "@babel/parser@npm:7.20.13" bin: parser: ./bin/babel-parser.js - checksum: 25b5266e3bd4be837092685f6b7ef886f1308ff72659a24342eb646ae5014f61ed1771ce8fc20636c890fcae19304fc72c069564ca6075207b7fbf3f75367275 + checksum: 7eb2e3d9d9ad5e24b087c88d137f5701d94f049e28b9dce9f3f5c6d4d9b06a0d7c43b9106f1c02df8a204226200e0517de4bc81a339768a4ebd4c59107ea93a4 languageName: node linkType: hard @@ -6725,7 +6725,7 @@ __metadata: "@angular/compiler": 15.1.1 "@babel/code-frame": 7.18.6 "@babel/generator": 7.20.7 - "@babel/parser": 7.20.7 + "@babel/parser": 7.20.13 "@babel/types": 7.20.7 "@esbuild-plugins/node-modules-polyfill": 0.1.4 "@glimmer/reference": 0.84.2