diff --git a/package.json b/package.json index 9670ad32b..3abfd2f30 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,9 @@ ], "dependencies": { "@angular/compiler": "17.3.2", - "@babel/code-frame": "7.23.5", - "@babel/parser": "7.23.9", - "@babel/types": "7.23.9", + "@babel/code-frame": "7.24.2", + "@babel/parser": "7.24.4", + "@babel/types": "7.24.0", "@glimmer/syntax": "0.88.1", "@iarna/toml": "2.2.5", "@prettier/is-es5-identifier-name": "0.2.0", @@ -106,7 +106,7 @@ "yaml-unist-parser": "2.0.1" }, "devDependencies": { - "@babel/generator": "7.23.6", + "@babel/generator": "7.24.4", "@eslint/eslintrc": "3.0.2", "@eslint/js": "8.57.0", "@glimmer/reference": "0.88.1", diff --git a/scripts/build/config.js b/scripts/build/config.js index 716fab259..34c1fc205 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -494,15 +494,7 @@ const nonPluginUniversalFiles = [ path: path.join(dirname, "./shims/babel-highlight.js"), }, { - module: require.resolve("chalk", { - paths: [require.resolve("@babel/code-frame")], - }), - path: path.join(dirname, "./shims/chalk.cjs"), - }, - { - module: require.resolve("chalk", { - paths: [require.resolve("vnopts")], - }), + module: require.resolve("chalk"), path: path.join(dirname, "./shims/chalk.cjs"), }, ], diff --git a/tests/format/js/explicit-resource-management/__snapshots__/jsfmt.spec.js.snap b/tests/format/js/explicit-resource-management/__snapshots__/jsfmt.spec.js.snap index 5af60a31d..e617cd8d7 100644 --- a/tests/format/js/explicit-resource-management/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/js/explicit-resource-management/__snapshots__/jsfmt.spec.js.snap @@ -48,7 +48,7 @@ printWidth: 80 exports[`invalid-duplicate-using-bindings.js [acorn] format 1`] = ` "Unexpected token (2:9) 1 | { -> 2 | using f, f = foo(); +> 2 | using f = foo(), f = foo(); | ^ 3 | } 4 | { @@ -59,7 +59,7 @@ Cause: Unexpected token (2:8)" exports[`invalid-duplicate-using-bindings.js [espree] format 1`] = ` "Unexpected token f (2:9) 1 | { -> 2 | using f, f = foo(); +> 2 | using f = foo(), f = foo(); | ^ 3 | } 4 | { @@ -70,7 +70,7 @@ Cause: Unexpected token f" exports[`invalid-duplicate-using-bindings.js [flow] format 1`] = ` "Unexpected identifier, expected the end of an expression statement (\`;\`) (2:9) 1 | { -> 2 | using f, f = foo(); +> 2 | using f = foo(), f = foo(); | ^ 3 | } 4 | { @@ -80,7 +80,7 @@ exports[`invalid-duplicate-using-bindings.js [flow] format 1`] = ` exports[`invalid-duplicate-using-bindings.js [meriyah] format 1`] = ` "Unexpected token: 'identifier' (2:9) 1 | { -> 2 | using f, f = foo(); +> 2 | using f = foo(), f = foo(); | ^ 3 | } 4 | { @@ -88,17 +88,6 @@ exports[`invalid-duplicate-using-bindings.js [meriyah] format 1`] = ` Cause: [2:9]: Unexpected token: 'identifier'" `; -exports[`invalid-duplicate-using-bindings.js [typescript] format 1`] = ` -"'using' declarations must be initialized. (2:9) - 1 | { -> 2 | using f, f = foo(); - | ^ - 3 | } - 4 | { - 5 | using g = foo(); -Cause: 'using' declarations must be initialized." -`; - exports[`invalid-duplicate-using-bindings.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -106,7 +95,7 @@ printWidth: 80 | printWidth =====================================input====================================== { - using f, f = foo(); + using f = foo(), f = foo(); } { using g = foo(); @@ -115,7 +104,7 @@ printWidth: 80 =====================================output===================================== { - using f, + using f = foo(), f = foo(); } { diff --git a/tests/format/js/explicit-resource-management/invalid-duplicate-using-bindings.js b/tests/format/js/explicit-resource-management/invalid-duplicate-using-bindings.js index d04dedd0e..833b376dd 100644 --- a/tests/format/js/explicit-resource-management/invalid-duplicate-using-bindings.js +++ b/tests/format/js/explicit-resource-management/invalid-duplicate-using-bindings.js @@ -1,5 +1,5 @@ { - using f, f = foo(); + using f = foo(), f = foo(); } { using g = foo(); diff --git a/tests/format/js/explicit-resource-management/jsfmt.spec.js b/tests/format/js/explicit-resource-management/jsfmt.spec.js index 3e9c681cd..1eb54cb79 100644 --- a/tests/format/js/explicit-resource-management/jsfmt.spec.js +++ b/tests/format/js/explicit-resource-management/jsfmt.spec.js @@ -25,8 +25,6 @@ runFormatTest(import.meta, ["babel", "flow", "typescript"], { "valid-module-block-top-level-await-using-binding.js", ], typescript: [ - "invalid-duplicate-using-bindings.js", - // https://github.com/typescript-eslint/typescript-eslint/blob/4f34d0ba34474926ba1eed623704b583a037f886/packages/typescript-estree/src/convert.ts#L1035-L1050 "valid-for-using-declaration.js", "valid-await-using-comments.js", diff --git a/yarn.lock b/yarn.lock index a99a525be..10f996448 100644 --- a/yarn.lock +++ b/yarn.lock @@ -45,13 +45,13 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:7.23.5, @babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.4": - version: 7.23.5 - resolution: "@babel/code-frame@npm:7.23.5" +"@babel/code-frame@npm:7.24.2, @babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.4": + version: 7.24.2 + resolution: "@babel/code-frame@npm:7.24.2" dependencies: - "@babel/highlight": "npm:^7.23.4" - chalk: "npm:^2.4.2" - checksum: 10/44e58529c9d93083288dc9e649c553c5ba997475a7b0758cc3ddc4d77b8a7d985dbe78cc39c9bbc61f26d50af6da1ddf0a3427eae8cc222a9370619b671ed8f5 + "@babel/highlight": "npm:^7.24.2" + picocolors: "npm:^1.0.0" + checksum: 10/7db8f5b36ffa3f47a37f58f61e3d130b9ecad21961f3eede7e2a4ac2c7e4a5efb6e9d03a810c669bc986096831b6c0dfc2c3082673d93351b82359c1b03e0590 languageName: node linkType: hard @@ -85,15 +85,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:7.23.6, @babel/generator@npm:^7.23.3, @babel/generator@npm:^7.23.4, @babel/generator@npm:^7.7.2": - version: 7.23.6 - resolution: "@babel/generator@npm:7.23.6" +"@babel/generator@npm:7.24.4, @babel/generator@npm:^7.23.3, @babel/generator@npm:^7.23.4, @babel/generator@npm:^7.7.2": + version: 7.24.4 + resolution: "@babel/generator@npm:7.24.4" dependencies: - "@babel/types": "npm:^7.23.6" - "@jridgewell/gen-mapping": "npm:^0.3.2" - "@jridgewell/trace-mapping": "npm:^0.3.17" + "@babel/types": "npm:^7.24.0" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" jsesc: "npm:^2.5.1" - checksum: 10/864090d5122c0aa3074471fd7b79d8a880c1468480cbd28925020a3dcc7eb6e98bedcdb38983df299c12b44b166e30915b8085a7bc126e68fa7e2aadc7bd1ac5 + checksum: 10/69e1772dcf8f95baec951f422cca091d59a3f29b5eedc989ad87f7262289b94625983f6fe654302ca17aae0a32f9232332b83fcc85533311d6267b09c58b1061 languageName: node linkType: hard @@ -217,23 +217,24 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.0.0, @babel/highlight@npm:^7.23.4": - version: 7.23.4 - resolution: "@babel/highlight@npm:7.23.4" +"@babel/highlight@npm:^7.0.0, @babel/highlight@npm:^7.24.2": + version: 7.24.2 + resolution: "@babel/highlight@npm:7.24.2" dependencies: "@babel/helper-validator-identifier": "npm:^7.22.20" chalk: "npm:^2.4.2" js-tokens: "npm:^4.0.0" - checksum: 10/62fef9b5bcea7131df4626d009029b1ae85332042f4648a4ce6e740c3fd23112603c740c45575caec62f260c96b11054d3be5987f4981a5479793579c3aac71f + picocolors: "npm:^1.0.0" + checksum: 10/4555124235f34403bb28f55b1de58edf598491cc181c75f8afc8fe529903cb598cd52fe3bf2faab9bc1f45c299681ef0e44eea7a848bb85c500c5a4fe13f54f6 languageName: node linkType: hard -"@babel/parser@npm:7.23.9, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.3, @babel/parser@npm:^7.23.4": - version: 7.23.9 - resolution: "@babel/parser@npm:7.23.9" +"@babel/parser@npm:7.24.4, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.3, @babel/parser@npm:^7.23.4": + version: 7.24.4 + resolution: "@babel/parser@npm:7.24.4" bin: parser: ./bin/babel-parser.js - checksum: 10/727a7a807100f6a26df859e2f009c4ddbd0d3363287b45daa50bd082ccd0d431d0c4d0e610a91f806e04a1918726cd0f5a0592c9b902a815337feed12e1cafd9 + checksum: 10/3742cc5068036287e6395269dce5a2735e6349cdc8d4b53297c75f98c580d7e1c8cb43235623999d151f2ef975d677dbc2c2357573a1855caa71c271bf3046c9 languageName: node linkType: hard @@ -420,14 +421,14 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:7.23.9, @babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.3, @babel/types@npm:^7.23.4, @babel/types@npm:^7.23.6, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": - version: 7.23.9 - resolution: "@babel/types@npm:7.23.9" +"@babel/types@npm:7.24.0, @babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.3, @babel/types@npm:^7.23.4, @babel/types@npm:^7.24.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.8.3": + version: 7.24.0 + resolution: "@babel/types@npm:7.24.0" dependencies: "@babel/helper-string-parser": "npm:^7.23.4" "@babel/helper-validator-identifier": "npm:^7.22.20" to-fast-properties: "npm:^2.0.0" - checksum: 10/bed9634e5fd0f9dc63c84cfa83316c4cb617192db9fedfea464fca743affe93736d7bf2ebf418ee8358751a9d388e303af87a0c050cb5d87d5870c1b0154f6cb + checksum: 10/a0b4875ce2e132f9daff0d5b27c7f4c4fcc97f2b084bdc5834e92c9d32592778489029e65d99d00c406da612d87b72d7a236c0afccaa1435c028d0c94c9b6da4 languageName: node linkType: hard @@ -1579,14 +1580,14 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.2": - version: 0.3.3 - resolution: "@jridgewell/gen-mapping@npm:0.3.3" +"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" dependencies: - "@jridgewell/set-array": "npm:^1.0.1" + "@jridgewell/set-array": "npm:^1.2.1" "@jridgewell/sourcemap-codec": "npm:^1.4.10" - "@jridgewell/trace-mapping": "npm:^0.3.9" - checksum: 10/072ace159c39ab85944bdabe017c3de15c5e046a4a4a772045b00ff05e2ebdcfa3840b88ae27e897d473eb4d4845b37be3c78e28910c779f5aeeeae2fb7f0cc2 + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10/81587b3c4dd8e6c60252122937cea0c637486311f4ed208b52b62aae2e7a87598f63ec330e6cd0984af494bfb16d3f0d60d3b21d7e5b4aedd2602ff3fe9d32e2 languageName: node linkType: hard @@ -1597,10 +1598,10 @@ __metadata: languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.0.1": - version: 1.1.2 - resolution: "@jridgewell/set-array@npm:1.1.2" - checksum: 10/69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 10/832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 languageName: node linkType: hard @@ -1611,13 +1612,13 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.20 - resolution: "@jridgewell/trace-mapping@npm:0.3.20" +"@jridgewell/trace-mapping@npm:^0.3.12, @jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" dependencies: "@jridgewell/resolve-uri": "npm:^3.1.0" "@jridgewell/sourcemap-codec": "npm:^1.4.14" - checksum: 10/683117e4e6707ef50c725d6d0ec4234687ff751f36fa46c2b3068931eb6a86b49af374d3030200777666579a992b7470d1bd1c591e9bf64d764dda5295f33093 + checksum: 10/dced32160a44b49d531b80a4a2159dceab6b3ddf0c8e95a0deae4b0e894b172defa63d5ac52a19c2068e1fe7d31ea4ba931fbeec103233ecb4208953967120fc languageName: node linkType: hard @@ -7275,10 +7276,10 @@ __metadata: resolution: "prettier@workspace:." dependencies: "@angular/compiler": "npm:17.3.2" - "@babel/code-frame": "npm:7.23.5" - "@babel/generator": "npm:7.23.6" - "@babel/parser": "npm:7.23.9" - "@babel/types": "npm:7.23.9" + "@babel/code-frame": "npm:7.24.2" + "@babel/generator": "npm:7.24.4" + "@babel/parser": "npm:7.24.4" + "@babel/types": "npm:7.24.0" "@eslint/eslintrc": "npm:3.0.2" "@eslint/js": "npm:8.57.0" "@glimmer/reference": "npm:0.88.1"