From 79487987ec2b70842a9d8e6007b34b71bd33df1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 04:47:20 +0000 Subject: [PATCH 001/237] Build(deps-dev): Bump webpack-cli from 4.3.1 to 4.4.0 in /website (#10090) --- website/package.json | 2 +- website/yarn.lock | 58 ++++++++++++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/website/package.json b/website/package.json index 40a2107ad..964cb66b0 100644 --- a/website/package.json +++ b/website/package.json @@ -24,6 +24,6 @@ "js-yaml": "4.0.0", "svgo": "1.3.2", "webpack": "5.17.0", - "webpack-cli": "4.3.1" + "webpack-cli": "4.4.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index caafd986a..59b0662a1 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1222,6 +1222,11 @@ "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" +"@webpack-cli/configtest@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.0.tgz#2aff5f1ebc6f793c13ba9b2a701d180eab17f5ee" + integrity sha512-Un0SdBoN1h4ACnIO7EiCjWuyhNI0Jl96JC+63q6xi4HDUYRZn8Auluea9D+v9NWKc5J4sICVEltdBaVjLX39xw== + "@webpack-cli/info@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.1.tgz#af98311f983d0b9fce7284cfcf1acaf1e9f4879c" @@ -1229,10 +1234,10 @@ dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.2.1.tgz#7513d7a769e3f97958de799b5b49874425ae3396" - integrity sha512-Zj1z6AyS+vqV6Hfi7ngCjFGdHV5EwZNIHo6QfFTNe9PyW+zBU1zJ9BiOW1pmUEq950RC4+Dym6flyA/61/vhyw== +"@webpack-cli/serve@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.2.2.tgz#1f8eee44f96524756268f5e3f43e9d943f864d41" + integrity sha512-03GkWxcgFfm8+WIwcsqJb9agrSDNDDoxaNnexPnCCexP5SCE4IgFd9lNpSy+K2nFqVMpgTFw6SwbmVAVTndVew== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -1989,6 +1994,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + clone-response@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" @@ -6520,6 +6534,13 @@ setprototypeof@1.1.1: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -7382,14 +7403,15 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webpack-cli@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.3.1.tgz#87a7873bc9c6a4708aa657759274b691e72a04a8" - integrity sha512-/F4+9QNZM/qKzzL9/06Am8NXIkGV+/NqQ62Dx7DSqudxxpAgBqYn6V7+zp+0Y7JuWksKUbczRY3wMTd+7Uj6OA== +webpack-cli@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.4.0.tgz#38c7fa01ea31510f5c490245dd1bb28018792f1b" + integrity sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ== dependencies: "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^1.0.0" "@webpack-cli/info" "^1.2.1" - "@webpack-cli/serve" "^1.2.1" + "@webpack-cli/serve" "^1.2.2" colorette "^1.2.1" commander "^6.2.0" enquirer "^2.3.6" @@ -7399,14 +7421,15 @@ webpack-cli@4.3.1: interpret "^2.2.0" rechoir "^0.7.0" v8-compile-cache "^2.2.0" - webpack-merge "^4.2.2" + webpack-merge "^5.7.3" -webpack-merge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.2.tgz#a27c52ea783d1398afd2087f547d7b9d2f43634d" - integrity sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g== +webpack-merge@^5.7.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.7.3.tgz#2a0754e1877a25a8bbab3d2475ca70a052708213" + integrity sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA== dependencies: - lodash "^4.17.15" + clone-deep "^4.0.1" + wildcard "^2.0.0" webpack-sources@^2.1.1: version "2.1.1" @@ -7492,6 +7515,11 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +wildcard@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec" + integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" From fecc0c3b62fa85fadfcce2fee486199f4c4e843f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 06:05:43 +0000 Subject: [PATCH 002/237] Build(deps-dev): Bump cspell from 4.2.5 to 4.2.8 (#10130) --- package.json | 2 +- yarn.lock | 415 ++++++++++++++++++++++++++------------------------- 2 files changed, 211 insertions(+), 206 deletions(-) diff --git a/package.json b/package.json index 8ed634c75..4b86a5910 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "benchmark": "2.1.4", "builtin-modules": "3.2.0", "cross-env": "7.0.3", - "cspell": "4.2.5", + "cspell": "4.2.8", "eslint": "7.18.0", "eslint-config-prettier": "7.2.0", "eslint-formatter-friendly": "7.0.0", diff --git a/yarn.lock b/yarn.lock index 7c7e41cbe..f3ab08c39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -871,170 +871,170 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@cspell/dict-aws@^1.0.12": - version "1.0.12" - resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-1.0.12.tgz#34fab54e0cc8ce0384c9e298fe584a3290d4eea2" - integrity sha512-2jI3VCdizeFssndayOco36HiTnWVG6SYc49sMazSdu/hJwKdvoT/5CX5qXOG6I0hU+L0Q964pGjhk05NTFeG2g== +"@cspell/dict-aws@^1.0.13": + version "1.0.13" + resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-1.0.13.tgz#5961c9764a2f731e488debee1c70fd488ee59727" + integrity sha512-9rq8BS5p418THq12PIkLQmGhg4kQ8tMH8vyB7gTF2lOrA+xMwV5HjZAepoYiJCxDQI5GAQJZlAaBi5DRG3AN2A== -"@cspell/dict-bash@^1.0.10": +"@cspell/dict-bash@^1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-1.0.11.tgz#5ba56250e467d2c2ed3f2795081f4934af0c9afc" + integrity sha512-DTOugbPacEFIav5s+VniByouu4apD1SKS5inwiBndw0TH3Pkm4MFTPUwfT1y7Ki4HEIyfRI2ughig2045SBqRw== + +"@cspell/dict-companies@^1.0.35": + version "1.0.35" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-1.0.35.tgz#3f244e005afa533cdec8896ceaf866c82d77251a" + integrity sha512-lFoXFqXgAUjj14t7VJm+D/j9jU9kn4Eud+Q2gVQTKs6+oMivJ0hROpqZv/CEYHlm/4MpP5Livp0z0E6ARCE0kQ== + +"@cspell/dict-cpp@^1.1.37": + version "1.1.37" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-1.1.37.tgz#79b33a42ebc0d7bed19bd8d07559e95c8668a70a" + integrity sha512-1X48pxiOdAw5Q7zj0k8/L5B1YY2W0k4go4CB5rcsuGRzsWXsdnKXHQTeMTAw7epIe4lj+Ef9oWaU+ODQpDZOCQ== + +"@cspell/dict-cryptocurrencies@^1.0.10": version "1.0.10" - resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-1.0.10.tgz#223e0f676dbbf8f928bbf502ccf2166498edbb96" - integrity sha512-xYEOfGeqJUvGr5EPggMA9b/LQt3bw7k29pXeLHbpOymbAmb1rYVg69oSItZDMXenqG/KjNdx885qKtJA3OlRkQ== + resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-1.0.10.tgz#04426fdfee8752818b375686d34a154b2fb40c7d" + integrity sha512-47ABvDJOkaST/rXipNMfNvneHUzASvmL6K/CbOFpYKfsd0x23Jc9k1yaOC7JAm82XSC/8a7+3Yu+Fk2jVJNnsA== -"@cspell/dict-companies@^1.0.34": - version "1.0.34" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-1.0.34.tgz#2ce261c9c8de1637a721828c18593268a6c24f1c" - integrity sha512-zwCa+8Z/du3WOwH2pzEQynckIKMHi2ZoK+VYDRz2/+jatpueOYoPJRjMKpTAigQuOEXM7k5y5XR9piyrrteYWA== +"@cspell/dict-csharp@^1.0.10": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-1.0.10.tgz#3806ff6646764f720ac02a0eb65d6b97b99811fe" + integrity sha512-jAl4HeRTwbN2+tEqL8cjM7GLXSJr9Jde3k8CqfxKME7qwVRCoBW6RkhyDHfEyaQ1LomDhnr35uiHEVrw7xCHMw== -"@cspell/dict-cpp@^1.1.36": - version "1.1.36" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-1.1.36.tgz#138e845074a5bb42a1d97da3eb3e531175005a1c" - integrity sha512-c2jWVVPWTzEV+puML05NeZRk+loUve6uonLRrL1L6WhZDKNEE6HJCqTPw7E91xck75fl3UPhriYrVNOE5UAInQ== +"@cspell/dict-css@^1.0.10": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-1.0.10.tgz#80ef4e89ec83a8386a69d9770b76184a2c26370e" + integrity sha512-QQbh+GBAyTVU8Wlf1xZPxZQQ3uRzb1lYE5RjE7hnRTSc4HtWYcb2+6XpO51QDl/dRhCmP3vEHzFF/swzHRa5hw== -"@cspell/dict-cryptocurrencies@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-1.0.9.tgz#babe24a0e11a04027829f08442547f3b68231cc5" - integrity sha512-n7P4uIO3cykPFxST5DJFEpdgCg6HzmMuO+RBpIj9oW+urRHrg97LrIVrMa8Xqk2eJ1hnFWnWyUm8JA8g8ego0w== +"@cspell/dict-django@^1.0.25": + version "1.0.25" + resolved "https://registry.yarnpkg.com/@cspell/dict-django/-/dict-django-1.0.25.tgz#7f821e781b2ae35bc12491a663ca506185f6d008" + integrity sha512-kQfZhvjAodb5CNgryYoEKlUaHA+IVGhZIpON5ZJBuxrPUZ4SyklACPXKxDyXnKAibrERoi4zNL6pBbsljEL03w== -"@cspell/dict-csharp@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-1.0.9.tgz#937a07ad265cd9deca2576f498def742bc1fff9f" - integrity sha512-GHEOX40Bk4OeDL/RgW1MIrMH7S3oEnrjIpsh+cOTWBxsqj25LcOCF0pA7c9zsjbJy9xTMS2ZRL3iBVU8AaS6rg== - -"@cspell/dict-css@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-1.0.9.tgz#44a2e817768f0bf0ea1606a8a5d42b0dd6316c11" - integrity sha512-S2mJEZRZ0oF+RqfbGNkmWIf/5uDUN6mIveUXRrOPatX42gTUiZZ0iIpdjadeW9Eg/M8f2u7LjKlqT6bZ39azjA== - -"@cspell/dict-django@^1.0.24": +"@cspell/dict-dotnet@^1.0.24": version "1.0.24" - resolved "https://registry.yarnpkg.com/@cspell/dict-django/-/dict-django-1.0.24.tgz#7b9a9b23cfc7472677eca9bda6ad3515d7b218f6" - integrity sha512-Fwx1XMVMhd2CL7aW0W8S8hDyMnsl6ipah3H1YIb/m+IemdISZYy1zk+EplXmQxuReausk7IRtQMXWvvtiEhWRQ== + resolved "https://registry.yarnpkg.com/@cspell/dict-dotnet/-/dict-dotnet-1.0.24.tgz#432a1f3bf6920860de86a6e7101639c1b4e348be" + integrity sha512-TxmMSh2T7C+DzF0rGTwVWFGCwqiwqLpyKar37kJt62bhadbxFKv+XxkLjOLVmgoqhA17BXM813hIjjZrICj4jg== -"@cspell/dict-dotnet@^1.0.23": +"@cspell/dict-elixir@^1.0.23": version "1.0.23" - resolved "https://registry.yarnpkg.com/@cspell/dict-dotnet/-/dict-dotnet-1.0.23.tgz#0482a052e35d50430d8824d47812d1c07cbe3dfe" - integrity sha512-st7Kbzf88L4ZWh4+5y2S66ub7D/VU+gS1m15avYu6qFGOMq/xxZViudHfv4rqPSoEo8aOwOYb7k7pFCH8D5yqA== - -"@cspell/dict-elixir@^1.0.22": - version "1.0.22" - resolved "https://registry.yarnpkg.com/@cspell/dict-elixir/-/dict-elixir-1.0.22.tgz#2fbf1bb5c3ac84793e3e403462592435519982a3" - integrity sha512-Ik4UDk9o0LH3wVPyEFpT4syiZMWrkdPzKxQDKuQXhveHtayIQvTSQ3AeoNOSSu9w0EGYWyYY4ZNX6Cwbk2vxqg== + resolved "https://registry.yarnpkg.com/@cspell/dict-elixir/-/dict-elixir-1.0.23.tgz#1d341626467a2ca109b72c5368645af1f12417a4" + integrity sha512-UKDgNSZ36o31IX4NjCF/lCuOAoLEEsjSB2KwMD2ucT66MSFEPLk1womGY+iWblISeeBmB9EehfL1hjgoRwGlUw== "@cspell/dict-en-gb@^1.1.27": version "1.1.27" resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.27.tgz#5c567fcc0f737e9ac8dc8fa76eb39928a6a2b35b" integrity sha512-0tY939q0vzmsUotKQe/i8mDGqiiw4V3Kv/nkTvxFfVQAd6JRfpWBKlMbVV5Oy37nQkQiwkDLY4v90AbyqOvG8Q== -"@cspell/dict-en_us@^1.2.37": - version "1.2.37" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-1.2.37.tgz#3e45e4c43bd3cbacdddadec449e565eb0b51749c" - integrity sha512-03QYjVBsjCYzDOkK0GKAF0YmshPwXp56efgN1uYd1BS5t5lMOFix/5hH8UYuBK2o2db0o/Kuw5GWMgKtBkO/5Q== +"@cspell/dict-en_us@^1.2.39": + version "1.2.39" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-1.2.39.tgz#44e30abee9a20ec3cbddd2c91f21de7e3b4ca4ea" + integrity sha512-rMn5pIm3bl+t3Qxdf3WMkLZ2kzs/FDHSCDR9ha+JOtCJ1yrJTLdlZvokGDLwMScztbgooEvabsN8AUqPutOSog== -"@cspell/dict-filetypes@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-1.1.4.tgz#ccfda35c3c52ce3a6493b31a7a9817de119ebb78" - integrity sha512-X3+noNfQQr3u/oL/RkD3Vg+R+3H1lV+m8Kdn2nfCkkLaDen3/QQ8Z9NM7vbm1zwyTlIKGcM3u1IqKIwhAXQOqA== +"@cspell/dict-filetypes@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-1.1.5.tgz#d1024eb0ae3b316e3e9411e2f36e624844345563" + integrity sha512-yfkB37J+hL6W8qa4AknFp7u6CGECrw2ql2/y0lUKruLQYid0ApK+bH+ll+Sqgl2YS5QAOhclskc72aQHAcRJIQ== -"@cspell/dict-fonts@^1.0.12": +"@cspell/dict-fonts@^1.0.13": + version "1.0.14" + resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-1.0.14.tgz#7b18129910d30bd23cd9187d0c0009dfc3fef4ba" + integrity sha512-VhIX+FVYAnqQrOuoFEtya6+H72J82cIicz9QddgknsTqZQ3dvgp6lmVnsQXPM3EnzA8n1peTGpLDwHzT7ociLA== + +"@cspell/dict-fullstack@^1.0.36": + version "1.0.36" + resolved "https://registry.yarnpkg.com/@cspell/dict-fullstack/-/dict-fullstack-1.0.36.tgz#47c9d1b515405751be40cc177608e1ea6d121c02" + integrity sha512-npScBMAoZsjVE5uC1I72vmM1FCYnqzHH1ujgiBkbKd6Dp73VZ1f6OtpSQgqq9/onb0mSmMVF2kw4gPj8BlwGHg== + +"@cspell/dict-golang@^1.1.24": + version "1.1.24" + resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-1.1.24.tgz#3830812aec816eca46a6d793fcc7710c09d4f5b9" + integrity sha512-qq3Cjnx2U1jpeWAGJL1GL0ylEhUMqyaR36Xij6Y6Aq4bViCRp+HRRqk0x5/IHHbOrti45h3yy7ii1itRFo+Xkg== + +"@cspell/dict-haskell@^1.0.12": version "1.0.12" - resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-1.0.12.tgz#1a081bf5ec7bc1dbffa2f93fc01d60142097285e" - integrity sha512-BVvU9YoXf7EhTk4m+oLWxkSAVDWS994q10YhsR5QNQ5SejuMsmBIyqph0hoBidXvhIE5B736zPLoMkqon7NNig== + resolved "https://registry.yarnpkg.com/@cspell/dict-haskell/-/dict-haskell-1.0.12.tgz#cc6ec4d0466b029683e9f861dea3d0e95c514606" + integrity sha512-JrSSuV2oY8Z1/qYi8j1w5M3eokiFkcpRtCrxpKlHYFXFEvmqTH9D8qvzVbAkrQpefMppy8uIUzknSzhwAc/MQA== -"@cspell/dict-fullstack@^1.0.35": - version "1.0.35" - resolved "https://registry.yarnpkg.com/@cspell/dict-fullstack/-/dict-fullstack-1.0.35.tgz#a6580fe86cf3bdcef9f650429a0e98e3c643979a" - integrity sha512-gTnxIeZ9A3dW/qBCvl2ZuQqE+IeL5uOHmrTFw7tA+mLEgknNUwSdmoGu82pmH/sTbH223U07nSglNqhY0hH/Wg== +"@cspell/dict-html-symbol-entities@^1.0.23": + version "1.0.23" + resolved "https://registry.yarnpkg.com/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-1.0.23.tgz#0efbdbc7712c9fbe545e14acac637226ac948f2d" + integrity sha512-PV0UBgcBFbBLf/m1wfkVMM8w96kvfHoiCGLWO6BR3Q9v70IXoE4ae0+T+f0CkxcEkacMqEQk/I7vuE9MzrjaNw== -"@cspell/dict-golang@^1.1.23": - version "1.1.23" - resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-1.1.23.tgz#724acc8cc8f2c212a77992c2f96849885fae98a4" - integrity sha512-FE1IenW5vFLaRk4AFhVYRlWKQhqjFApQ76+2dDxJdDxLIWOC+EOJmIBP4asAD57NT/Dz7sKw4grtkLu4vB+s9Q== +"@cspell/dict-html@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@cspell/dict-html/-/dict-html-1.1.5.tgz#45e7a3e23c27f248b4fab962ce71efdc23a0d9fd" + integrity sha512-ecwFDcponQgLpC9VJK7SRAbLu3CAlw6KUSlLtVOiN3zxlh27MDCCMp9jCD4UImZGACe0YQ1Zj0DW7PjXkHuKHg== -"@cspell/dict-haskell@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-haskell/-/dict-haskell-1.0.11.tgz#b81553e4f34ae4276106028730cfc0e879cf3ec7" - integrity sha512-sE0+Hnl+/iUc9rbHQHSZF9r0AP2SxnXRL7IbLDhy/zCrBMgvsYNOgRjC9tI0uxr5vRTEgBKumrUIduXiI0GICA== - -"@cspell/dict-html-symbol-entities@^1.0.22": +"@cspell/dict-java@^1.0.22": version "1.0.22" - resolved "https://registry.yarnpkg.com/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-1.0.22.tgz#6eef114162d8d5a97b8aa04b08315ccab73c6a5f" - integrity sha512-Ai4nho7DRRwsXeez0Lc8PPOoN5A060aAv0ICQmB4YjpA2YVvVTmz6/mI6JbTJFF3V+WKd7YK448PuccNlUgDcQ== + resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-1.0.22.tgz#30e660803922755c314fb61e9c8cd58a1f4bd47e" + integrity sha512-CVAJ29dx1XwwutgsMgaj5eCl1Nc7X7qFhWL2KkAdu78A/NUIaS+1I9KS0hHhdZx/wLke9dH8TR7NyPQGpGxeAw== -"@cspell/dict-html@^1.1.4": - version "1.1.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-html/-/dict-html-1.1.4.tgz#0b61f731807bd268b2f116e5755b93bf8ee4774f" - integrity sha512-torS96vNxwdwliAj77FGswqZlPZmTgZrtLu+5S1JRhGrNN2wVDRJvKG2KiiiFq4qP+xiRlWlpTybRGa6ldZkFQ== +"@cspell/dict-latex@^1.0.23": + version "1.0.23" + resolved "https://registry.yarnpkg.com/@cspell/dict-latex/-/dict-latex-1.0.23.tgz#bb216e676c66b931bdfd1c8cb93e9625b5b66d45" + integrity sha512-xn9VvX5+q9xxELiOl5o8W/0nKympOc9i6Bq6PqX3fxhVWV4xURT18sp14OI9dNXxOSm5TRzL96vgLYvK/FYQVw== -"@cspell/dict-java@^1.0.21": +"@cspell/dict-lorem-ipsum@^1.0.22": + version "1.0.22" + resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-1.0.22.tgz#a89f53dadda7d5bfdb978ab61f19d74d2fb69eab" + integrity sha512-yqzspR+2ADeAGUxLTfZ4pXvPl7FmkENMRcGDECmddkOiuEwBCWMZdMP5fng9B0Q6j91hQ8w9CLvJKBz10TqNYg== + +"@cspell/dict-lua@^1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-1.0.16.tgz#c0ca43628f8927fc10731fd27cd9ee0af651bf6a" + integrity sha512-YiHDt8kmHJ8nSBy0tHzaxiuitYp+oJ66ffCYuFWTNB3//Y0SI4OGHU3omLsQVeXIfCeVrO4DrVvRDoCls9B5zQ== + +"@cspell/dict-node@^1.0.10": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-1.0.10.tgz#ed78fd80cb99087a817bc7773e64f1e8431171b5" + integrity sha512-MnLy0pOcd+Zo8+M8VmumrIQN5SuAduZZrYKHhvXfxdVfX5vl5BfD6Gl25hzH0DrlAVlJOWAnkMZZFMYh4nGWRA== + +"@cspell/dict-npm@^1.0.10": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-1.0.10.tgz#327ad3855effcfbf6d2dbb6f655ed29e729dd7a8" + integrity sha512-LxLjMOyELWtVBHpive60G3MJseid30M9GR5Vodo9cT6lqT1CkbdsNP9j3oTwVXHTMKB3I+IOHNapuFG1ILcEew== + +"@cspell/dict-php@^1.0.23": + version "1.0.23" + resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-1.0.23.tgz#8ee85fec8416a88b71edb2a53e26a79f280c9fa7" + integrity sha512-rRLf/09rXDrzs0DJuNXNmFVTw2b2zLmZKNF4LIPrFHYHvdfsMvwVqxkr/SAyhF8C6zi5sW0XYC/J0S/3IE927w== + +"@cspell/dict-powershell@^1.0.14": + version "1.0.14" + resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-1.0.14.tgz#f8998f2f413b3b94e69a512117de89552cfa1834" + integrity sha512-hisOXXi5PBXB5YKtrJQIis2FIRHgSW1U0/sd4yI36lzb3ZMEvGJwdAdyhXN3IGiqRUNxMzJiXAeXfhnia4xPtQ== + +"@cspell/dict-python@^1.0.32": + version "1.0.33" + resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-1.0.33.tgz#39ddf401f63ee9b0f95e606d70693e61976a073b" + integrity sha512-tRmE4TzHDFPs7sJ1a3XbfyFrvRHwefVz+z1wkm6tkXK9TPrCbIS+rV/T8xhj205q4lpZQ/TkNB3lT40eLB9O8A== + +"@cspell/dict-ruby@^1.0.12": + version "1.0.12" + resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-1.0.12.tgz#85af4c0c7e0d03c39115d4a2d1944befe31e04f8" + integrity sha512-1qGZpVbfWfGLujKFyt2Nd9bc7rNXdkjYIRfpGmn/fwVDhWz/D4Q8GLMQPB2ixocSuF3pjfsRTh1D+rKK17WFjg== + +"@cspell/dict-rust@^1.0.22": + version "1.0.22" + resolved "https://registry.yarnpkg.com/@cspell/dict-rust/-/dict-rust-1.0.22.tgz#4558e528c1e1aa2b0f1677d5918fa822106013e5" + integrity sha512-7WOIzv0BPiU+MssZbbMk8K+HR/g9Bcvd0+jXJC3/AKT8L6l0Mx0Tr/oF7cJ4xvCYgA84nBz3PhMZkabGSz/Nkg== + +"@cspell/dict-scala@^1.0.21": version "1.0.21" - resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-1.0.21.tgz#6ef37ebf743e8070f3537b49b000e20c361bb714" - integrity sha512-jgrJmwyOXixGbXjvIny/fptFrNzFvBnMkYKDWQYHsHK7zrv0+RFFmWIQLLBvtnnX98hT2dhGmoR/tiZnsa6Xvg== + resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-1.0.21.tgz#bfda392329061e2352fbcd33d228617742c93831" + integrity sha512-5V/R7PRbbminTpPS3ywgdAalI9BHzcEjEj9ug4kWYvBIGwSnS7T6QCFCiu+e9LvEGUqQC+NHgLY4zs1NaBj2vA== -"@cspell/dict-latex@^1.0.22": - version "1.0.22" - resolved "https://registry.yarnpkg.com/@cspell/dict-latex/-/dict-latex-1.0.22.tgz#6989acbf1c043c6de247c42dde66a272f61acf50" - integrity sha512-DlPbT1XE3gAla1ogIlG4BeYIT+ql2o5iYBqlj2iqhE8wyH54UGLKObmBx8K+tQqIKsQm5NfoNZ7uBcGXBwcQww== +"@cspell/dict-software-terms@^1.0.24": + version "1.0.25" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-1.0.25.tgz#a42c488ebf0169727386b5ea7981ac2e40212014" + integrity sha512-GOHfmGT/X7QsKXFKS8riPVXI7jOTfcjSz/mzoUP8t1kOTkp+8qw+hxsQ31Z4Ctz5ZI7sh0xpFFYDNFFzG5XWgw== -"@cspell/dict-lorem-ipsum@^1.0.21": - version "1.0.21" - resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-1.0.21.tgz#3ad60e3c82dfcfd7fc940568d46d560cd2faaed9" - integrity sha512-1eXhTePkDpCYYmiwRFEECEjgOnvSMfEiGGd9Ku+P4p+mj2LmFdejfzWhyr9agrcbj9YD0OWwEBluiRg4QAs9kQ== - -"@cspell/dict-lua@^1.0.15": - version "1.0.15" - resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-1.0.15.tgz#d4830cb04510e2715cf1c8e3d811d40b428cec20" - integrity sha512-/3L5oHxErLd4SPwgJ10SCBcidGP+obJ9V1QAhBF10ktAPD9b3larrXam01G2zn1H6lMJjuOm9Q4iJOV5rL3TsQ== - -"@cspell/dict-node@^1.0.8": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-1.0.8.tgz#ff66cc2428906b4468133120edf043fa37a6097d" - integrity sha512-3Pc2Np66BjaeNtcScrGjRTzyHe8UuFFrZGStzo1zx89MnKx6gT3XagIwmLjm6kGzUbtoAnKY2U2FugIOSQ7dLA== - -"@cspell/dict-npm@^1.0.9": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-1.0.9.tgz#d5b0b7b0f2a904ca49d1a48be91dfae148064b99" - integrity sha512-LyV/uUV8TPq7JKXRvN4Bm/be9qgXbCL2oLdZ/D01dljsRBmlgg5hmDaa8SY+msitnTyJ1MKtEsQiwlH2CbGgow== - -"@cspell/dict-php@^1.0.22": - version "1.0.22" - resolved "https://registry.yarnpkg.com/@cspell/dict-php/-/dict-php-1.0.22.tgz#577eb43d2f3965b239ddee3d3b337e7cee0dc73c" - integrity sha512-SWkz/3EB00irqRyF7UG7bgO2oh1K1JAhKB4BHfW7HKDec6Zb6IapNvvXaS5ham/oXqjy6IigDVoY7sgVRJ2sZg== - -"@cspell/dict-powershell@^1.0.13": - version "1.0.13" - resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-1.0.13.tgz#1815a54e1634722e6f7ce4a70e6d44db0455bf79" - integrity sha512-6dOPZiKac4ycoFUtcw/zsLrlL2uoTorgKkX0wtRlBu3rnD6FiN/2UD9rfnl/tbd6dM0SvS2Adxb3HkV2teVGbQ== - -"@cspell/dict-python@^1.0.30": - version "1.0.30" - resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-1.0.30.tgz#31ba036ee3e9ca8686a282e9ff0662376f3c4a81" - integrity sha512-9ej3jHJxcTpGl3fQMeInZ7m1zD8tEAJU81C7C9FfxsyO0t1eMNB+q/lU72p8lfuNHFSz2Kb8Q+swMw7j1guIUg== - -"@cspell/dict-ruby@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-1.0.11.tgz#c064a522cdc52b0bc78ee7d77951f32f259f8219" - integrity sha512-n/KZqm68wOemeV1vp6340yIJDclXO/p8dFvDnjR8hUJP1l7p4p/QzY1K4HFDv/744V4sqTSF0dXJia8uXiuwBA== - -"@cspell/dict-rust@^1.0.21": - version "1.0.21" - resolved "https://registry.yarnpkg.com/@cspell/dict-rust/-/dict-rust-1.0.21.tgz#21e416270d10425255d87bc03237f1dd6fe11d2d" - integrity sha512-13O1Gvfc9aSK+r5kRT+Bqe2+/QYQbM0yWsD4KV8pTG1xNxDQOzS02dzjbd4MpmCjzYFO1H+Zz//iZpX4vxnawA== - -"@cspell/dict-scala@^1.0.20": - version "1.0.20" - resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-1.0.20.tgz#3b81522df6d402b0d54b0a125a6570486fce0df5" - integrity sha512-JkVCjsn3lUmh5EdeoKttedN2pCXvQJzz5jtbr5Hfer7oLC6flre58yPpaC1kyfOP1lCpg31FQSUnhlB6AyJNDQ== - -"@cspell/dict-software-terms@^1.0.22": - version "1.0.22" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-1.0.22.tgz#6caf5850a0451fb518b592f63f487305860f15b6" - integrity sha512-mZgKYgL6EXXeEdzc+XlRNDdTmLAvl1L+muijAiwyRxfJnP5yznoxvyN0v51dTraRYA9xxoqKzNlT5gPQkLc7hQ== - -"@cspell/dict-typescript@^1.0.15": - version "1.0.15" - resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-1.0.15.tgz#97cd4357f5715b91178a93b6c1dcab5f6d0591ec" - integrity sha512-Guh+nN57OqbcRNH6cfbBQKfeDp0i+GBlniYvhWvaRxkSdFQJi4YgFKvQJsvtwLkwmNqYkQIXQr+8zXhuvTHLhA== +"@cspell/dict-typescript@^1.0.16": + version "1.0.16" + resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-1.0.16.tgz#18d20a91c4caf52540c795921a50b0e4ce3bc50c" + integrity sha512-DEKi6vD605ebDhCC4Hrtz29k59TcijPVsmVKheTpMrL1MD/S96Ftb19gW0pEIVK9vwYZIljmGwgz4qYyuM5Liw== "@eslint/eslintrc@^0.3.0": version "0.3.0" @@ -2473,10 +2473,10 @@ commander@^2.19.0, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" - integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== +commander@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2" + integrity sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA== comment-json@^4.0.6, comment-json@^4.1.0: version "4.1.0" @@ -2604,79 +2604,79 @@ cspell-io@^4.1.7: iconv-lite "^0.6.2" iterable-to-stream "^1.0.1" -cspell-lib@^4.3.9: - version "4.3.9" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.3.9.tgz#8b0731e9340ed213164cc725ea2203837cf34783" - integrity sha512-vyyYq2sa91iDwyNt2qvxfLgG39RGJOcpDQbL6IKPoAsliCBSzVPq4U1e1I8kQRmEcbl7oM2+GeYth5E6YY1IVg== +cspell-lib@^4.3.12: + version "4.3.12" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.3.12.tgz#9ba30591079562534ef47e5552b86cadaf7383d8" + integrity sha512-yCCb6MoW1K8Tsr/WVEQoO4dfYhH9bCsjQayccb8MlyDaNNuWJHuX+gUGHsZSXSuChSh8PrTWKXJzs13/uM977g== dependencies: - "@cspell/dict-aws" "^1.0.12" - "@cspell/dict-bash" "^1.0.10" - "@cspell/dict-companies" "^1.0.34" - "@cspell/dict-cpp" "^1.1.36" - "@cspell/dict-cryptocurrencies" "^1.0.9" - "@cspell/dict-csharp" "^1.0.9" - "@cspell/dict-css" "^1.0.9" - "@cspell/dict-django" "^1.0.24" - "@cspell/dict-dotnet" "^1.0.23" - "@cspell/dict-elixir" "^1.0.22" + "@cspell/dict-aws" "^1.0.13" + "@cspell/dict-bash" "^1.0.11" + "@cspell/dict-companies" "^1.0.35" + "@cspell/dict-cpp" "^1.1.37" + "@cspell/dict-cryptocurrencies" "^1.0.10" + "@cspell/dict-csharp" "^1.0.10" + "@cspell/dict-css" "^1.0.10" + "@cspell/dict-django" "^1.0.25" + "@cspell/dict-dotnet" "^1.0.24" + "@cspell/dict-elixir" "^1.0.23" "@cspell/dict-en-gb" "^1.1.27" - "@cspell/dict-en_us" "^1.2.37" - "@cspell/dict-filetypes" "^1.1.4" - "@cspell/dict-fonts" "^1.0.12" - "@cspell/dict-fullstack" "^1.0.35" - "@cspell/dict-golang" "^1.1.23" - "@cspell/dict-haskell" "^1.0.11" - "@cspell/dict-html" "^1.1.4" - "@cspell/dict-html-symbol-entities" "^1.0.22" - "@cspell/dict-java" "^1.0.21" - "@cspell/dict-latex" "^1.0.22" - "@cspell/dict-lorem-ipsum" "^1.0.21" - "@cspell/dict-lua" "^1.0.15" - "@cspell/dict-node" "^1.0.8" - "@cspell/dict-npm" "^1.0.9" - "@cspell/dict-php" "^1.0.22" - "@cspell/dict-powershell" "^1.0.13" - "@cspell/dict-python" "^1.0.30" - "@cspell/dict-ruby" "^1.0.11" - "@cspell/dict-rust" "^1.0.21" - "@cspell/dict-scala" "^1.0.20" - "@cspell/dict-software-terms" "^1.0.22" - "@cspell/dict-typescript" "^1.0.15" + "@cspell/dict-en_us" "^1.2.39" + "@cspell/dict-filetypes" "^1.1.5" + "@cspell/dict-fonts" "^1.0.13" + "@cspell/dict-fullstack" "^1.0.36" + "@cspell/dict-golang" "^1.1.24" + "@cspell/dict-haskell" "^1.0.12" + "@cspell/dict-html" "^1.1.5" + "@cspell/dict-html-symbol-entities" "^1.0.23" + "@cspell/dict-java" "^1.0.22" + "@cspell/dict-latex" "^1.0.23" + "@cspell/dict-lorem-ipsum" "^1.0.22" + "@cspell/dict-lua" "^1.0.16" + "@cspell/dict-node" "^1.0.10" + "@cspell/dict-npm" "^1.0.10" + "@cspell/dict-php" "^1.0.23" + "@cspell/dict-powershell" "^1.0.14" + "@cspell/dict-python" "^1.0.32" + "@cspell/dict-ruby" "^1.0.12" + "@cspell/dict-rust" "^1.0.22" + "@cspell/dict-scala" "^1.0.21" + "@cspell/dict-software-terms" "^1.0.24" + "@cspell/dict-typescript" "^1.0.16" comment-json "^4.1.0" configstore "^5.0.1" cspell-io "^4.1.7" - cspell-trie-lib "^4.2.7" - cspell-util-bundle "^4.1.9" - fs-extra "^9.0.1" + cspell-trie-lib "^4.2.8" + cspell-util-bundle "^4.1.11" + fs-extra "^9.1.0" gensequence "^3.1.1" minimatch "^3.0.4" resolve-from "^5.0.0" resolve-global "^1.0.0" - vscode-uri "^2.1.2" + vscode-uri "^3.0.2" -cspell-trie-lib@^4.2.7: - version "4.2.7" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-4.2.7.tgz#25d5e5931979dcfdc4cfd53785bc72a5a8084558" - integrity sha512-Iwspbgqw4lv6L0kPMTl5423Kq9/zyfPLCc0gpl4vBNJ9skc7beuMmZoyvAF1IeGWl4li35AuaTfEy0uR+h88cQ== +cspell-trie-lib@^4.2.8: + version "4.2.8" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-4.2.8.tgz#50d9841945274b7c879e2ebe3caa360828355bda" + integrity sha512-Nt3c0gxOYXIc3/yhALDukpje1BgR6guvlUKWQO2zb0r7qRWpwUw2j2YM4dWbHQeH/3Hx5ei4Braa6cMaiJ5YBw== dependencies: gensequence "^3.1.1" -cspell-util-bundle@^4.1.9: - version "4.1.9" - resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.1.9.tgz#7a92fcf427ec67601f96e4bb4e473557dae5d906" - integrity sha512-ytYWn+EmSuthkh+GOKqLpBXsa5mnSBvOgl58IF04zB8LvjQpzRdo1FJkiQiy+HYPMl1xUmcLDqcAhvANzNGDMg== +cspell-util-bundle@^4.1.11: + version "4.1.11" + resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.1.11.tgz#96840af030dcac5baeb3480e249e7402413015d0" + integrity sha512-or3OGKydZs1NwweMIgnA48k8H3F5zK4e5lonjUhpEzLYQZ2nB23decdoqZ8ogFC8pFTA40tZKDsMJ0b+65gX4Q== -cspell@4.2.5: - version "4.2.5" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.2.5.tgz#6678d480b3f63501f0c9e75447011f5236e063ce" - integrity sha512-JAlgs1I4hrqkfLdzkfCA9ynNr4EByauH57oGstIw1onsi25Htv7rzAz0E9rjXlARr3cD4lzoTSylrPI4dfmLmA== +cspell@4.2.8: + version "4.2.8" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.2.8.tgz#69b4c6f4c1b628f0b51d8618738d061e497d76d3" + integrity sha512-eqan8+lCU9bSp8Tl4+SR/ccBnuPyMmp7evck/RlMdFTjLh/s+3vQ5hQyBzbzK8w2MMqL84CymW7BwIOKjpylSg== dependencies: chalk "^4.1.0" - commander "^6.1.0" + commander "^7.0.0" comment-json "^4.0.6" cspell-glob "^0.1.25" - cspell-lib "^4.3.9" - fs-extra "^9.0.1" + cspell-lib "^4.3.12" + fs-extra "^9.1.0" gensequence "^3.1.1" get-stdin "^8.0.0" glob "^7.1.6" @@ -3555,15 +3555,15 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -fs-extra@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" + universalify "^2.0.0" fs.realpath@^1.0.0: version "1.0.0" @@ -7189,6 +7189,11 @@ universalify@^1.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -7293,10 +7298,10 @@ vnopts@1.0.2: leven "^2.1.0" tslib "^1.9.3" -vscode-uri@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.2.tgz#c8d40de93eb57af31f3c715dd650e2ca2c096f1c" - integrity sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A== +vscode-uri@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.2.tgz#ecfd1d066cb8ef4c3a208decdbab9a8c23d055d0" + integrity sha512-jkjy6pjU1fxUvI51P+gCsxg1u2n8LSt0W6KrCNQceaziKzff74GoWmjVG46KieVzybO1sttPQmYfrwSHey7GUA== w3c-hr-time@^1.0.2: version "1.0.2" From 24433cbbf61986d08cdc4cebe268d3d25c5e395d Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 25 Jan 2021 10:07:06 +0200 Subject: [PATCH 003/237] Use fill to print number-only arrays (#10106) --- changelog_unreleased/javascript/10106.md | 45 ++ src/language-js/print/array.js | 84 ++- src/language-js/utils.js | 9 + .../arrays/__snapshots__/jsfmt.spec.js.snap | 634 +++++++++++++++++- tests/js/arrays/numbers-in-args.js | 13 + tests/js/arrays/numbers-in-assignment.js | 15 + .../numbers-negative-comment-after-minus.js | 11 + tests/js/arrays/numbers-negative.js | 11 + tests/js/arrays/numbers-trailing-comma.js | 4 + tests/js/arrays/numbers-with-holes.js | 29 + .../arrays/numbers-with-trailing-comments.js | 11 + .../js/arrays/numbers-with-tricky-comments.js | 7 + tests/js/arrays/numbers1.js | 102 +++ tests/js/arrays/numbers2.js | 49 ++ tests/js/arrays/numbers3.js | 16 + .../json/__snapshots__/jsfmt.spec.js.snap | 24 +- 16 files changed, 1045 insertions(+), 19 deletions(-) create mode 100644 changelog_unreleased/javascript/10106.md create mode 100644 tests/js/arrays/numbers-in-args.js create mode 100644 tests/js/arrays/numbers-in-assignment.js create mode 100644 tests/js/arrays/numbers-negative-comment-after-minus.js create mode 100644 tests/js/arrays/numbers-negative.js create mode 100644 tests/js/arrays/numbers-trailing-comma.js create mode 100644 tests/js/arrays/numbers-with-holes.js create mode 100644 tests/js/arrays/numbers-with-trailing-comments.js create mode 100644 tests/js/arrays/numbers-with-tricky-comments.js create mode 100644 tests/js/arrays/numbers1.js create mode 100644 tests/js/arrays/numbers2.js create mode 100644 tests/js/arrays/numbers3.js diff --git a/changelog_unreleased/javascript/10106.md b/changelog_unreleased/javascript/10106.md new file mode 100644 index 000000000..63c2da6c5 --- /dev/null +++ b/changelog_unreleased/javascript/10106.md @@ -0,0 +1,45 @@ +#### Concise formatting of number-only arrays (#10106 by @thorn0) + +While in general, Prettier avoids this kind of formatting because it's not diff-friendly, in this special case we decided that the benefits outweigh the risks. + +If at least one element has a trailing single-line (`// ...`) comment on the same line, the concise formatting isn't applied. On the other hand, single-line comments placed on separate lines don't have such an effect and – as well as empty lines – can be used for logical grouping. + + +```jsx +// Input +const lazyCatererNumbers = [1, 2, 4, 7, 11, 16, 22, 29, 37, 46, + +// n > 10 +56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466, +497, 529, 562, 596, 631, 667, 704, 742, 781, +// n > 40 +821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, 1276, 1327, 1379]; + +// Prettier stable +const lazyCatererNumbers = [ + 1, + 2, + 4, + 7, + 11, + 16, + 22, + 29, + 37, + // ... βœ‚ a lot of lines βœ‚ ... + 1379, +]; + + +// Prettier main +const lazyCatererNumbers = [ + 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, + + // n > 10 + 56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, + 352, 379, 407, 436, 466, 497, 529, 562, 596, 631, 667, 704, 742, 781, + // n > 40 + 821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, 1276, 1327, 1379, +]; + +``` diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js index d8ad213da..d503caf56 100644 --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -2,15 +2,18 @@ const { printDanglingComments } = require("../../main/comments"); const { - builders: { line, softline, group, indent, ifBreak }, + builders: { line, softline, hardline, group, indent, ifBreak, fill }, } = require("../../document"); -const { getLast } = require("../../common/util"); +const { getLast, hasNewline } = require("../../common/util"); const { shouldPrintComma, hasComment, CommentCheckFlags, isNextLineEmpty, + isNumericLiteral, + isSignedNumericLiteral, } = require("../utils"); +const { locStart } = require("../loc"); const { printOptionalToken, printTypeAnnotation } = require("./misc"); @@ -50,7 +53,17 @@ function printArray(path, options, print) { // // Note that getLast returns null if the array is empty, but // we already check for an empty array just above so we are safe - const needsForcedTrailingComma = canHaveTrailingComma && lastElem === null; + const needsForcedTrailingComma = lastElem === null; + + const groupId = Symbol("array"); + + const trailingComma = !canHaveTrailingComma + ? "" + : needsForcedTrailingComma + ? "," + : !shouldPrintComma(options) + ? "" + : ifBreak(",", "", { groupId }); const shouldBreak = !options.__inJestEach && @@ -75,24 +88,42 @@ function printArray(path, options, print) { return element[itemsKey] && element[itemsKey].length > 1; }); + const shouldUseConciseFormatting = + n.elements.length > 1 && + n.elements.every( + (element) => + element && + (isNumericLiteral(element) || + (isSignedNumericLiteral(element) && + !hasComment(element.argument))) && + !hasComment( + element, + CommentCheckFlags.Trailing | CommentCheckFlags.Line, + (comment) => + !hasNewline(options.originalText, locStart(comment), { + backwards: true, + }) + ) + ); + parts.push( group( [ openBracket, - indent([softline, printArrayItems(path, options, "elements", print)]), - needsForcedTrailingComma ? "," : "", - ifBreak( - canHaveTrailingComma && - !needsForcedTrailingComma && - shouldPrintComma(options) - ? "," - : "" - ), - printDanglingComments(path, options, /* sameIndent */ true), + indent([ + softline, + shouldUseConciseFormatting + ? printArrayItemsConcisely(path, options, print, trailingComma) + : [ + printArrayItems(path, options, "elements", print), + trailingComma, + ], + printDanglingComments(path, options, /* sameIndent */ true), + ]), softline, closeBracket, ], - { shouldBreak } + { shouldBreak, id: groupId } ) ); } @@ -124,4 +155,29 @@ function printArrayItems(path, options, printPath, print) { return printedElements; } +function printArrayItemsConcisely(path, options, print, trailingComma) { + const parts = []; + + path.each((childPath, i, elements) => { + const isLast = i === elements.length - 1; + + parts.push([print(childPath), isLast ? trailingComma : ","]); + + if (!isLast) { + parts.push( + isNextLineEmpty(childPath.getValue(), options) + ? [hardline, hardline] + : hasComment( + elements[i + 1], + CommentCheckFlags.Leading | CommentCheckFlags.Line + ) + ? hardline + : line + ); + } + }, "elements"); + + return fill(parts); +} + module.exports = { printArray, printArrayItems }; diff --git a/src/language-js/utils.js b/src/language-js/utils.js index 3bade04f2..56eceef21 100644 --- a/src/language-js/utils.js +++ b/src/language-js/utils.js @@ -247,6 +247,14 @@ function isNumericLiteral(node) { ); } +function isSignedNumericLiteral(node) { + return ( + node.type === "UnaryExpression" && + (node.operator === "+" || node.operator === "-") && + isNumericLiteral(node.argument) + ); +} + /** * @param {Node} node * @returns {boolean} @@ -1362,6 +1370,7 @@ module.exports = { isMemberExpressionChain, isMemberish, isNumericLiteral, + isSignedNumericLiteral, isObjectType, isObjectTypePropertyAFunction, isSimpleType, diff --git a/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap index 9c807266f..9d428d70d 100644 --- a/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap @@ -165,6 +165,632 @@ printWidth: 80 ================================================================================ `; +exports[`numbers-in-args.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +expect(bifornCringerMoshedPerplexSawder.getArrayOfNumbers()).toEqual( + [1, 2, 3, 4, 5] +); + +expect(bifornCringerMoshedPerplexSawder.getLongArrayOfNumbers()).toEqual( + [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 + ] +); + +=====================================output===================================== +expect(bifornCringerMoshedPerplexSawder.getArrayOfNumbers()).toEqual([ + 1, 2, 3, 4, 5, +]); + +expect(bifornCringerMoshedPerplexSawder.getLongArrayOfNumbers()).toEqual([ + 66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, + 76, 41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, 33, + 40, 58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, 91, 27, + 83, 26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, 31, 86, + 27, 39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, 35, 48, + 78, 97, +]); + +================================================================================ +`; + +exports[`numbers-in-assignment.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers = [ + 1, + 2, + 3, + 4, + 5 +]; + +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers2 = [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 +]; + +=====================================output===================================== +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers = [ + 1, 2, 3, 4, 5, +]; + +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers2 = [ + 66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, + 76, 41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, 33, + 40, 58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, 91, 27, + 83, 26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, 31, 86, + 27, 39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, 35, 48, + 78, 97, +]; + +================================================================================ +`; + +exports[`numbers-negative.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const numbers1 = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385, +// comment1 +-380014, +-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7, +// comment2 +-62454,-4282239912, +-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44, +-41833463,-27961.12,-305.36,-199875.28]; + +const numbers2 = [-234, -342 // comment3 +, -223, -333333.33,12345] + +=====================================output===================================== +const numbers1 = [ + -2017, -506252, -744011292, -7224, -70.4, -83353.6, -708.4, -174023963.52, + -40385, + // comment1 + -380014, -253951682, -728, -15.84, -2058467564.56, -43, -33, -85134845, + -67092, -1, -78820379, -2371.6, -16, 7, + // comment2 + -62454, -4282239912, -10816495.36, 0.88, -100622682, 8.8, -67087.68000000001, + -3758276, -25.5211, -54, -1184265243, -46073628, -280423.44, -41833463, + -27961.12, -305.36, -199875.28, +]; + +const numbers2 = [ + -234, + -342, // comment3 + -223, + -333333.33, + 12345, +]; + +================================================================================ +`; + +exports[`numbers-negative-comment-after-minus.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const numbers = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385,-// comment1 +380014, +-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7, +// comment2 +-62454,-4282239912, +-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44, +-41833463,-27961.12,-305.36,-199875.28]; + +c = [ + - /**/ 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323 +]; + +=====================================output===================================== +const numbers = [ + -2017, + -506252, + -744011292, + -7224, + -70.4, + -83353.6, + -708.4, + -174023963.52, + -40385, + -( + // comment1 + 380014 + ), + -253951682, + -728, + -15.84, + -2058467564.56, + -43, + -33, + -85134845, + -67092, + -1, + -78820379, + -2371.6, + -16, + 7, + // comment2 + -62454, + -4282239912, + -10816495.36, + 0.88, + -100622682, + 8.8, + -67087.68000000001, + -3758276, + -25.5211, + -54, + -1184265243, + -46073628, + -280423.44, + -41833463, + -27961.12, + -305.36, + -199875.28, +]; + +c = [ + -(/**/ 66), + 66, + 57, + 45, + 47, + 33, + 53, + 82, + 81, + 76, + 66, + 57, + 45, + 47, + 33, + 53, + 82, + 81, + 223323, +]; + +================================================================================ +`; + +exports[`numbers-trailing-comma.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +// --------------- print-width ------------------------------------------------- +c = [ + 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323, +]; + +=====================================output===================================== +// --------------- print-width ------------------------------------------------- +c = [ + 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, + 223323, +]; + +================================================================================ +`; + +exports[`numbers-with-holes.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const numberWithHoles1 = [ + 7234932941, + 7234932722, + 7234932312, + // comment before a hole 1 + , + 7234932841, + , + 7234932843, + , + // comment after a hole 1 + 7234932436, +]; + +const numberWithHoles2 = [ + 0x234932941, + 0x234932722, + 0x234932312, + + // comment before a hole 2 + , + 0x234932841, + , + 0x234932843, + , + + // comment after a hole 2 + 0x234932436, +]; + +=====================================output===================================== +const numberWithHoles1 = [ + 7234932941, + 7234932722, + 7234932312, + , + // comment before a hole 1 + 7234932841, + , + 7234932843, + , + // comment after a hole 1 + 7234932436, +]; + +const numberWithHoles2 = [ + 0x234932941, + 0x234932722, + 0x234932312, + + , + // comment before a hole 2 + 0x234932841, + , + 0x234932843, + , + // comment after a hole 2 + 0x234932436, +]; + +================================================================================ +`; + +exports[`numbers-with-trailing-comments.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +function isUnusedDiagnostic(code) { + return [ + 6133, // '{0}' is declared but never used. + 6138, // Property '{0}' is declared but its value is never read. + 6192, // All imports in import declaration are unused. + 6196, // '{0}' is declared but its value is never read. + 6198, + 6199, + 6205, // All type parameters are unused. + ].includes(code); +} + +=====================================output===================================== +function isUnusedDiagnostic(code) { + return [ + 6133, // '{0}' is declared but never used. + 6138, // Property '{0}' is declared but its value is never read. + 6192, // All imports in import declaration are unused. + 6196, // '{0}' is declared but its value is never read. + 6198, + 6199, + 6205, // All type parameters are unused. + ].includes(code); +} + +================================================================================ +`; + +exports[`numbers-with-tricky-comments.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const lazyCatererNumbers = [1, 2, 4, 7, 11, 16, 22, 29, 37, 46, +56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466, /*block*/ +// line +497, 529, 562, 596, 631, 667, 704, 742, 781, +821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, +// line 2 +1276, 1327, 1379]; + +=====================================output===================================== +const lazyCatererNumbers = [ + 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79, 92, 106, 121, 137, 154, 172, + 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466 /*block*/, + // line + 497, 529, 562, 596, 631, 667, 704, 742, 781, 821, 862, 904, 947, 991, 1036, + 1082, 1129, 1177, 1226, + // line 2 + 1276, 1327, 1379, +]; + +================================================================================ +`; + +exports[`numbers1.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const numbers1 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + 7234932978, + 7234932436, + 7234932687, + 7234932269, + 7234932573, + 7234932913, + 7234932873, + 7234932748, + 7234932354, + 7234932153, + 7234932181, + 7234932947, + 7234932563, + 7234932324, + 7234932952, + 7234932885, + 7234932911, + 7234932698, + 7234932248, + 7234932764, + 7234932431, + 7234932811, + 7234932344, + 7234932855, + 7234932430, + 7234932396, + 7234932981, + 7234932594, + 7234932131, + 7234932489, + 7234932552, + 7234932116, + 7234932833, + 7234932521, + 7234932252, + 7234932503, + 7234932540, + 7234932893, + 7234932736, + 7234932969, + 7234932145, + 7234932925, + 7234932417, + 7234932344, + 7234932108, + 7234932161, + 7234932777, + 7234932971, + 7234932159, + 7234932158, + 7234932908, + 7234932511, + 7234932876, + 7234932768, + 7234932284, + 7234932640, + 7234932309, + 7234932651, + 7234932292, + 7234932898, + 7234932284, + 7234932201, + 7234932506, + 7234932654, + 7234932840, + 7234932334, + 7234932246, + 7234932376, + 7234932398, + 7234932714, + 7234932134, + 7234932435, + 7234932181, + 7234932980, + 7234932594, + 7234932396, + 7234932100, + 7234932743, + 7234932812, + 7234932583, + 7234932622, + 7234932800, + 7234932310, + 7234932111, + 7234932537, + 7234932751, + 7234932920, + 7234932872, + 7234932700, + 7234932702, + 7234932655, + 7234932515, + 7234932298 +]; + +=====================================output===================================== +const numbers1 = [ + 7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166, + 7234932843, 7234932978, 7234932436, 7234932687, 7234932269, 7234932573, + 7234932913, 7234932873, 7234932748, 7234932354, 7234932153, 7234932181, + 7234932947, 7234932563, 7234932324, 7234932952, 7234932885, 7234932911, + 7234932698, 7234932248, 7234932764, 7234932431, 7234932811, 7234932344, + 7234932855, 7234932430, 7234932396, 7234932981, 7234932594, 7234932131, + 7234932489, 7234932552, 7234932116, 7234932833, 7234932521, 7234932252, + 7234932503, 7234932540, 7234932893, 7234932736, 7234932969, 7234932145, + 7234932925, 7234932417, 7234932344, 7234932108, 7234932161, 7234932777, + 7234932971, 7234932159, 7234932158, 7234932908, 7234932511, 7234932876, + 7234932768, 7234932284, 7234932640, 7234932309, 7234932651, 7234932292, + 7234932898, 7234932284, 7234932201, 7234932506, 7234932654, 7234932840, + 7234932334, 7234932246, 7234932376, 7234932398, 7234932714, 7234932134, + 7234932435, 7234932181, 7234932980, 7234932594, 7234932396, 7234932100, + 7234932743, 7234932812, 7234932583, 7234932622, 7234932800, 7234932310, + 7234932111, 7234932537, 7234932751, 7234932920, 7234932872, 7234932700, + 7234932702, 7234932655, 7234932515, 7234932298, +]; + +================================================================================ +`; + +exports[`numbers2.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const userIds1 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, +]; + +const userIds2 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + 7234932978, + 7234932436, +]; + +const userIds3 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + + 7234932978, + 7234932436, +]; + +const userIds4 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + // comment 1 + 7234932843, + + 7234932978, + + // comment 2 + 7234932436, + // comment 3 +]; + + +=====================================output===================================== +const userIds1 = [7234932941, 7234932722, 7234932312, 7234932933]; + +const userIds2 = [ + 7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166, + 7234932843, 7234932978, 7234932436, +]; + +const userIds3 = [ + 7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166, + 7234932843, + + 7234932978, 7234932436, +]; + +const userIds4 = [ + 7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166, + // comment 1 + 7234932843, + + 7234932978, + + // comment 2 + 7234932436, + // comment 3 +]; + +================================================================================ +`; + +exports[`numbers3.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +let test_case = [ + [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 + ], + [ + 41,83,31,62,15,70,10,90,/*21,*/48,39,76,14,48,63,62,16,17,61,97,86,80,34,27, + 39,53,90,80,56,71,31,22,29,7,71,90,65,17,48,85,14,94,16,32,4,96,49,97, + 53,87,54,2,78,37,21,3,97,62,93,62,11,27,14,29,64,44,11,5,39,43,94,52,0, + 4,86,58,63,42,97,54,2,1,53,17,92,79,52,47,81,93,34,17,93,20,61,68,58,49, + 27,45 + ] +]; + +=====================================output===================================== +let test_case = [ + [ + 66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, + 76, 41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, + 33, 40, 58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, + 91, 27, 83, 26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, + 31, 86, 27, 39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, + 35, 48, 78, 97, + ], + [ + 41, 83, 31, 62, 15, 70, 10, 90, /*21,*/ 48, 39, 76, 14, 48, 63, 62, 16, 17, + 61, 97, 86, 80, 34, 27, 39, 53, 90, 80, 56, 71, 31, 22, 29, 7, 71, 90, 65, + 17, 48, 85, 14, 94, 16, 32, 4, 96, 49, 97, 53, 87, 54, 2, 78, 37, 21, 3, 97, + 62, 93, 62, 11, 27, 14, 29, 64, 44, 11, 5, 39, 43, 94, 52, 0, 4, 86, 58, 63, + 42, 97, 54, 2, 1, 53, 17, 92, 79, 52, 47, 81, 93, 34, 17, 93, 20, 61, 68, + 58, 49, 27, 45, + ], +]; + +================================================================================ +`; + exports[`preserve_empty_lines.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] @@ -185,7 +811,13 @@ a = [ ] =====================================output===================================== -a = [1, 2, 3, 4]; +a = [ + 1, 2, + + 3, + + 4, +]; ================================================================================ `; diff --git a/tests/js/arrays/numbers-in-args.js b/tests/js/arrays/numbers-in-args.js new file mode 100644 index 000000000..1ff69eab3 --- /dev/null +++ b/tests/js/arrays/numbers-in-args.js @@ -0,0 +1,13 @@ +expect(bifornCringerMoshedPerplexSawder.getArrayOfNumbers()).toEqual( + [1, 2, 3, 4, 5] +); + +expect(bifornCringerMoshedPerplexSawder.getLongArrayOfNumbers()).toEqual( + [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 + ] +); diff --git a/tests/js/arrays/numbers-in-assignment.js b/tests/js/arrays/numbers-in-assignment.js new file mode 100644 index 000000000..d7b6f66db --- /dev/null +++ b/tests/js/arrays/numbers-in-assignment.js @@ -0,0 +1,15 @@ +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers = [ + 1, + 2, + 3, + 4, + 5 +]; + +bifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers2 = [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 +]; diff --git a/tests/js/arrays/numbers-negative-comment-after-minus.js b/tests/js/arrays/numbers-negative-comment-after-minus.js new file mode 100644 index 000000000..2b6a54ae7 --- /dev/null +++ b/tests/js/arrays/numbers-negative-comment-after-minus.js @@ -0,0 +1,11 @@ +const numbers = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385,-// comment1 +380014, +-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7, +// comment2 +-62454,-4282239912, +-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44, +-41833463,-27961.12,-305.36,-199875.28]; + +c = [ + - /**/ 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323 +]; diff --git a/tests/js/arrays/numbers-negative.js b/tests/js/arrays/numbers-negative.js new file mode 100644 index 000000000..968d3c4c8 --- /dev/null +++ b/tests/js/arrays/numbers-negative.js @@ -0,0 +1,11 @@ +const numbers1 = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385, +// comment1 +-380014, +-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7, +// comment2 +-62454,-4282239912, +-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44, +-41833463,-27961.12,-305.36,-199875.28]; + +const numbers2 = [-234, -342 // comment3 +, -223, -333333.33,12345] diff --git a/tests/js/arrays/numbers-trailing-comma.js b/tests/js/arrays/numbers-trailing-comma.js new file mode 100644 index 000000000..80e5ba984 --- /dev/null +++ b/tests/js/arrays/numbers-trailing-comma.js @@ -0,0 +1,4 @@ +// --------------- print-width ------------------------------------------------- +c = [ + 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323, +]; diff --git a/tests/js/arrays/numbers-with-holes.js b/tests/js/arrays/numbers-with-holes.js new file mode 100644 index 000000000..101734233 --- /dev/null +++ b/tests/js/arrays/numbers-with-holes.js @@ -0,0 +1,29 @@ +const numberWithHoles1 = [ + 7234932941, + 7234932722, + 7234932312, + // comment before a hole 1 + , + 7234932841, + , + 7234932843, + , + // comment after a hole 1 + 7234932436, +]; + +const numberWithHoles2 = [ + 0x234932941, + 0x234932722, + 0x234932312, + + // comment before a hole 2 + , + 0x234932841, + , + 0x234932843, + , + + // comment after a hole 2 + 0x234932436, +]; diff --git a/tests/js/arrays/numbers-with-trailing-comments.js b/tests/js/arrays/numbers-with-trailing-comments.js new file mode 100644 index 000000000..cf789cea9 --- /dev/null +++ b/tests/js/arrays/numbers-with-trailing-comments.js @@ -0,0 +1,11 @@ +function isUnusedDiagnostic(code) { + return [ + 6133, // '{0}' is declared but never used. + 6138, // Property '{0}' is declared but its value is never read. + 6192, // All imports in import declaration are unused. + 6196, // '{0}' is declared but its value is never read. + 6198, + 6199, + 6205, // All type parameters are unused. + ].includes(code); +} diff --git a/tests/js/arrays/numbers-with-tricky-comments.js b/tests/js/arrays/numbers-with-tricky-comments.js new file mode 100644 index 000000000..6b0fb2128 --- /dev/null +++ b/tests/js/arrays/numbers-with-tricky-comments.js @@ -0,0 +1,7 @@ +const lazyCatererNumbers = [1, 2, 4, 7, 11, 16, 22, 29, 37, 46, +56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466, /*block*/ +// line +497, 529, 562, 596, 631, 667, 704, 742, 781, +821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226, +// line 2 +1276, 1327, 1379]; diff --git a/tests/js/arrays/numbers1.js b/tests/js/arrays/numbers1.js new file mode 100644 index 000000000..5bb0ddc2f --- /dev/null +++ b/tests/js/arrays/numbers1.js @@ -0,0 +1,102 @@ +const numbers1 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + 7234932978, + 7234932436, + 7234932687, + 7234932269, + 7234932573, + 7234932913, + 7234932873, + 7234932748, + 7234932354, + 7234932153, + 7234932181, + 7234932947, + 7234932563, + 7234932324, + 7234932952, + 7234932885, + 7234932911, + 7234932698, + 7234932248, + 7234932764, + 7234932431, + 7234932811, + 7234932344, + 7234932855, + 7234932430, + 7234932396, + 7234932981, + 7234932594, + 7234932131, + 7234932489, + 7234932552, + 7234932116, + 7234932833, + 7234932521, + 7234932252, + 7234932503, + 7234932540, + 7234932893, + 7234932736, + 7234932969, + 7234932145, + 7234932925, + 7234932417, + 7234932344, + 7234932108, + 7234932161, + 7234932777, + 7234932971, + 7234932159, + 7234932158, + 7234932908, + 7234932511, + 7234932876, + 7234932768, + 7234932284, + 7234932640, + 7234932309, + 7234932651, + 7234932292, + 7234932898, + 7234932284, + 7234932201, + 7234932506, + 7234932654, + 7234932840, + 7234932334, + 7234932246, + 7234932376, + 7234932398, + 7234932714, + 7234932134, + 7234932435, + 7234932181, + 7234932980, + 7234932594, + 7234932396, + 7234932100, + 7234932743, + 7234932812, + 7234932583, + 7234932622, + 7234932800, + 7234932310, + 7234932111, + 7234932537, + 7234932751, + 7234932920, + 7234932872, + 7234932700, + 7234932702, + 7234932655, + 7234932515, + 7234932298 +]; diff --git a/tests/js/arrays/numbers2.js b/tests/js/arrays/numbers2.js new file mode 100644 index 000000000..6501e26b1 --- /dev/null +++ b/tests/js/arrays/numbers2.js @@ -0,0 +1,49 @@ +const userIds1 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, +]; + +const userIds2 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + 7234932978, + 7234932436, +]; + +const userIds3 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + 7234932843, + + 7234932978, + 7234932436, +]; + +const userIds4 = [ + 7234932941, + 7234932722, + 7234932312, + 7234932933, + 7234932841, + 7234932166, + // comment 1 + 7234932843, + + 7234932978, + + // comment 2 + 7234932436, + // comment 3 +]; + diff --git a/tests/js/arrays/numbers3.js b/tests/js/arrays/numbers3.js new file mode 100644 index 000000000..f1cec5040 --- /dev/null +++ b/tests/js/arrays/numbers3.js @@ -0,0 +1,16 @@ +let test_case = [ + [ + 66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35, + 97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91, + 98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4, + 36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35, + 48,78,97 + ], + [ + 41,83,31,62,15,70,10,90,/*21,*/48,39,76,14,48,63,62,16,17,61,97,86,80,34,27, + 39,53,90,80,56,71,31,22,29,7,71,90,65,17,48,85,14,94,16,32,4,96,49,97, + 53,87,54,2,78,37,21,3,97,62,93,62,11,27,14,29,64,44,11,5,39,43,94,52,0, + 4,86,58,63,42,97,54,2,1,53,17,92,79,52,47,81,93,34,17,93,20,61,68,58,49, + 27,45 + ] +]; diff --git a/tests/json/json/__snapshots__/jsfmt.spec.js.snap b/tests/json/json/__snapshots__/jsfmt.spec.js.snap index ab23b450d..51c8c164f 100644 --- a/tests/json/json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/json/json/__snapshots__/jsfmt.spec.js.snap @@ -524,7 +524,11 @@ trailingComma: "all" "url": "http://www.JSON.org/", "comment": "// /* */": " ", - " s p a c e d ": [1, 2, 3, 4, 5, 6, 7], + " s p a c e d ": [ + 1, 2, 3, + + 4, 5, 6, 7 + ], "compact": [1, 2, 3, 4, 5, 6, 7], "jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}", "quotes": "" \\u0022 %22 0x22 034 "", @@ -650,7 +654,11 @@ trailingComma: "all" url: "http://www.JSON.org/", comment: "// /* */": " ", - " s p a c e d ": [1, 2, 3, 4, 5, 6, 7], + " s p a c e d ": [ + 1, 2, 3, + + 4, 5, 6, 7, + ], compact: [1, 2, 3, 4, 5, 6, 7], jsontext: '{"object with 1 member":["array with 1 element"]}', quotes: "" \\u0022 %22 0x22 034 "", @@ -775,7 +783,11 @@ printWidth: 80 "url": "http://www.JSON.org/", "comment": "// /* */": " ", - " s p a c e d ": [1, 2, 3, 4, 5, 6, 7], + " s p a c e d ": [ + 1, 2, 3, + + 4, 5, 6, 7 + ], "compact": [1, 2, 3, 4, 5, 6, 7], "jsontext": "{\\"object with 1 member\\":[\\"array with 1 element\\"]}", "quotes": "" \\u0022 %22 0x22 034 "", @@ -900,7 +912,11 @@ printWidth: 80 url: "http://www.JSON.org/", comment: "// /* */": " ", - " s p a c e d ": [1, 2, 3, 4, 5, 6, 7], + " s p a c e d ": [ + 1, 2, 3, + + 4, 5, 6, 7, + ], compact: [1, 2, 3, 4, 5, 6, 7], jsontext: '{"object with 1 member":["array with 1 element"]}', quotes: "" \\u0022 %22 0x22 034 "", From 2b3716d5274f7048141c4316e58c7589211cbeb1 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 25 Jan 2021 14:15:24 +0200 Subject: [PATCH 004/237] Add skipped changelog entry to 2.2.0 blog post --- website/blog/2020-11-20-2.2.0.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/blog/2020-11-20-2.2.0.md b/website/blog/2020-11-20-2.2.0.md index 03f05691e..b110f0c38 100644 --- a/website/blog/2020-11-20-2.2.0.md +++ b/website/blog/2020-11-20-2.2.0.md @@ -1103,6 +1103,10 @@ Checking formatting... All matched files use Prettier code style! ``` +#### Flush line suffix contents at the end of document ([#9703](https://github.com/prettier/prettier/pull/9703) by [@dangmai](https://github.com/dangmai)) + +Prettier did not flush [line-suffix](https://github.com/prettier/prettier/blob/main/commands.md#linesuffix) contents at the end of the document if there was no trailing newline. This fix forces all of those contents to be flushed even without trailing newlines. + ### CLI #### Move [pre-commit](https://github.com/pre-commit/pre-commit) support to github.com/pre-commit/mirrors-prettier ([#8937](https://github.com/prettier/prettier/pull/8937) by [@FloChehab](https://github.com/FloChehab)) From 78fb22283b3fd0b61bff7454b4e3ab736e20069e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 16:24:57 +0200 Subject: [PATCH 005/237] Build(deps): Bump @angular/compiler from 11.0.9 to 11.1.0 (#10097) Bumps [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) from 11.0.9 to 11.1.0. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/11.1.0/packages/compiler) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4b86a5910..6c8b2032e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "11.0.9", + "@angular/compiler": "11.1.0", "@babel/code-frame": "7.12.11", "@babel/parser": "7.12.11", "@glimmer/syntax": "0.73.1", diff --git a/yarn.lock b/yarn.lock index f3ab08c39..9d7bda27d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/compiler@11.0.9": - version "11.0.9" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.0.9.tgz#524757eac7c9915605c3579f12b2a80cb9d4d783" - integrity sha512-H2IfS6ciPWN0kmKhbwDuvS8ry5GcRFKfoyA/HGk+nQwCE2nAHC8VNwldbtoisO7XfRWr/uaTrh6z/vdfxsAiHw== +"@angular/compiler@11.1.0": + version "11.1.0" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.1.0.tgz#0e2e18fe0cb64ec696986f12f80debcbdccc8d20" + integrity sha512-XW+McH/RVjpLtNkft6UYZQbjhXwX/hvLgUa9jGlTuIFM5o7W4XRPnq5sfn3+QvzdROF0j8S5sy47mGVNQOYMNg== dependencies: tslib "^2.0.0" From 3dfac3d71b1276cac8212d16d60a428ba46a04c1 Mon Sep 17 00:00:00 2001 From: Mike <2266568+michaelbeaumont@users.noreply.github.com> Date: Mon, 25 Jan 2021 16:09:22 +0100 Subject: [PATCH 006/237] Support YAML document end marker in front matter (#9878) --- changelog_unreleased/markdown/9878.md | 31 +++++ cspell.json | 1 + src/utils/front-matter.js | 54 +++++++-- .../__snapshots__/jsfmt.spec.js.snap | 106 ++++++++++++++++++ .../in-markdown/front-matter-json.md | 6 + .../in-markdown/front-matter-pandoc.md | 9 ++ 6 files changed, 195 insertions(+), 12 deletions(-) create mode 100644 changelog_unreleased/markdown/9878.md create mode 100644 tests/misc/embedded_language_formatting/in-markdown/front-matter-json.md create mode 100644 tests/misc/embedded_language_formatting/in-markdown/front-matter-pandoc.md diff --git a/changelog_unreleased/markdown/9878.md b/changelog_unreleased/markdown/9878.md new file mode 100644 index 000000000..409d2c4bb --- /dev/null +++ b/changelog_unreleased/markdown/9878.md @@ -0,0 +1,31 @@ +#### Support YAML document end marker in front matter (#9878 by @michaelbeaumont) + +Add the ability to delimit the end of front matter with `...`. + + +```markdown + +--- +title: Hello +slug: home +... + +Markdown + + +--- + +title: Hello +slug: home +... + +Markdown + + +--- +title: Hello +slug: home +... + +Markdown +``` diff --git a/cspell.json b/cspell.json index ac7214924..c6c7c29d6 100644 --- a/cspell.json +++ b/cspell.json @@ -271,6 +271,7 @@ "overscroll", "packagejson", "Panasenko", + "Pandoc", "Pangsakulyanont", "paren", "parens", diff --git a/src/utils/front-matter.js b/src/utils/front-matter.js index b24e86221..ac918cb43 100644 --- a/src/utils/front-matter.js +++ b/src/utils/front-matter.js @@ -5,18 +5,26 @@ const { builders: { hardline, markAsRoot }, } = require("../document"); +const YAML_DELIMITER = "---"; +// In some markdown processors such as pandoc, +// "..." can be used as the end delimiter for YAML front-matter. +const YAML_END_DELIMITER = "..."; const DELIMITER_MAP = { - "---": "yaml", + [YAML_DELIMITER]: "yaml", "+++": "toml", }; function parse(text) { - const delimiterRegex = Object.keys(DELIMITER_MAP).map(escape).join("|"); + const startDelimiterRegex = Object.keys(DELIMITER_MAP).map(escape).join("|"); + const endDelimiterRegex = Object.keys(DELIMITER_MAP) + .concat(YAML_END_DELIMITER) + .map(escape) + .join("|"); const match = text.match( // trailing spaces after delimiters are allowed new RegExp( - `^(${delimiterRegex})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)\\1[^\\n\\S]*(\\n|$)` + `^(${startDelimiterRegex})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(${endDelimiterRegex})[^\\n\\S]*(\\n|$)` ) ); @@ -24,19 +32,35 @@ function parse(text) { return { frontMatter: null, content: text }; } - const [raw, delimiter, language, value = ""] = match; - let lang = DELIMITER_MAP[delimiter]; + const [raw, startDelimiter, language, value = "", endDelimiter] = match; + + let lang = DELIMITER_MAP[startDelimiter]; if (lang !== "toml" && language && language.trim()) { lang = language.trim(); } + // Only allow yaml to parse with a different end delimiter + if ( + startDelimiter !== endDelimiter && + !( + lang === "yaml" && + startDelimiter === YAML_DELIMITER && + endDelimiter === YAML_END_DELIMITER + ) + ) { + return { frontMatter: null, content: text }; + } + + const frontMatter = { + type: "front-matter", + lang, + value, + startDelimiter, + endDelimiter, + raw: raw.replace(/\n$/, ""), + }; return { - frontMatter: { - type: "front-matter", - lang, - value, - raw: raw.replace(/\n$/, ""), - }, + frontMatter, content: raw.replace(/[^\n]/g, " ") + text.slice(raw.length), }; } @@ -47,7 +71,13 @@ function print(node, textToDoc) { const doc = value ? textToDoc(value, { parser: "yaml" }, { stripTrailingHardline: true }) : ""; - return markAsRoot(["---", hardline, doc, doc ? hardline : "", "---"]); + return markAsRoot([ + node.startDelimiter, + hardline, + doc, + doc ? hardline : "", + node.endDelimiter, + ]); } } diff --git a/tests/misc/embedded_language_formatting/in-markdown/__snapshots__/jsfmt.spec.js.snap b/tests/misc/embedded_language_formatting/in-markdown/__snapshots__/jsfmt.spec.js.snap index be316dc29..7809e8056 100644 --- a/tests/misc/embedded_language_formatting/in-markdown/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/embedded_language_formatting/in-markdown/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,111 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`front-matter-json.md - {"embeddedLanguageFormatting":"off"} format 1`] = ` +====================================options===================================== +embeddedLanguageFormatting: "off" +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== +---json +{ + "a": 1 } +... + +The above should be reformatted because it isn't parsed as json front matter. + +=====================================output===================================== +---json +{ +"a": 1 } +... + +The above should be reformatted because it isn't parsed as json front matter. + +================================================================================ +`; + +exports[`front-matter-json.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== +---json +{ + "a": 1 } +... + +The above should be reformatted because it isn't parsed as json front matter. + +=====================================output===================================== +---json +{ +"a": 1 } +... + +The above should be reformatted because it isn't parsed as json front matter. + +================================================================================ +`; + +exports[`front-matter-pandoc.md - {"embeddedLanguageFormatting":"off"} format 1`] = ` +====================================options===================================== +embeddedLanguageFormatting: "off" +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== +---yaml + +title: Hello +slug: home + +... + +Hello world! + + +=====================================output===================================== +---yaml + +title: Hello +slug: home + +... + +Hello world! + +================================================================================ +`; + +exports[`front-matter-pandoc.md format 1`] = ` +====================================options===================================== +parsers: ["markdown"] +printWidth: 80 + | printWidth +=====================================input====================================== +---yaml + +title: Hello +slug: home + +... + +Hello world! + + +=====================================output===================================== +--- +title: Hello +slug: home +... + +Hello world! + +================================================================================ +`; + exports[`test.md - {"embeddedLanguageFormatting":"off"} format 1`] = ` ====================================options===================================== embeddedLanguageFormatting: "off" diff --git a/tests/misc/embedded_language_formatting/in-markdown/front-matter-json.md b/tests/misc/embedded_language_formatting/in-markdown/front-matter-json.md new file mode 100644 index 000000000..e66165f10 --- /dev/null +++ b/tests/misc/embedded_language_formatting/in-markdown/front-matter-json.md @@ -0,0 +1,6 @@ +---json +{ + "a": 1 } +... + +The above should be reformatted because it isn't parsed as json front matter. diff --git a/tests/misc/embedded_language_formatting/in-markdown/front-matter-pandoc.md b/tests/misc/embedded_language_formatting/in-markdown/front-matter-pandoc.md new file mode 100644 index 000000000..8b8fc576d --- /dev/null +++ b/tests/misc/embedded_language_formatting/in-markdown/front-matter-pandoc.md @@ -0,0 +1,9 @@ +---yaml + +title: Hello +slug: home + +... + +Hello world! + From 4d58724016186d0a3eff235db5459d1e966b1d3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 17:18:47 +0200 Subject: [PATCH 007/237] Build(deps): Bump @glimmer/syntax from 0.73.1 to 0.73.2 (#10103) Bumps [@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm) from 0.73.1 to 0.73.2. - [Release notes](https://github.com/glimmerjs/glimmer-vm/releases) - [Changelog](https://github.com/glimmerjs/glimmer-vm/blob/master/CHANGELOG.md) - [Commits](https://github.com/glimmerjs/glimmer-vm/compare/v0.73.1...v0.73.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 28 ++++++---------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 6c8b2032e..4504138cd 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@angular/compiler": "11.1.0", "@babel/code-frame": "7.12.11", "@babel/parser": "7.12.11", - "@glimmer/syntax": "0.73.1", + "@glimmer/syntax": "0.73.2", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.14.0", "angular-estree-parser": "2.3.0", diff --git a/yarn.lock b/yarn.lock index 9d7bda27d..8594eb855 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1064,13 +1064,6 @@ dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.73.1": - version "0.73.1" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.73.1.tgz#ad1dffb635c19b66230c45894e15f3a34d90e5b0" - integrity sha512-MttMIyWGZ+IbiJJpr4q9dwMmn+7eOMdxjMiuaEYeLBN/DXe8T9VePqgapURkSL9CEmKByB/pLvcaVTSYfm0RYg== - dependencies: - "@simple-dom/interface" "^1.4.0" - "@glimmer/interfaces@0.73.2": version "0.73.2" resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.73.2.tgz#03c769208bf705760800f3f64774b074bf04f738" @@ -1089,25 +1082,16 @@ "@glimmer/util" "0.73.2" "@glimmer/validator" "0.73.2" -"@glimmer/syntax@0.73.1": - version "0.73.1" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.73.1.tgz#9e3c898ba91ddb1d4e6f413452b0b84700910c83" - integrity sha512-TpTK9yAaoDOzdo+5itoJPRxrVWacYlGuHtJvATi96RJUTAxPz9b9M3AcVm0atcZW7WiA8X8J/weQ2KcIVgAYmw== +"@glimmer/syntax@0.73.2": + version "0.73.2" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.73.2.tgz#76438633f26b3fccb86bd7d25390a901737aa530" + integrity sha512-neZvKpfJETtUxnZMdpmD9qi4E9WaKhnQt63H+0iHkz1APriIZM5rsq12oiG9MSCvEiF5iP3auwJMU22XKPtyeQ== dependencies: - "@glimmer/interfaces" "0.73.1" - "@glimmer/util" "0.73.1" + "@glimmer/interfaces" "0.73.2" + "@glimmer/util" "0.73.2" "@handlebars/parser" "^2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.73.1": - version "0.73.1" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.73.1.tgz#f89bb7adba18315e00fbdb5a7c5a4913bbdebc6e" - integrity sha512-zFXY9OgR6wx7Cy4yYJkmgoUsdx3MQYAmZytuEDTghLXJyUoSh5Jcvner+qhFkqLSzj2pvE4btn3yUNnx3QOBtg== - dependencies: - "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.73.1" - "@simple-dom/interface" "^1.4.0" - "@glimmer/util@0.73.2": version "0.73.2" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.73.2.tgz#32ca1cec339a91f12f0359711f1a86fc1dcc13ca" From 0d1713ba811ba65330ff962010a6a631558fff28 Mon Sep 17 00:00:00 2001 From: Cyrille David Date: Mon, 25 Jan 2021 20:27:35 +0100 Subject: [PATCH 008/237] Add changelog entry for #9885 (#10133) --- changelog_unreleased/handlebars/9885.md | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 changelog_unreleased/handlebars/9885.md diff --git a/changelog_unreleased/handlebars/9885.md b/changelog_unreleased/handlebars/9885.md new file mode 100644 index 000000000..2fe1c4e9b --- /dev/null +++ b/changelog_unreleased/handlebars/9885.md @@ -0,0 +1,45 @@ +#### Add a whitespace sensitive mode (#9885 by @dcyriller) + +```sh +--html-whitespace-sensitivity strict +``` + + +```hbs +{{!-- Input --}} +123 {{mustache}} + +123 {{mustache}} +123 {{mustache}} + + +123 {{mustache}} + + +{{!-- Prettier stable --}} + + 123 {{mustache}} + + + 123 {{mustache}} + + + 123 {{mustache}} + + + 123 {{mustache}} + + +{{!-- Prettier main --}} +123 {{mustache}} + + 123 + {{mustache}} +123 + {{mustache}} + + + 123 + {{mustache}} + +``` From 93920425015253d3be97689b368ed4088ef41da5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jan 2021 21:28:26 +0200 Subject: [PATCH 009/237] Build(deps): Bump fast-glob from 3.2.4 to 3.2.5 (#10073) Bumps [fast-glob](https://github.com/mrmlnc/fast-glob) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/mrmlnc/fast-glob/releases) - [Commits](https://github.com/mrmlnc/fast-glob/compare/3.2.4...3.2.5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4504138cd..0bb146ddf 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "escape-string-regexp": "4.0.0", "espree": "7.3.1", "esutils": "2.0.3", - "fast-glob": "3.2.4", + "fast-glob": "3.2.5", "fast-json-stable-stringify": "2.1.0", "find-parent-dir": "0.3.0", "flow-parser": "0.143.1", diff --git a/yarn.lock b/yarn.lock index 8594eb855..aa3f01fef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3393,10 +3393,10 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@3.2.4, fast-glob@^3.1.1: - version "3.2.4" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" - integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== +fast-glob@3.2.5, fast-glob@^3.1.1: + version "3.2.5" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.5.tgz#7939af2a656de79a4f1901903ee8adcaa7cb9661" + integrity sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" From 743ef3de9bd463bc858f224152f47a78cd73fdde Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 26 Jan 2021 09:45:25 +0800 Subject: [PATCH 010/237] SCSS: Fix maps with keys that are lists or maps (#10005) --- changelog_unreleased/scss/10005.md | 17 ++ src/language-css/printer-postcss.js | 13 +- src/language-css/utils.js | 18 +- .../scss/map/__snapshots__/jsfmt.spec.js.snap | 261 ++++++++++++++++++ tests/scss/map/jsfmt.spec.js | 2 + tests/scss/map/key-values.scss | 12 + tests/scss/map/keys.scss | 12 + 7 files changed, 331 insertions(+), 4 deletions(-) create mode 100644 changelog_unreleased/scss/10005.md create mode 100644 tests/scss/map/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/scss/map/jsfmt.spec.js create mode 100644 tests/scss/map/key-values.scss create mode 100644 tests/scss/map/keys.scss diff --git a/changelog_unreleased/scss/10005.md b/changelog_unreleased/scss/10005.md new file mode 100644 index 000000000..17b441df8 --- /dev/null +++ b/changelog_unreleased/scss/10005.md @@ -0,0 +1,17 @@ +#### Fix maps with keys that are lists or maps (#10005 by @fisker) + + +```scss +// Input +$map: ( + ('my list'): 'hello world', +); + +// Prettier stable +TypeError: Cannot read property 'length' of undefined + +// Prettier main +$map: ( + ("my list"): "hello world", +); +``` diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js index b21297d1c..10a2f0971 100644 --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -57,6 +57,7 @@ const { hasParensAroundNode, hasEmptyRawBefore, isKeyValuePairNode, + isKeyInValuePairNode, isDetachedRulesetCallNode, isTemplatePlaceholderNode, isTemplatePropNode, @@ -856,8 +857,9 @@ function genericPrint(path, options, print) { const lastItem = node.groups[node.groups.length - 1]; const isLastItemComment = lastItem && lastItem.type === "value-comment"; + const isKey = isKeyInValuePairNode(node, parentNode); - return group( + const printed = group( [ node.open ? path.call(print, "open") : "", indent([ @@ -873,6 +875,7 @@ function genericPrint(path, options, print) { isKeyValuePairNode(node) && node.type === "value-comma_group" && node.groups && + node.groups[0].type !== "value-paren_group" && node.groups[2] && node.groups[2].type === "value-paren_group" ) { @@ -898,9 +901,11 @@ function genericPrint(path, options, print) { node.close ? path.call(print, "close") : "", ], { - shouldBreak: isSCSSMapItem, + shouldBreak: isSCSSMapItem && !isKey, } ); + + return isKey ? dedent(printed) : printed; } case "value-func": { return [ @@ -934,7 +939,9 @@ function genericPrint(path, options, print) { return [ node.value, // Don't add spaces on escaped colon `:`, e.g: grid-template-rows: [row-1-00\:00] auto; - (prevNode && prevNode.value[prevNode.value.length - 1] === "\\") || + (prevNode && + typeof prevNode.value === "string" && + prevNode.value[prevNode.value.length - 1] === "\\") || // Don't add spaces on `:` in `url` function (i.e. `url(fbglyph: cross-outline, fig-white)`) insideValueFunctionNode(path, "url") ? "" diff --git a/src/language-css/utils.js b/src/language-css/utils.js index 20e1bff38..1843cffde 100644 --- a/src/language-css/utils.js +++ b/src/language-css/utils.js @@ -401,7 +401,22 @@ function isWordNode(node) { } function isColonNode(node) { - return node.type === "value-colon"; + return node && node.type === "value-colon"; +} + +function isKeyInValuePairNode(node, parentNode) { + if (!isKeyValuePairNode(parentNode)) { + return false; + } + + const { groups } = parentNode; + const index = groups.indexOf(node); + + if (index === -1) { + return false; + } + + return isColonNode(groups[index + 1]); } function isMediaAndSupportsKeywords(node) { @@ -503,6 +518,7 @@ module.exports = { isPostcssSimpleVarNode, isKeyValuePairNode, isKeyValuePairInParenGroupNode, + isKeyInValuePairNode, isSCSSMapItemNode, isInlineValueCommentNode, isHashNode, diff --git a/tests/scss/map/__snapshots__/jsfmt.spec.js.snap b/tests/scss/map/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..729e8d5a7 --- /dev/null +++ b/tests/scss/map/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,261 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`key-values.scss - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +$map: ( + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + 1, +); + +=====================================output===================================== +$map: ( + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value" + ): + ( + "key": "value" + ), + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value" + ): + ( + "list" + ), + ( + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list" + ): + ( + "list" + ), + ( + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list" + ): + ( + "key": "value" + ), + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value" + ): + 1 +); + +================================================================================ +`; + +exports[`key-values.scss format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 + | printWidth +=====================================input====================================== +$map: ( + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + 1, +); + +=====================================output===================================== +$map: ( + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value", + ): + ( + "key": "value", + ), + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value", + ): + ( + "list", + ), + ( + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + ): + ( + "list", + ), + ( + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + "list", + ): + ( + "key": "value", + ), + ( + "key": "value", + "key": "value", + "key": "value", + "key": "value", + "key": "value", + ): + 1, +); + +================================================================================ +`; + +exports[`keys.scss - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +$map: ( + 'string': 'hello world', + ('list'): 'hello world', + ('key': 'value'): 'hello world', + ('list', 'long long long long long long long long long long long long long list'): 'hello world', + ('key': 'value','long long long long long long long long long long long long long map': 'value',): 'hello world', +); + +// #10000 +$map: ( + ('my list'): 'hello world', +); + +=====================================output===================================== +$map: ( + "string": "hello world", + ("list"): "hello world", + ("key": "value"): "hello world", + ( + "list", + "long long long long long long long long long long long long long list" + ): + "hello world", + ( + "key": "value", + "long long long long long long long long long long long long long map": + "value" + ): + "hello world" +); + +// #10000 +$map: ( + ("my list"): "hello world" +); + +================================================================================ +`; + +exports[`keys.scss format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 + | printWidth +=====================================input====================================== +$map: ( + 'string': 'hello world', + ('list'): 'hello world', + ('key': 'value'): 'hello world', + ('list', 'long long long long long long long long long long long long long list'): 'hello world', + ('key': 'value','long long long long long long long long long long long long long map': 'value',): 'hello world', +); + +// #10000 +$map: ( + ('my list'): 'hello world', +); + +=====================================output===================================== +$map: ( + "string": "hello world", + ("list"): "hello world", + ("key": "value"): "hello world", + ( + "list", + "long long long long long long long long long long long long long list", + ): + "hello world", + ( + "key": "value", + "long long long long long long long long long long long long long map": + "value", + ): + "hello world", +); + +// #10000 +$map: ( + ("my list"): "hello world", +); + +================================================================================ +`; diff --git a/tests/scss/map/jsfmt.spec.js b/tests/scss/map/jsfmt.spec.js new file mode 100644 index 000000000..f2558a4a9 --- /dev/null +++ b/tests/scss/map/jsfmt.spec.js @@ -0,0 +1,2 @@ +run_spec(__dirname, ["scss"], { trailingComma: "none" }); +run_spec(__dirname, ["scss"]); diff --git a/tests/scss/map/key-values.scss b/tests/scss/map/key-values.scss new file mode 100644 index 000000000..2041334cd --- /dev/null +++ b/tests/scss/map/key-values.scss @@ -0,0 +1,12 @@ +$map: ( + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('list'), + ('list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list', 'list'): + ('key': 'value',), + ('key': 'value', 'key': 'value','key': 'value','key': 'value','key': 'value',): + 1, +); diff --git a/tests/scss/map/keys.scss b/tests/scss/map/keys.scss new file mode 100644 index 000000000..fe008a5d4 --- /dev/null +++ b/tests/scss/map/keys.scss @@ -0,0 +1,12 @@ +$map: ( + 'string': 'hello world', + ('list'): 'hello world', + ('key': 'value'): 'hello world', + ('list', 'long long long long long long long long long long long long long list'): 'hello world', + ('key': 'value','long long long long long long long long long long long long long map': 'value',): 'hello world', +); + +// #10000 +$map: ( + ('my list'): 'hello world', +); From ce26805e84756953875f30a0c165bd6b09c94ea0 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 26 Jan 2021 09:46:14 +0800 Subject: [PATCH 011/237] Enable `unicorn/prefer-spread` (#10129) --- .eslintrc.yml | 1 + scripts/build/build.js | 4 +-- scripts/build/config.js | 2 +- scripts/release/utils.js | 8 +++--- scripts/sync-flow-tests.js | 6 ++--- src/cli/expand-patterns.js | 7 +++--- src/cli/usage.js | 2 +- src/common/load-plugins.js | 24 +++++++++--------- src/config/resolve-config.js | 8 +++--- src/document/doc-printer.js | 2 +- src/language-css/parser-postcss.js | 2 +- src/language-css/utils.js | 6 +++-- src/language-html/index.js | 5 ++-- src/language-html/print-preprocess.js | 17 +++++++------ src/language-html/printer-html.js | 26 ++++++++++---------- src/language-js/clean.js | 2 +- src/language-js/print/angular.js | 8 +++--- src/language-js/print/binaryish.js | 9 ++++--- src/language-js/print/call-arguments.js | 10 +++++--- src/language-js/print/interface.js | 6 ++--- src/language-js/print/object.js | 6 ++--- src/language-js/printer-estree.js | 2 +- src/language-markdown/index.js | 2 +- src/language-markdown/parser-markdown.js | 2 +- src/language-markdown/printer-markdown.js | 16 +++++++++--- src/language-markdown/utils.js | 7 +++--- src/language-yaml/printer-yaml.js | 2 +- src/language-yaml/utils.js | 18 +++++++++----- src/main/comments.js | 9 +++---- src/main/options-normalizer.js | 2 +- src/main/support.js | 2 +- tests_config/utils/create-snapshot.js | 30 +++++++++++------------ tests_integration/runPrettier.js | 7 +++--- website/playground/markdown.js | 8 +++--- 34 files changed, 147 insertions(+), 121 deletions(-) diff --git a/.eslintrc.yml b/.eslintrc.yml index a7135b083..89c520c2d 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -75,6 +75,7 @@ rules: unicorn/prefer-includes: error unicorn/prefer-number-properties: error unicorn/prefer-regexp-test: error + unicorn/prefer-spread: error unicorn/prefer-string-slice: error overrides: - files: diff --git a/scripts/build/build.js b/scripts/build/build.js index 0c4dccc34..ccd0e6517 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -97,9 +97,7 @@ async function createBundle(bundleConfig, cache, options) { const esmFile = path.join("dist/esm", output.replace(".js", ".mjs")); sizeTexts.push(`esm ${await getSizeText(esmFile)}`); } - process.stdout.write( - fitTerminal(output, sizeTexts.join(", ").concat(" ")) - ); + process.stdout.write(fitTerminal(output, `${sizeTexts.join(", ")} `)); } console.log(status.DONE); diff --git a/scripts/build/config.js b/scripts/build/config.js index c154f53d5..b99ecd2f1 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -168,7 +168,7 @@ function getFileOutput(bundle) { return bundle.output || path.basename(bundle.input); } -module.exports = coreBundles.concat(parsers).map((bundle) => ({ +module.exports = [...coreBundles, ...parsers].map((bundle) => ({ ...bundle, output: getFileOutput(bundle), })); diff --git a/scripts/release/utils.js b/scripts/release/utils.js index 22a8370e7..f19ff466c 100644 --- a/scripts/release/utils.js +++ b/scripts/release/utils.js @@ -34,10 +34,10 @@ function logPromise(name, promise) { } function runYarn(script) { - if (typeof script === "string") { - script = [script]; - } - return execa("yarn", ["--silent"].concat(script)).catch((error) => { + return execa("yarn", [ + "--silent", + ...(Array.isArray(script) ? script : [script]), + ]).catch((error) => { throw new Error(`\`yarn ${script}\` failed\n${error.stdout}`); }); } diff --git a/scripts/sync-flow-tests.js b/scripts/sync-flow-tests.js index 7705c78b8..68b0ef0d8 100644 --- a/scripts/sync-flow-tests.js +++ b/scripts/sync-flow-tests.js @@ -101,9 +101,9 @@ function run(argv) { "but that's not interesting for Prettier's tests.", "This is the skipped stuff:", "", - ] - .concat(skipped, "") - .join("\n") + ...skipped, + "", + ].join("\n") ); } diff --git a/src/cli/expand-patterns.js b/src/cli/expand-patterns.js index 7dba07ddb..424f69aa7 100644 --- a/src/cli/expand-patterns.js +++ b/src/cli/expand-patterns.js @@ -130,9 +130,10 @@ function* expandPatternsInternal(context) { const filenames = flat( context.languages.map((lang) => lang.filenames || []) ); - supportedFilesGlob = `**/{${extensions - .map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)) - .concat(filenames)}}`; + supportedFilesGlob = `**/{${[ + ...extensions.map((ext) => "*" + (ext[0] === "." ? ext : "." + ext)), + ...filenames, + ]}}`; } return supportedFilesGlob; } diff --git a/src/cli/usage.js b/src/cli/usage.js index 2babc28e3..151de5a6a 100644 --- a/src/cli/usage.js +++ b/src/cli/usage.js @@ -148,7 +148,7 @@ function createUsage(context) { return `${category} options:\n\n${indent(categoryOptions, 2)}`; }); - return [constant.usageSummary].concat(optionsUsage, [""]).join("\n\n"); + return [constant.usageSummary, ...optionsUsage, ""].join("\n\n"); } function createDetailedUsage(context, flag) { diff --git a/src/common/load-plugins.js b/src/common/load-plugins.js index 6b1934133..e94b1884b 100644 --- a/src/common/load-plugins.js +++ b/src/common/load-plugins.js @@ -4,6 +4,7 @@ const fs = require("fs"); const path = require("path"); const uniqBy = require("lodash/uniqBy"); const partition = require("lodash/partition"); +const flatten = require("lodash/flatten"); const globby = require("globby"); const mem = require("mem"); const internalPlugins = require("../languages"); @@ -56,8 +57,8 @@ function load(plugins, pluginSearchDirs) { } ); - const externalAutoLoadPluginInfos = pluginSearchDirs - .map((pluginSearchDir) => { + const externalAutoLoadPluginInfos = flatten( + pluginSearchDirs.map((pluginSearchDir) => { const resolvedPluginSearchDir = path.resolve( process.cwd(), pluginSearchDir @@ -85,19 +86,20 @@ function load(plugins, pluginSearchDirs) { requirePath: resolve(pluginName, { paths: [resolvedPluginSearchDir] }), })); }) - .reduce((a, b) => a.concat(b), []); + ); - const externalPlugins = uniqBy( - externalManualLoadPluginInfos.concat(externalAutoLoadPluginInfos), - "requirePath" - ) - .map((externalPluginInfo) => ({ + const externalPlugins = [ + ...uniqBy( + [...externalManualLoadPluginInfos, ...externalAutoLoadPluginInfos], + "requirePath" + ).map((externalPluginInfo) => ({ name: externalPluginInfo.name, ...eval("require")(externalPluginInfo.requirePath), - })) - .concat(externalPluginInstances); + })), + ...externalPluginInstances, + ]; - return internalPlugins.concat(externalPlugins); + return [...internalPlugins, ...externalPlugins]; } function findPluginsInNodeModules(nodeModulesDir) { diff --git a/src/config/resolve-config.js b/src/config/resolve-config.js index a8c55977a..011fb6a50 100644 --- a/src/config/resolve-config.js +++ b/src/config/resolve-config.js @@ -154,9 +154,11 @@ function mergeOverrides(configResult, filePath) { } // Based on eslint: https://github.com/eslint/eslint/blob/master/lib/config/config-ops.js -function pathMatchesGlobs(filePath, patterns, excludedPatterns) { - const patternList = [].concat(patterns); - const excludedPatternList = [].concat(excludedPatterns || []); +function pathMatchesGlobs(filePath, patterns, excludedPatterns = []) { + const patternList = Array.isArray(patterns) ? patterns : [patterns]; + const excludedPatternList = Array.isArray(excludedPatterns) + ? excludedPatterns + : [excludedPatterns]; const opts = { matchBase: true, dot: true }; return ( diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js index 897fb9b11..39d8efdea 100644 --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -45,7 +45,7 @@ function generateInd(ind, newPart, options) { const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) - : ind.queue.concat(newPart); + : [...ind.queue, newPart]; let value = ""; let length = 0; diff --git a/src/language-css/parser-postcss.js b/src/language-css/parser-postcss.js index 1dbdfcb6a..81c14991d 100644 --- a/src/language-css/parser-postcss.js +++ b/src/language-css/parser-postcss.js @@ -73,7 +73,7 @@ function parseValueNode(valueNode, options) { for (let i = 0; i < groups.length; i++) { const group = groups[i]; if (group.type === "comma_group") { - groupList = groupList.concat(group.groups); + groupList = [...groupList, ...group.groups]; } else { groupList.push(group); } diff --git a/src/language-css/utils.js b/src/language-css/utils.js index 1843cffde..4174f4c1d 100644 --- a/src/language-css/utils.js +++ b/src/language-css/utils.js @@ -30,7 +30,7 @@ const colorAdjusterFunctions = new Set([ ]); function getAncestorCounter(path, typeOrTypes) { - const types = [].concat(typeOrTypes); + const types = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes]; let counter = -1; let ancestorNode; @@ -149,7 +149,9 @@ function insideICSSRuleNode(path) { } function insideAtRuleNode(path, atRuleNameOrAtRuleNames) { - const atRuleNames = [].concat(atRuleNameOrAtRuleNames); + const atRuleNames = Array.isArray(atRuleNameOrAtRuleNames) + ? atRuleNameOrAtRuleNames + : [atRuleNameOrAtRuleNames]; const atRuleAncestorNode = getAncestorNode(path, "css-atrule"); return ( diff --git a/src/language-html/index.js b/src/language-html/index.js index 61882c524..1caf94c65 100644 --- a/src/language-html/index.js +++ b/src/language-html/index.js @@ -17,9 +17,10 @@ const languages = [ since: "1.15.0", parsers: ["html"], vscodeLanguageIds: ["html"], - extensions: data.extensions.concat([ + extensions: [ + ...data.extensions, ".mjml", // MJML is considered XML in Linguist but it should be formatted as HTML - ]), + ], })), createLanguage(require("linguist-languages/data/HTML.json"), () => ({ name: "Lightning Web Components", diff --git a/src/language-html/print-preprocess.js b/src/language-html/print-preprocess.js index 5a790780f..896d72bcd 100644 --- a/src/language-html/print-preprocess.js +++ b/src/language-html/print-preprocess.js @@ -331,7 +331,7 @@ function extractWhitespaces(ast /*, options*/) { // extract whitespace nodes .reduce((newChildren, child) => { if (child.type !== "text" || isWhitespaceSensitive) { - return newChildren.concat(child); + return [...newChildren, child]; } const localChildren = []; @@ -361,7 +361,7 @@ function extractWhitespaces(ast /*, options*/) { localChildren.push({ type: TYPE_WHITESPACE }); } - return newChildren.concat(localChildren); + return [...newChildren, ...localChildren]; }, []) // set hasLeadingSpaces/hasTrailingSpaces and filter whitespace nodes .reduce((newChildren, child, i, children) => { @@ -375,11 +375,14 @@ function extractWhitespaces(ast /*, options*/) { i !== children.length - 1 && children[i + 1].type === TYPE_WHITESPACE; - return newChildren.concat({ - ...child, - hasLeadingSpaces, - hasTrailingSpaces, - }); + return [ + ...newChildren, + { + ...child, + hasLeadingSpaces, + hasTrailingSpaces, + }, + ]; }, []), }); }); diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index d4863e233..46aec9c30 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -228,13 +228,13 @@ function genericPrint(path, options, print) { case "element": case "ieConditionalComment": { if (shouldPreserveContent(node, options)) { - return [].concat( + return [ printOpeningTagPrefix(node, options), group(printOpeningTag(path, options, print)), - replaceEndOfLineWith(getNodeContent(node, options), literalline), - printClosingTag(node, options), - printClosingTagSuffix(node, options) - ); + ...replaceEndOfLineWith(getNodeContent(node, options), literalline), + ...printClosingTag(node, options), + printClosingTagSuffix(node, options), + ]; } /** * do not break: @@ -505,25 +505,25 @@ function printChildren(path, options, print) { } } - return [].concat( - prevParts, + return [ + ...prevParts, group([ ...leadingParts, group([printChild(childPath), ...trailingParts], { id: groupIds[childIndex], }), ]), - nextParts - ); + ...nextParts, + ]; }, "children"); function printChild(childPath) { const child = childPath.getValue(); if (hasPrettierIgnore(child)) { - return [].concat( + return [ printOpeningTagPrefix(child, options), - replaceEndOfLineWith( + ...replaceEndOfLineWith( options.originalText.slice( locStart(child) + (child.prev && needsToBorrowNextOpeningTagStartMarker(child.prev) @@ -536,8 +536,8 @@ function printChildren(path, options, print) { ), literalline ), - printClosingTagSuffix(child, options) - ); + printClosingTagSuffix(child, options), + ]; } return print(childPath); diff --git a/src/language-js/clean.js b/src/language-js/clean.js index 5604e5b7b..8da157caf 100644 --- a/src/language-js/clean.js +++ b/src/language-js/clean.js @@ -103,7 +103,7 @@ function clean(ast, newObj, parent) { .map((container) => container.expression); const quasis = templateLiterals.reduce( - (quasis, templateLiteral) => quasis.concat(templateLiteral.quasis), + (quasis, templateLiteral) => [...quasis, ...templateLiteral.quasis], [] ); diff --git a/src/language-js/print/angular.js b/src/language-js/print/angular.js index 166150a0f..d95da9c40 100644 --- a/src/language-js/print/angular.js +++ b/src/language-js/print/angular.js @@ -12,12 +12,12 @@ function printAngular(path, options, print) { const n = path.getValue(); switch (n.type) { case "NGRoot": - return [].concat( + return [ path.call(print, "node"), !hasComment(n.node) - ? [] - : [" //", getComments(n.node)[0].value.trimEnd()] - ); + ? "" + : " //" + getComments(n.node)[0].value.trimEnd(), + ]; case "NGPipeExpression": return printBinaryishExpression(path, options, print); case "NGChainedExpression": diff --git a/src/language-js/print/binaryish.js b/src/language-js/print/binaryish.js index c38235cbd..fdad81b56 100644 --- a/src/language-js/print/binaryish.js +++ b/src/language-js/print/binaryish.js @@ -196,8 +196,9 @@ function printBinaryishExpressions( // which is unique in that it is right-associative.) if (shouldFlatten(node.operator, node.left.operator)) { // Flatten them out by recursively calling this function. - parts = parts.concat( - path.call( + parts = [ + ...parts, + ...path.call( (left) => printBinaryishExpressions( left, @@ -207,8 +208,8 @@ function printBinaryishExpressions( isInsideParenthesis ), "left" - ) - ); + ), + ]; } else { parts.push(group(path.call(print, "left"))); } diff --git a/src/language-js/print/call-arguments.js b/src/language-js/print/call-arguments.js index 9ee644498..8121ec3a4 100644 --- a/src/language-js/print/call-arguments.js +++ b/src/language-js/print/call-arguments.js @@ -159,12 +159,14 @@ function printCallArguments(path, options, print) { hasEmptyLineFollowingFirstArg ? hardline : line, hasEmptyLineFollowingFirstArg ? hardline : "", ], - ].concat(printedArguments.slice(1)); + ...printedArguments.slice(1), + ]; } if (shouldGroupLast && i === args.length - 1) { - printedExpanded = printedArguments - .slice(0, -1) - .concat(argPath.call((p) => print(p, { expandLastArg: true }))); + printedExpanded = [ + ...printedArguments.slice(0, -1), + argPath.call((p) => print(p, { expandLastArg: true })), + ]; } }); diff --git a/src/language-js/print/interface.js b/src/language-js/print/interface.js index c6811babe..428fbd821 100644 --- a/src/language-js/print/interface.js +++ b/src/language-js/print/interface.js @@ -63,12 +63,10 @@ function printInterface(path, options, print) { const printedExtends = extendsParts; if (shouldIndentOnlyHeritageClauses) { parts.push( - group( - partsGroup.concat(ifBreak(indent(printedExtends), printedExtends)) - ) + group([...partsGroup, ifBreak(indent(printedExtends), printedExtends)]) ); } else { - parts.push(group(indent(partsGroup.concat(printedExtends)))); + parts.push(group(indent([...partsGroup, ...printedExtends]))); } } else { parts.push(...partsGroup, ...extendsParts); diff --git a/src/language-js/print/object.js b/src/language-js/print/object.js index e5c2b387d..c8ff9dc45 100644 --- a/src/language-js/print/object.js +++ b/src/language-js/print/object.js @@ -113,7 +113,7 @@ function printObject(path, options, print) { const props = propsAndLoc .sort((a, b) => a.loc - b.loc) .map((prop) => { - const result = separatorParts.concat(group(prop.printed)); + const result = [...separatorParts, group(prop.printed)]; separatorParts = [separator, line]; if ( (prop.node.type === "TSPropertySignature" || @@ -147,9 +147,9 @@ function printObject(path, options, print) { "...", ]; } else { - printed = "..."; + printed = ["..."]; } - props.push(separatorParts.concat(printed)); + props.push([...separatorParts, ...printed]); } const lastElem = getLast(n[propertiesField]); diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 5253a265a..a2fc6dbd5 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -193,7 +193,7 @@ function genericPrint(path, options, printPath, args) { } if (decorators.length > 0) { - return group(decorators.concat(parts)); + return group([...decorators, ...parts]); } return parts; } diff --git a/src/language-markdown/index.js b/src/language-markdown/index.js index 318a691a4..994023c43 100644 --- a/src/language-markdown/index.js +++ b/src/language-markdown/index.js @@ -9,7 +9,7 @@ const languages = [ since: "1.8.0", parsers: ["markdown"], vscodeLanguageIds: ["markdown"], - filenames: data.filenames.concat(["README"]), + filenames: [...data.filenames, "README"], extensions: data.extensions.filter((extension) => extension !== ".mdx"), })), createLanguage(require("linguist-languages/data/Markdown.json"), () => ({ diff --git a/src/language-markdown/parser-markdown.js b/src/language-markdown/parser-markdown.js index 67008abaf..494b77977 100644 --- a/src/language-markdown/parser-markdown.js +++ b/src/language-markdown/parser-markdown.js @@ -64,7 +64,7 @@ function htmlToJsx() { function frontMatter() { const proto = this.Parser.prototype; - proto.blockMethods = ["frontMatter"].concat(proto.blockMethods); + proto.blockMethods = ["frontMatter", ...proto.blockMethods]; proto.blockTokenizers.frontMatter = tokenizer; function tokenizer(eat, value) { diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index 0b1b02fb1..d9db1dc3c 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -522,7 +522,7 @@ function getNthSiblingIndex(node, parentNode, condition) { } function getAncestorCounter(path, typeOrTypes) { - const types = [].concat(typeOrTypes); + const types = Array.isArray(typeOrTypes) ? typeOrTypes : [typeOrTypes]; let counter = -1; let ancestorNode; @@ -840,8 +840,18 @@ function shouldRemainTheSameContent(path) { ); } -function printUrl(url, dangerousCharOrChars) { - const dangerousChars = [" "].concat(dangerousCharOrChars || []); +/** + * @param {string} url + * @param {string[] | string} [dangerousCharOrChars] + * @returns {string} + */ +function printUrl(url, dangerousCharOrChars = []) { + const dangerousChars = [ + " ", + ...(Array.isArray(dangerousCharOrChars) + ? dangerousCharOrChars + : [dangerousCharOrChars]), + ]; return new RegExp(dangerousChars.map((x) => `\\${x}`).join("|")).test(url) ? `<${url}>` : url; diff --git a/src/language-markdown/utils.js b/src/language-markdown/utils.js index 5520e7574..8d839260c 100644 --- a/src/language-markdown/utils.js +++ b/src/language-markdown/utils.js @@ -28,11 +28,12 @@ const INLINE_NODE_TYPES = [ "inlineMath", ]; -const INLINE_NODE_WRAPPER_TYPES = INLINE_NODE_TYPES.concat([ +const INLINE_NODE_WRAPPER_TYPES = [ + ...INLINE_NODE_TYPES, "tableCell", "paragraph", "heading", -]); +]; const kRegex = new RegExp(kPattern); const punctuationRegex = new RegExp(punctuationPattern); @@ -208,7 +209,7 @@ function mapAst(ast, handler) { const newNode = { ...handler(node, index, parentStack) }; if (newNode.children) { newNode.children = newNode.children.map((child, index) => - preorder(child, index, [newNode].concat(parentStack)) + preorder(child, index, [newNode, ...parentStack]) ); } diff --git a/src/language-yaml/printer-yaml.js b/src/language-yaml/printer-yaml.js index bf6da30b5..3e2510d67 100644 --- a/src/language-yaml/printer-yaml.js +++ b/src/language-yaml/printer-yaml.js @@ -241,7 +241,7 @@ function printNode(node, parentNode, path, options, print) { ]; } case "directive": - return ["%", join(" ", [node.name].concat(node.parameters))]; + return ["%", join(" ", [node.name, ...node.parameters])]; case "comment": return ["#", node.value]; case "alias": diff --git a/src/language-yaml/utils.js b/src/language-yaml/utils.js index a413cbf6a..2151c65bc 100644 --- a/src/language-yaml/utils.js +++ b/src/language-yaml/utils.js @@ -227,8 +227,11 @@ function getFlowScalarLineContents(nodeType, content, options) { getLast(getLast(reduced)).endsWith("\\") ) ) - ? reduced.concat([reduced.pop().concat(lineContentWords)]) - : reduced.concat([lineContentWords]), + ? [ + ...reduced.slice(0, -1), + [...getLast(reduced), ...lineContentWords], + ] + : [...reduced, lineContentWords], [] ) .map((lineContentWords) => @@ -281,8 +284,11 @@ function getBlockValueLineContents( lineContentWords.length > 0 && !/^\s/.test(lineContentWords[0]) && !/^\s|\s$/.test(getLast(reduced)) - ? reduced.concat([reduced.pop().concat(lineContentWords)]) - : reduced.concat([lineContentWords]), + ? [ + ...reduced.slice(0, -1), + [...getLast(reduced), ...lineContentWords], + ] + : [...reduced, lineContentWords], [] ) .map((lineContentWords) => @@ -290,8 +296,8 @@ function getBlockValueLineContents( (reduced, word) => // disallow trailing spaces reduced.length > 0 && /\s$/.test(getLast(reduced)) - ? reduced.concat(reduced.pop() + " " + word) - : reduced.concat(word), + ? [...reduced.slice(0, -1), getLast(reduced) + " " + word] + : [...reduced, word], [] ) ) diff --git a/src/main/comments.js b/src/main/comments.js index a0476f577..0594d931e 100644 --- a/src/main/comments.js +++ b/src/main/comments.js @@ -581,11 +581,10 @@ function printComments(path, print, options, needsSemi) { } }, "comments"); - return prependCursorPlaceholder( - path, - options, - leadingParts.concat(trailingParts) - ); + return prependCursorPlaceholder(path, options, [ + ...leadingParts, + ...trailingParts, + ]); } function ensureAllCommentsPrinted(astComments) { diff --git a/src/main/options-normalizer.js b/src/main/options-normalizer.js index d8438aac9..4c6d0c16e 100644 --- a/src/main/options-normalizer.js +++ b/src/main/options-normalizer.js @@ -205,7 +205,7 @@ function optionInfoToSchema(optionInfo, { isCLI, optionInfos }) { return optionInfo.array ? vnopts.ArraySchema.create({ - ...(isCLI ? { preprocess: (v) => [].concat(v) } : {}), + ...(isCLI ? { preprocess: (v) => (Array.isArray(v) ? v : [v]) } : {}), ...handlers, valueSchema: SchemaConstructor.create(parameters), }) diff --git a/src/main/support.js b/src/main/support.js index 8bff0cf03..a6aa0d83f 100644 --- a/src/main/support.js +++ b/src/main/support.js @@ -30,7 +30,7 @@ function getSupportInfo({ const version = currentVersion.split("-", 1)[0]; const languages = plugins - .reduce((all, plugin) => all.concat(plugin.languages || []), []) + .reduce((all, plugin) => [...all, ...(plugin.languages || [])], []) .filter(filterSince); const options = arrayify( diff --git a/tests_config/utils/create-snapshot.js b/tests_config/utils/create-snapshot.js index 0db847e48..0a5eb8755 100644 --- a/tests_config/utils/create-snapshot.js +++ b/tests_config/utils/create-snapshot.js @@ -25,23 +25,23 @@ function createSnapshot(input, output, options, { codeOffset }) { const separatorWidth = 80; const printWidthIndicator = options.printWidth > 0 && Number.isFinite(options.printWidth) - ? (codeOffset ? " ".repeat(codeOffset - 1) + "|" : "") + - " ".repeat(options.printWidth) + - "| printWidth" + ? [ + (codeOffset ? " ".repeat(codeOffset - 1) + "|" : "") + + " ".repeat(options.printWidth) + + "| printWidth", + ] : []; return raw( - [] - .concat( - printSeparator(separatorWidth, "options"), - printOptions(options), - printWidthIndicator, - printSeparator(separatorWidth, "input"), - input, - printSeparator(separatorWidth, "output"), - output, - printSeparator(separatorWidth) - ) - .join("\n") + [ + printSeparator(separatorWidth, "options"), + printOptions(options), + ...printWidthIndicator, + printSeparator(separatorWidth, "input"), + input, + printSeparator(separatorWidth, "output"), + output, + printSeparator(separatorWidth), + ].join("\n") ); } diff --git a/tests_integration/runPrettier.js b/tests_integration/runPrettier.js index 8440f1157..7ebb7f7e7 100644 --- a/tests_integration/runPrettier.js +++ b/tests_integration/runPrettier.js @@ -6,9 +6,8 @@ const stripAnsi = require("strip-ansi"); const { SynchronousPromise } = require("synchronous-promise"); const { prettierCli, thirdParty } = require("./env"); -function runPrettier(dir, args, options) { - args = args || []; - options = options || {}; +function runPrettier(dir, args = [], options = {}) { + args = Array.isArray(args) ? args : [args]; let status; let stdout = ""; @@ -66,7 +65,7 @@ function runPrettier(dir, args, options) { process.chdir(normalizeDir(dir)); process.stdin.isTTY = !!options.isTTY; process.stdout.isTTY = !!options.stdoutIsTTY; - process.argv = ["path/to/node", "path/to/prettier/bin"].concat(args); + process.argv = ["path/to/node", "path/to/prettier/bin", ...args]; jest.resetModules(); diff --git a/website/playground/markdown.js b/website/playground/markdown.js index e50065555..9a1214b00 100644 --- a/website/playground/markdown.js +++ b/website/playground/markdown.js @@ -22,11 +22,11 @@ function formatMarkdown( "", "**Output:**", codeBlock(output, syntax), + ...(isIdempotent + ? [] + : ["", "**Second Output:**", codeBlock(output2, syntax)]), + ...(full ? ["", "**Expected behavior:**", ""] : []), ] - .concat( - isIdempotent ? [] : ["", "**Second Output:**", codeBlock(output2, syntax)] - ) - .concat(full ? ["", "**Expected behavior:**", ""] : []) .filter((part) => part != null) .join("\n"); } From 89e5751b46970284b34e0848e677391300e22d5c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 26 Jan 2021 09:48:31 +0800 Subject: [PATCH 012/237] Use `Object.{entries,values}` if possible (#10131) --- src/cli/expand-patterns.js | 6 +++--- src/cli/option.js | 13 +++++++------ src/cli/usage.js | 7 ++----- src/language-html/ast.js | 15 +++++++++------ src/language-html/utils.js | 4 ++-- src/language-js/utils.js | 2 +- src/main/comments.js | 6 +++--- src/main/massage-ast.js | 6 +++--- src/main/options.js | 4 ++-- 9 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/cli/expand-patterns.js b/src/cli/expand-patterns.js index 424f69aa7..d37ed34f5 100644 --- a/src/cli/expand-patterns.js +++ b/src/cli/expand-patterns.js @@ -55,9 +55,9 @@ function* expandPatternsInternal(context) { const globOptions = { dot: true, - ignore: Object.keys(silentlyIgnoredDirs) - .filter((dir) => silentlyIgnoredDirs[dir]) - .map((dir) => "**/" + dir), + ignore: Object.entries(silentlyIgnoredDirs) + .filter(([, ignored]) => ignored) + .map(([dir]) => "**/" + dir), }; let supportedFilesGlob; diff --git a/src/cli/option.js b/src/cli/option.js index b71726382..5533e9666 100644 --- a/src/cli/option.js +++ b/src/cli/option.js @@ -20,13 +20,14 @@ function getOptions(argv, detailedOptions) { } function cliifyOptions(object, apiDetailedOptionMap) { - return Object.keys(object || {}).reduce((output, key) => { - const apiOption = apiDetailedOptionMap[key]; - const cliKey = apiOption ? apiOption.name : key; + return fromPairs( + Object.entries(object || {}).map(([key, value]) => { + const apiOption = apiDetailedOptionMap[key]; + const cliKey = apiOption ? apiOption.name : key; - output[dashify(cliKey)] = object[key]; - return output; - }, {}); + return [dashify(cliKey), value]; + }) + ); } function createApiDetailedOptionMap(detailedOptions) { diff --git a/src/cli/usage.js b/src/cli/usage.js index 151de5a6a..2685b3bc6 100644 --- a/src/cli/usage.js +++ b/src/cli/usage.js @@ -176,11 +176,8 @@ function createDetailedUsage(context, flag) { const pluginDefaults = option.pluginDefaults && Object.keys(option.pluginDefaults).length > 0 - ? `\nPlugin defaults:${Object.keys(option.pluginDefaults).map( - (key) => - `\n* ${key}: ${createDefaultValueDisplay( - option.pluginDefaults[key] - )}` + ? `\nPlugin defaults:${Object.entries(option.pluginDefaults).map( + ([key, value]) => `\n* ${key}: ${createDefaultValueDisplay(value)}` )}` : ""; return `${header}${description}${choices}${defaults}${pluginDefaults}`; diff --git a/src/language-html/ast.js b/src/language-html/ast.js index f612f67be..52b709ac6 100644 --- a/src/language-html/ast.js +++ b/src/language-html/ast.js @@ -1,5 +1,6 @@ "use strict"; +const fromPairs = require("lodash/fromPairs"); const { isNonEmptyArray } = require("../common/util"); const NODES_KEYS = { attrs: true, @@ -8,8 +9,7 @@ const NODES_KEYS = { class Node { constructor(props = {}) { - for (const key of Object.keys(props)) { - const value = props[key]; + for (const [key, value] of Object.entries(props)) { if (key in NODES_KEYS) { this._setNodes(key, value); } else { @@ -123,10 +123,13 @@ function cloneAndUpdateNodes(nodes, parent) { } function setNonEnumerableProperties(obj, props) { - const descriptors = Object.keys(props).reduce((reduced, key) => { - reduced[key] = { value: props[key], enumerable: false }; - return reduced; - }, {}); + const descriptors = fromPairs( + Object.entries(props).map(([key, value]) => [ + key, + { value, enumerable: false }, + ]) + ); + Object.defineProperties(obj, descriptors); } diff --git a/src/language-html/utils.js b/src/language-html/utils.js index e4ac2446f..06b85e362 100644 --- a/src/language-html/utils.js +++ b/src/language-html/utils.js @@ -46,8 +46,8 @@ function arrayToMap(array) { function mapObject(object, fn) { const newObject = Object.create(null); - for (const key of Object.keys(object)) { - newObject[key] = fn(object[key], key); + for (const [key, value] of Object.entries(object)) { + newObject[key] = fn(value, key); } return newObject; } diff --git a/src/language-js/utils.js b/src/language-js/utils.js index 56eceef21..744685678 100644 --- a/src/language-js/utils.js +++ b/src/language-js/utils.js @@ -87,7 +87,7 @@ function hasNode(node, fn) { const result = fn(node); return typeof result === "boolean" ? result - : Object.keys(node).some((key) => hasNode(node[key], fn)); + : Object.values(node).some((value) => hasNode(value, fn)); } /** diff --git a/src/main/comments.js b/src/main/comments.js index 0594d931e..45bd8abfd 100644 --- a/src/main/comments.js +++ b/src/main/comments.js @@ -50,16 +50,16 @@ function getSortedChildNodes(node, options, resultArray) { (printer.getCommentChildNodes && printer.getCommentChildNodes(node, options)) || (typeof node === "object" && - Object.keys(node) + Object.entries(node) .filter( - (n) => + ([n]) => n !== "enclosingNode" && n !== "precedingNode" && n !== "followingNode" && n !== "tokens" && n !== "comments" ) - .map((n) => node[n])); + .map(([, value]) => value)); if (!childNodes) { return; diff --git a/src/main/massage-ast.js b/src/main/massage-ast.js index f2ce7beb7..784b568e9 100644 --- a/src/main/massage-ast.js +++ b/src/main/massage-ast.js @@ -18,9 +18,9 @@ function massageAST(ast, options, parent) { } const newObj = {}; - for (const key of Object.keys(ast)) { - if (!ignoredProperties.has(key) && typeof ast[key] !== "function") { - newObj[key] = massageAST(ast[key], options, ast); + for (const [key, value] of Object.entries(ast)) { + if (!ignoredProperties.has(key) && typeof value !== "function") { + newObj[key] = massageAST(value, options, ast); } } diff --git a/src/main/options.js b/src/main/options.js index 544f31e26..fecf5834d 100644 --- a/src/main/options.js +++ b/src/main/options.js @@ -86,9 +86,9 @@ function normalize(options, opts) { const mixedDefaults = { ...defaults, ...pluginDefaults }; - for (const k of Object.keys(mixedDefaults)) { + for (const [k, value] of Object.entries(mixedDefaults)) { if (rawOptions[k] == null) { - rawOptions[k] = mixedDefaults[k]; + rawOptions[k] = value; } } From e8a5d867cde1d487780c7dfd93c4130b942823a3 Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 26 Jan 2021 09:54:20 +0800 Subject: [PATCH 013/237] Use `...` instead of `.concat()` --- src/utils/front-matter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/front-matter.js b/src/utils/front-matter.js index ac918cb43..06e7ffc6c 100644 --- a/src/utils/front-matter.js +++ b/src/utils/front-matter.js @@ -16,8 +16,7 @@ const DELIMITER_MAP = { function parse(text) { const startDelimiterRegex = Object.keys(DELIMITER_MAP).map(escape).join("|"); - const endDelimiterRegex = Object.keys(DELIMITER_MAP) - .concat(YAML_END_DELIMITER) + const endDelimiterRegex = [...Object.keys(DELIMITER_MAP), YAML_END_DELIMITER] .map(escape) .join("|"); From 59dfc0f3f387f26c8eeb92c2cef3d5d3f9c4b686 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Jan 2021 05:56:42 +0000 Subject: [PATCH 014/237] Build(deps): Bump @typescript-eslint/typescript-estree (#10137) --- package.json | 2 +- yarn.lock | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 0bb146ddf..4c564541a 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@babel/parser": "7.12.11", "@glimmer/syntax": "0.73.2", "@iarna/toml": "2.2.5", - "@typescript-eslint/typescript-estree": "4.14.0", + "@typescript-eslint/typescript-estree": "4.14.1", "angular-estree-parser": "2.3.0", "angular-html-parser": "1.7.1", "camelcase": "6.2.0", diff --git a/yarn.lock b/yarn.lock index aa3f01fef..f3f3d228b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1628,6 +1628,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.0.tgz#d8a8202d9b58831d6fd9cee2ba12f8a5a5dd44b6" integrity sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A== +"@typescript-eslint/types@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.1.tgz#b3d2eb91dafd0fd8b3fce7c61512ac66bd0364aa" + integrity sha512-SkhzHdI/AllAgQSxXM89XwS1Tkic7csPdndUuTKabEwRcEfR8uQ/iPA3Dgio1rqsV3jtqZhY0QQni8rLswJM2w== + "@typescript-eslint/typescript-estree@4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.0.1.tgz#29a43c7060641ec51c902d9f50ac7c5866ec479f" @@ -1642,13 +1647,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.14.0": - version "4.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz#4bcd67486e9acafc3d0c982b23a9ab8ac8911ed7" - integrity sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag== +"@typescript-eslint/typescript-estree@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.1.tgz#20d3b8c8e3cdc8f764bdd5e5b0606dd83da6075b" + integrity sha512-M8+7MbzKC1PvJIA8kR2sSBnex8bsR5auatLCnVlNTJczmJgqRn8M+sAlQfkEq7M4IY3WmaNJ+LJjPVRrREVSHQ== dependencies: - "@typescript-eslint/types" "4.14.0" - "@typescript-eslint/visitor-keys" "4.14.0" + "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/visitor-keys" "4.14.1" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -1664,12 +1669,12 @@ "@typescript-eslint/types" "4.0.1" eslint-visitor-keys "^2.0.0" -"@typescript-eslint/visitor-keys@4.14.0": - version "4.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz#b1090d9d2955b044b2ea2904a22496849acbdf54" - integrity sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA== +"@typescript-eslint/visitor-keys@4.14.1": + version "4.14.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.1.tgz#e93c2ff27f47ee477a929b970ca89d60a117da91" + integrity sha512-TAblbDXOI7bd0C/9PE1G+AFo7R5uc+ty1ArDoxmrC1ah61Hn6shURKy7gLdRb1qKJmjHkqu5Oq+e4Kt0jwf1IA== dependencies: - "@typescript-eslint/types" "4.14.0" + "@typescript-eslint/types" "4.14.1" eslint-visitor-keys "^2.0.0" "@webassemblyjs/ast@1.11.0": From c5484f7a0a389d1c98839c93286150837798a1d8 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 26 Jan 2021 18:56:42 +0200 Subject: [PATCH 015/237] website: bigger font for
in blog (#10142) --- website/static/overrides.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/static/overrides.css b/website/static/overrides.css index 01b87f2b4..114606cc4 100644 --- a/website/static/overrides.css +++ b/website/static/overrides.css @@ -513,6 +513,10 @@ a { margin-top: 10px; } +.mainContainer .wrapper .post h5 { + font-size: 1.125em; +} + .hljs { padding: 16px; overflow: auto; From 27f91167d4069a9cd36e95efffa245a8053f9af0 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Wed, 27 Jan 2021 01:34:23 +0800 Subject: [PATCH 016/237] CI: Add `Mark issue duplicate` job (#10140) Co-authored-by: fisker Cheung --- .github/workflows/mark-issue-duplicate.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/mark-issue-duplicate.yml diff --git a/.github/workflows/mark-issue-duplicate.yml b/.github/workflows/mark-issue-duplicate.yml new file mode 100644 index 000000000..f181aaa47 --- /dev/null +++ b/.github/workflows/mark-issue-duplicate.yml @@ -0,0 +1,17 @@ +name: Mark Issue Duplicate + +on: + issue_comment: + types: + - created + +jobs: + mark-duplicate: + runs-on: ubuntu-latest + steps: + - uses: actions-cool/issues-helper@v2.0.0 + with: + actions: "mark-duplicate" + token: ${{ secrets.GITHUB_TOKEN }} + duplicate-labels: "type:duplicate" + close-issue: true From cdab1d739294abc20e2be97102a4d50c98b736f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jan 2021 02:13:26 +0800 Subject: [PATCH 017/237] Build(deps-dev): Bump @typescript-eslint/types from 4.14.0 to 4.14.1 (#10138) Bumps [@typescript-eslint/types](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/visitor-keys) from 4.14.0 to 4.14.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/visitor-keys/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.14.1/packages/visitor-keys) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 4c564541a..c28ea3b99 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@rollup/plugin-replace": "2.3.4", "@types/estree": "0.0.46", "@types/node": "14.14.0", - "@typescript-eslint/types": "4.14.0", + "@typescript-eslint/types": "4.14.1", "babel-jest": "26.6.3", "babel-loader": "8.2.2", "benchmark": "2.1.4", diff --git a/yarn.lock b/yarn.lock index f3f3d228b..9fa82137c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1623,11 +1623,6 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.0.1.tgz#1cf72582f764931f085cb8230ff215980fe467b2" integrity sha512-S+gD3fgbkZYW2rnbjugNMqibm9HpEjqZBZkTiI3PwbbNGWmAcxolWIUwZ0SKeG4Dy2ktpKKaI/6+HGYVH8Qrlg== -"@typescript-eslint/types@4.14.0": - version "4.14.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.0.tgz#d8a8202d9b58831d6fd9cee2ba12f8a5a5dd44b6" - integrity sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A== - "@typescript-eslint/types@4.14.1": version "4.14.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.1.tgz#b3d2eb91dafd0fd8b3fce7c61512ac66bd0364aa" From 343d372845d0c89ddee9627b9061d7872652f727 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 26 Jan 2021 20:17:30 +0200 Subject: [PATCH 018/237] Document that Prettier never unquotes numeric properties in TS and Flow (#10126) * Document that Prettier never unquotes numeric properties in TS and Flow * Add Angular * Mention Vue --- docs/options.md | 7 +++++++ website/versioned_docs/version-stable/options.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/docs/options.md b/docs/options.md index 5a2bae808..aad2334b8 100644 --- a/docs/options.md +++ b/docs/options.md @@ -89,6 +89,13 @@ Valid options: | ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `"as-needed"` | --quote-props | quoteProps: "" | +Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys is significant in these languages. See: [Angular][quote-props-angular], [TypeScript][quote-props-typescript], [Flow][quote-props-flow]. Also Prettier doesn’t unquote numeric properties for Vue (see the [issue][quote-props-vue] about that). + +[quote-props-angular]: https://codesandbox.io/s/hungry-morse-foj87?file=/src/app/app.component.html +[quote-props-typescript]: https://www.typescriptlang.org/play?#code/DYUwLgBAhhC8EG8IEYBcKA0EBM7sQF8AoUSAIzkQgHJlr1ktrt6dCiiATEAY2CgBOICKWhR0AaxABPAPYAzCGGkAHEAugBuLr35CR4CGTKSZG5Wo1ltRKDHjHtQA +[quote-props-flow]: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAA8wBeMAb1TDAAYAuMARlQF8g +[quote-props-vue]: https://github.com/prettier/prettier/issues/10127 + ## JSX Quotes Use single quotes instead of double quotes in JSX. diff --git a/website/versioned_docs/version-stable/options.md b/website/versioned_docs/version-stable/options.md index 7fa1fa36d..38ebdad44 100644 --- a/website/versioned_docs/version-stable/options.md +++ b/website/versioned_docs/version-stable/options.md @@ -90,6 +90,13 @@ Valid options: | ------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `"as-needed"` | --quote-props | quoteProps: "" | +Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys is significant in these languages. See: [Angular][quote-props-angular], [TypeScript][quote-props-typescript], [Flow][quote-props-flow]. Also Prettier doesn’t unquote numeric properties for Vue (see the [issue][quote-props-vue] about that). + +[quote-props-angular]: https://codesandbox.io/s/hungry-morse-foj87?file=/src/app/app.component.html +[quote-props-typescript]: https://www.typescriptlang.org/play?#code/DYUwLgBAhhC8EG8IEYBcKA0EBM7sQF8AoUSAIzkQgHJlr1ktrt6dCiiATEAY2CgBOICKWhR0AaxABPAPYAzCGGkAHEAugBuLr35CR4CGTKSZG5Wo1ltRKDHjHtQA +[quote-props-flow]: https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAA8wBeMAb1TDAAYAuMARlQF8g +[quote-props-vue]: https://github.com/prettier/prettier/issues/10127 + ## JSX Quotes Use single quotes instead of double quotes in JSX. From a98292e417622f1aa5fe62579aa0f35fa0571a6b Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 27 Jan 2021 07:11:53 +0800 Subject: [PATCH 019/237] Simplify frontMatter parse (#10136) * Simplify frontMatter parse * Rewrite regex to @thorn0's version --- src/utils/front-matter.js | 58 +++++++++++++++------------------------ 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/src/utils/front-matter.js b/src/utils/front-matter.js index 06e7ffc6c..0d026924e 100644 --- a/src/utils/front-matter.js +++ b/src/utils/front-matter.js @@ -1,55 +1,40 @@ "use strict"; -const escape = require("escape-string-regexp"); const { builders: { hardline, markAsRoot }, } = require("../document"); -const YAML_DELIMITER = "---"; -// In some markdown processors such as pandoc, -// "..." can be used as the end delimiter for YAML front-matter. -const YAML_END_DELIMITER = "..."; -const DELIMITER_MAP = { - [YAML_DELIMITER]: "yaml", - "+++": "toml", -}; +const frontMatterRegex = new RegExp( + "^(?-{3}|\\+{3})" + + // trailing spaces after delimiters are allowed + "(?[^\\n]*)" + + "\\n(?:|(?[\\S\\s]*?)\\n)" + + // In some markdown processors such as pandoc, + // "..." can be used as the end delimiter for YAML front-matter. + // Adding `\.{3}` make the regex matches `+++\n...`, but we'll exclude it later + "(?\\k|\\.{3})" + + "[^\\S\\n]*(?:\\n|$)" +); function parse(text) { - const startDelimiterRegex = Object.keys(DELIMITER_MAP).map(escape).join("|"); - const endDelimiterRegex = [...Object.keys(DELIMITER_MAP), YAML_END_DELIMITER] - .map(escape) - .join("|"); - - const match = text.match( - // trailing spaces after delimiters are allowed - new RegExp( - `^(${startDelimiterRegex})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(${endDelimiterRegex})[^\\n\\S]*(\\n|$)` - ) - ); - - if (match === null) { - return { frontMatter: null, content: text }; + const match = text.match(frontMatterRegex); + if (!match) { + return { content: text }; } - const [raw, startDelimiter, language, value = "", endDelimiter] = match; + const { startDelimiter, language, value = "", endDelimiter } = match.groups; - let lang = DELIMITER_MAP[startDelimiter]; - if (lang !== "toml" && language && language.trim()) { - lang = language.trim(); + let lang = language.trim() || "yaml"; + if (startDelimiter === "+++") { + lang = "toml"; } // Only allow yaml to parse with a different end delimiter - if ( - startDelimiter !== endDelimiter && - !( - lang === "yaml" && - startDelimiter === YAML_DELIMITER && - endDelimiter === YAML_END_DELIMITER - ) - ) { - return { frontMatter: null, content: text }; + if (lang !== "yaml" && startDelimiter !== endDelimiter) { + return { content: text }; } + const [raw] = match; const frontMatter = { type: "front-matter", lang, @@ -58,6 +43,7 @@ function parse(text) { endDelimiter, raw: raw.replace(/\n$/, ""), }; + return { frontMatter, content: raw.replace(/[^\n]/g, " ") + text.slice(raw.length), From 1df287acc802939edfd5eed3ffabf3979a8cc3ae Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 27 Jan 2021 06:36:39 +0200 Subject: [PATCH 020/237] Use default parameters where possible and other microrefactoring (#10135) --- cspell.json | 1 + src/common/util.js | 10 ++---- src/document/doc-builders.js | 8 ++--- src/language-markdown/printer-markdown.js | 6 +--- src/language-markdown/utils.js | 4 +-- src/main/core.js | 44 ++++++++++++----------- src/main/options.js | 4 +-- src/main/parser.js | 4 +-- tests_config/utils/create-snapshot.js | 3 +- tests_integration/runPrettier.js | 2 -- 10 files changed, 35 insertions(+), 51 deletions(-) diff --git a/cspell.json b/cspell.json index c6c7c29d6..8edacecc9 100644 --- a/cspell.json +++ b/cspell.json @@ -105,6 +105,7 @@ "elektronik", "Eneman", "ENOENT", + "eqeqeq", "Ericsburgh", "errored", "Esben", diff --git a/src/common/util.js b/src/common/util.js index ca986ee3b..fe7c180f0 100644 --- a/src/common/util.js +++ b/src/common/util.js @@ -164,8 +164,7 @@ function skipNewline(text, index, opts) { * @param {SkipOptions=} opts * @returns {boolean} */ -function hasNewline(text, index, opts) { - opts = opts || {}; +function hasNewline(text, index, opts = {}) { const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts); const idx2 = skipNewline(text, idx, opts); return idx !== idx2; @@ -292,8 +291,7 @@ function getNextNonSpaceNonCommentCharacter(text, node, locEnd) { * @param {SkipOptions=} opts * @returns {boolean} */ -function hasSpaces(text, index, opts) { - opts = opts || {}; +function hasSpaces(text, index, opts = {}) { const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts); return idx !== index; } @@ -304,9 +302,7 @@ function hasSpaces(text, index, opts) { * @param {number=} startIndex * @returns {number} */ -function getAlignmentSize(value, tabWidth, startIndex) { - startIndex = startIndex || 0; - +function getAlignmentSize(value, tabWidth, startIndex = 0) { let size = 0; for (let i = startIndex; i < value.length; ++i) { if (value[i] === "\t") { diff --git a/src/document/doc-builders.js b/src/document/doc-builders.js index a875f9be0..ad08e1775 100644 --- a/src/document/doc-builders.js +++ b/src/document/doc-builders.js @@ -86,9 +86,7 @@ function align(n, contents) { * @param {object} [opts] - TBD ??? * @returns Doc */ -function group(contents, opts) { - opts = opts || {}; - +function group(contents, opts = {}) { if (process.env.NODE_ENV !== "production") { assertDoc(contents); } @@ -156,9 +154,7 @@ function fill(parts) { * @param {object} [opts] - TBD ??? * @returns Doc */ -function ifBreak(breakContents, flatContents, opts) { - opts = opts || {}; - +function ifBreak(breakContents, flatContents, opts = {}) { if (process.env.NODE_ENV !== "production") { if (breakContents) { assertDoc(breakContents); diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index d9db1dc3c..c31e1b394 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -504,8 +504,6 @@ function getNthListSiblingIndex(node, parentNode) { } function getNthSiblingIndex(node, parentNode, condition) { - condition = condition || (() => true); - let index = -1; for (const childNode of parentNode.children) { @@ -698,9 +696,7 @@ function printRoot(path, options, print) { }); } -function printChildren(path, options, print, events) { - events = events || {}; - +function printChildren(path, options, print, events = {}) { const { postprocessor } = events; const processor = events.processor || ((childPath) => childPath.call(print)); diff --git a/src/language-markdown/utils.js b/src/language-markdown/utils.js index 8d839260c..de21b4e60 100644 --- a/src/language-markdown/utils.js +++ b/src/language-markdown/utils.js @@ -204,8 +204,6 @@ function getFencedCodeBlockValue(node, originalText) { function mapAst(ast, handler) { return (function preorder(node, index, parentStack) { - parentStack = parentStack || []; - const newNode = { ...handler(node, index, parentStack) }; if (newNode.children) { newNode.children = newNode.children.map((child, index) => @@ -214,7 +212,7 @@ function mapAst(ast, handler) { } return newNode; - })(ast, null, null); + })(ast, null, []); } function isAutolink(node) { diff --git a/src/main/core.js b/src/main/core.js index 511df6ce9..768433776 100644 --- a/src/main/core.js +++ b/src/main/core.js @@ -36,13 +36,11 @@ function attachComments(text, ast, opts) { return astComments; } -function coreFormat(originalText, opts, addAlignmentSize) { +function coreFormat(originalText, opts, addAlignmentSize = 0) { if (!originalText || originalText.trim().length === 0) { return { formatted: "", cursorOffset: -1 }; } - addAlignmentSize = addAlignmentSize || 0; - const { ast, text } = parser.parse(originalText, opts); if (opts.cursorOffset >= 0) { @@ -181,8 +179,7 @@ function formatRange(originalText, opts) { let { cursorOffset } = opts; if (cursorOffset >= rangeEnd) { // handle the case where the cursor was past the end of the range - cursorOffset = - opts.cursorOffset + (rangeTrimmed.length - rangeString.length); + cursorOffset += rangeTrimmed.length - rangeString.length; } else if (rangeResult.cursorOffset >= 0) { // handle the case where the cursor was in the range cursorOffset = rangeResult.cursorOffset + rangeStart; @@ -272,22 +269,21 @@ function normalizeInputAndOptions(text, options) { }; } -function format(originalText, originalOptions) { +function hasPragma(text, options) { + const selectedParser = parser.resolveParser(options); + return !selectedParser.hasPragma || selectedParser.hasPragma(text); +} + +function formatWithCursor(originalText, originalOptions) { let { hasBOM, text, options } = normalizeInputAndOptions( originalText, normalizeOptions(originalOptions) ); - if (options.rangeStart >= options.rangeEnd && text !== "") { - return { - formatted: originalText, - cursorOffset: originalOptions.cursorOffset, - }; - } - - const selectedParser = parser.resolveParser(options); - const hasPragma = !selectedParser.hasPragma || selectedParser.hasPragma(text); - if (options.requirePragma && !hasPragma) { + if ( + (options.rangeStart >= options.rangeEnd && text !== "") || + (options.requirePragma && !hasPragma(text, options)) + ) { return { formatted: originalText, cursorOffset: originalOptions.cursorOffset, @@ -299,7 +295,12 @@ function format(originalText, originalOptions) { if (options.rangeStart > 0 || options.rangeEnd < text.length) { result = formatRange(text, options); } else { - if (!hasPragma && options.insertPragma && options.printer.insertPragma) { + if ( + !options.requirePragma && + options.insertPragma && + options.printer.insertPragma && + !hasPragma(text, options) + ) { text = options.printer.insertPragma(text); } result = coreFormat(text, options); @@ -317,7 +318,8 @@ function format(originalText, originalOptions) { } module.exports = { - formatWithCursor: format, + formatWithCursor, + parse(originalText, originalOptions, massage) { const { text, options } = normalizeInputAndOptions( originalText, @@ -338,8 +340,10 @@ module.exports = { // Doesn't handle shebang for now formatDoc(doc, options) { - return format(printDocToDebug(doc), { ...options, parser: "babel" }) - .formatted; + return formatWithCursor(printDocToDebug(doc), { + ...options, + parser: "babel", + }).formatted; }, printToDoc(originalText, options) { diff --git a/src/main/options.js b/src/main/options.js index fecf5834d..a12b5bcad 100644 --- a/src/main/options.js +++ b/src/main/options.js @@ -18,9 +18,7 @@ const hiddenDefaults = { }; // Copy options and fill in default values. -function normalize(options, opts) { - opts = opts || {}; - +function normalize(options, opts = {}) { const rawOptions = { ...options }; const supportOptions = getSupportInfo({ diff --git a/src/main/parser.js b/src/main/parser.js index ed354c653..65b31bc39 100644 --- a/src/main/parser.js +++ b/src/main/parser.js @@ -27,9 +27,7 @@ function getParsers(options) { return parsers; } -function resolveParser(opts, parsers) { - parsers = parsers || getParsers(opts); - +function resolveParser(opts, parsers = getParsers(opts)) { if (typeof opts.parser === "function") { // Custom parser API always works with JavaScript. return { diff --git a/tests_config/utils/create-snapshot.js b/tests_config/utils/create-snapshot.js index 0a5eb8755..d700c305d 100644 --- a/tests_config/utils/create-snapshot.js +++ b/tests_config/utils/create-snapshot.js @@ -2,8 +2,7 @@ const raw = require("jest-snapshot-serializer-raw").wrap; -function printSeparator(width, description) { - description = description || ""; +function printSeparator(width, description = "") { const leftLength = Math.floor((width - description.length) / 2); const rightLength = width - leftLength - description.length; return "=".repeat(leftLength) + description + "=".repeat(rightLength); diff --git a/tests_integration/runPrettier.js b/tests_integration/runPrettier.js index 7ebb7f7e7..50848a9bd 100644 --- a/tests_integration/runPrettier.js +++ b/tests_integration/runPrettier.js @@ -116,8 +116,6 @@ function runPrettier(dir, args = [], options = {}) { const result = { status, stdout, stderr, write }; const testResult = (testOptions) => { - testOptions = testOptions || {}; - for (const name of Object.keys(result)) { test(`(${name})`, () => { const value = From 63a771db55bcf5d81478e1cd593964118cb26f69 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 27 Jan 2021 10:06:03 +0200 Subject: [PATCH 021/237] Add parallel-prettier to "Related Projects" (#10147) --- docs/related-projects.md | 1 + website/versioned_docs/version-stable/related-projects.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/related-projects.md b/docs/related-projects.md index 956232c3f..0f31a297f 100644 --- a/docs/related-projects.md +++ b/docs/related-projects.md @@ -28,6 +28,7 @@ title: Related Projects ## Misc +- [parallel-prettier](https://github.com/microsoft/parallel-prettier) is an alternative CLI that formats files in parallel to speed up large projects - [prettier_d](https://github.com/josephfrazier/prettier_d.js) runs Prettier as a server to avoid Node.js startup delay - [pretty-quick](https://github.com/azz/pretty-quick) formats changed files with Prettier - [rollup-plugin-prettier](https://github.com/mjeanroy/rollup-plugin-prettier) allows you to use Prettier with Rollup diff --git a/website/versioned_docs/version-stable/related-projects.md b/website/versioned_docs/version-stable/related-projects.md index 2f5d185ef..30e7e663c 100644 --- a/website/versioned_docs/version-stable/related-projects.md +++ b/website/versioned_docs/version-stable/related-projects.md @@ -29,6 +29,7 @@ original_id: related-projects ## Misc +- [parallel-prettier](https://github.com/microsoft/parallel-prettier) is an alternative CLI that formats files in parallel to speed up large projects - [prettier_d](https://github.com/josephfrazier/prettier_d.js) runs Prettier as a server to avoid Node.js startup delay - [pretty-quick](https://github.com/azz/pretty-quick) formats changed files with Prettier - [rollup-plugin-prettier](https://github.com/mjeanroy/rollup-plugin-prettier) allows you to use Prettier with Rollup From 79d2f4a295c56f637c4d215f78e825bff817f428 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 27 Jan 2021 12:30:10 +0200 Subject: [PATCH 022/237] Add CLI flag for debugging comment attachment issues (#10124) --- changelog_unreleased/cli/10124.md | 3 ++ docs/plugins.md | 2 + src/cli/constant.js | 3 ++ src/cli/format.js | 9 ++++ src/common/util.js | 18 +++++++ src/main/comments.js | 3 ++ src/main/core.js | 14 +++-- tests/js/cursor/jsfmt.spec.js | 10 ++-- .../debug-print-comments.js.snap | 51 +++++++++++++++++++ .../__tests__/debug-print-comments.js | 14 +++++ website/playground/EditorState.js | 2 + website/playground/Playground.js | 21 +++++++- website/playground/PrettierFormat.js | 12 ++++- website/static/worker.js | 25 ++++++--- 14 files changed, 169 insertions(+), 18 deletions(-) create mode 100644 changelog_unreleased/cli/10124.md create mode 100644 tests_integration/__tests__/__snapshots__/debug-print-comments.js.snap create mode 100644 tests_integration/__tests__/debug-print-comments.js diff --git a/changelog_unreleased/cli/10124.md b/changelog_unreleased/cli/10124.md new file mode 100644 index 000000000..0c3f204e6 --- /dev/null +++ b/changelog_unreleased/cli/10124.md @@ -0,0 +1,3 @@ +#### Add CLI flag for debugging comment attachment issues (#10124 by @thorn0) + +A new `--debug-print-comments` CLI flag and corresponding functionality for the Playground. diff --git a/docs/plugins.md b/docs/plugins.md index 8795c1905..480dd79f4 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -351,6 +351,8 @@ Nodes with comments are expected to have a `comments` property containing an arr The example above uses `util.addTrailingComment`, which automatically sets `comment.leading`/`trailing`/`printed` to appropriate values and adds the comment to the AST node's `comments` array. +The `--debug-print-comments` CLI flag can help with debugging comment attachment issues. It prints a detailed list of comments, which includes information on how every comment was classified (`ownLine`/`endOfLine`/`remaining`, `leading`/`trailing`/`dangling`) and to which node it was attached. For Prettier’s built-in languages, this information is also available on the Playground (the 'show comments' checkbox in the Debug section). + ### `options` `options` is an object containing the custom options your plugin supports. diff --git a/src/cli/constant.js b/src/cli/constant.js index ff4321d9b..83a622863 100644 --- a/src/cli/constant.js +++ b/src/cli/constant.js @@ -132,6 +132,9 @@ const options = { "debug-print-doc": { type: "boolean", }, + "debug-print-comments": { + type: "boolean", + }, "debug-repeat": { // Repeat the formatting a few times and measure the average duration. type: "int", diff --git a/src/cli/format.js b/src/cli/format.js index 99e6f59d6..e54bf7cac 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -116,6 +116,15 @@ function format(context, input, opt) { return { formatted: prettier.__debug.formatDoc(doc) }; } + if (context.argv["debug-print-comments"]) { + return { + formatted: prettier.format( + JSON.stringify(prettier.formatWithCursor(input, opt).comments || []), + { parser: "json" } + ), + }; + } + if (context.argv["debug-check"]) { const pp = prettier.format(input, opt); const pppp = prettier.format(pp, opt); diff --git a/src/common/util.js b/src/common/util.js index fe7c180f0..30d1b2a99 100644 --- a/src/common/util.js +++ b/src/common/util.js @@ -557,6 +557,7 @@ function addCommentHelper(node, comment) { const comments = node.comments || (node.comments = []); comments.push(comment); comment.printed = false; + comment.nodeDescription = describeNodeForDebugging(node); } function addLeadingComment(node, comment) { @@ -638,6 +639,23 @@ function createGroupIdMapper(description) { }; } +function describeNodeForDebugging(node) { + const nodeType = node.type || node.kind || "(unknown type)"; + let nodeName = String( + node.name || + (node.id && (typeof node.id === "object" ? node.id.name : node.id)) || + (node.key && (typeof node.key === "object" ? node.key.name : node.key)) || + (node.value && + (typeof node.value === "object" ? "" : String(node.value))) || + node.operator || + "" + ); + if (nodeName.length > 20) { + nodeName = nodeName.slice(0, 19) + "…"; + } + return nodeType + (nodeName ? " " + nodeName : ""); +} + module.exports = { inferParserByLanguage, replaceEndOfLineWith, diff --git a/src/main/comments.js b/src/main/comments.js index 45bd8abfd..3903278c3 100644 --- a/src/main/comments.js +++ b/src/main/comments.js @@ -224,6 +224,7 @@ function attach(comments, ast, text, options) { } if (isOwnLineComment(text, options, decoratedComments, index)) { + comment.placement = "ownLine"; // If a comment exists on its own line, prefer a leading comment. // We also need to check if it's the first line of the file. if (handleOwnLineComment(...args)) { @@ -241,6 +242,7 @@ function attach(comments, ast, text, options) { addDanglingComment(ast, comment); } } else if (isEndOfLineComment(text, options, decoratedComments, index)) { + comment.placement = "endOfLine"; if (handleEndOfLineComment(...args)) { // We're good } else if (precedingNode) { @@ -257,6 +259,7 @@ function attach(comments, ast, text, options) { addDanglingComment(ast, comment); } } else { + comment.placement = "remaining"; if (handleRemainingComment(...args)) { // We're good } else if (precedingNode && followingNode) { diff --git a/src/main/core.js b/src/main/core.js index 768433776..47f0d1e18 100644 --- a/src/main/core.js +++ b/src/main/core.js @@ -38,7 +38,7 @@ function attachComments(text, ast, opts) { function coreFormat(originalText, opts, addAlignmentSize = 0) { if (!originalText || originalText.trim().length === 0) { - return { formatted: "", cursorOffset: -1 }; + return { formatted: "", cursorOffset: -1, comments: [] }; } const { ast, text } = parser.parse(originalText, opts); @@ -102,6 +102,7 @@ function coreFormat(originalText, opts, addAlignmentSize = 0) { return { formatted: result.formatted, cursorOffset: newCursorNodeStart + cursorOffsetRelativeToOldCursorNode, + comments: astComments, }; } @@ -133,10 +134,14 @@ function coreFormat(originalText, opts, addAlignmentSize = 0) { } } - return { formatted: result.formatted, cursorOffset }; + return { formatted: result.formatted, cursorOffset, comments: astComments }; } - return { formatted: result.formatted, cursorOffset: -1 }; + return { + formatted: result.formatted, + cursorOffset: -1, + comments: astComments, + }; } function formatRange(originalText, opts) { @@ -200,7 +205,7 @@ function formatRange(originalText, opts) { formatted = formatted.replace(/\n/g, eol); } - return { formatted, cursorOffset }; + return { formatted, cursorOffset, comments: rangeResult.comments }; } function ensureIndexInText(text, index, defaultValue) { @@ -287,6 +292,7 @@ function formatWithCursor(originalText, originalOptions) { return { formatted: originalText, cursorOffset: originalOptions.cursorOffset, + comments: [], }; } diff --git a/tests/js/cursor/jsfmt.spec.js b/tests/js/cursor/jsfmt.spec.js index fb2b19fb7..841828427 100644 --- a/tests/js/cursor/jsfmt.spec.js +++ b/tests/js/cursor/jsfmt.spec.js @@ -5,7 +5,7 @@ const prettier = require("prettier-local"); test("translates cursor correctly in basic case", () => { expect( prettier.formatWithCursor(" 1", { parser: "babel", cursorOffset: 2 }) - ).toEqual({ + ).toMatchObject({ formatted: "1;\n", cursorOffset: 1, }); @@ -15,7 +15,7 @@ test("positions cursor relative to closest node, not SourceElement", () => { const code = "return 15"; expect( prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 15 }) - ).toEqual({ + ).toMatchObject({ formatted: "return 15;\n", cursorOffset: 7, }); @@ -25,7 +25,7 @@ test("keeps cursor inside formatted node", () => { const code = "return 15"; expect( prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 14 }) - ).toEqual({ + ).toMatchObject({ formatted: "return 15;\n", cursorOffset: 7, }); @@ -38,7 +38,7 @@ foo('bar', cb => { })`; expect( prettier.formatWithCursor(code, { parser: "babel", cursorOffset: 24 }) - ).toEqual({ + ).toMatchObject({ formatted: `foo("bar", (cb) => { console.log("stuff"); }); @@ -57,7 +57,7 @@ test("cursorOffset === rangeStart", () => { rangeStart: 7, rangeEnd: 8, }) - ).toEqual({ + ).toMatchObject({ formatted: "1.0000\n2.0;\n3.0000", cursorOffset: 7, }); diff --git a/tests_integration/__tests__/__snapshots__/debug-print-comments.js.snap b/tests_integration/__tests__/__snapshots__/debug-print-comments.js.snap new file mode 100644 index 000000000..45e3f90c1 --- /dev/null +++ b/tests_integration/__tests__/__snapshots__/debug-print-comments.js.snap @@ -0,0 +1,51 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`prints information for debugging comment attachment with --debug-print-comments (stdout) 1`] = ` +"[ + { + \\"type\\": \\"CommentBlock\\", + \\"value\\": \\" 1 \\", + \\"start\\": 0, + \\"end\\": 7, + \\"loc\\": { + \\"start\\": { \\"line\\": 1, \\"column\\": 0 }, + \\"end\\": { \\"line\\": 1, \\"column\\": 7 } + }, + \\"placement\\": \\"endOfLine\\", + \\"leading\\": true, + \\"trailing\\": false, + \\"nodeDescription\\": \\"ExpressionStatement\\" + }, + { + \\"type\\": \\"CommentBlock\\", + \\"value\\": \\" 2 \\", + \\"start\\": 24, + \\"end\\": 31, + \\"loc\\": { + \\"start\\": { \\"line\\": 2, \\"column\\": 16 }, + \\"end\\": { \\"line\\": 2, \\"column\\": 23 } + }, + \\"placement\\": \\"remaining\\", + \\"leading\\": false, + \\"trailing\\": true, + \\"nodeDescription\\": \\"Identifier foo\\" + }, + { + \\"type\\": \\"CommentLine\\", + \\"value\\": \\" 3\\", + \\"start\\": 34, + \\"end\\": 38, + \\"loc\\": { + \\"start\\": { \\"line\\": 2, \\"column\\": 26 }, + \\"end\\": { \\"line\\": 2, \\"column\\": 30 } + }, + \\"placement\\": \\"remaining\\", + \\"leading\\": false, + \\"trailing\\": true, + \\"nodeDescription\\": \\"ExpressionStatement\\" + } +] +" +`; + +exports[`prints information for debugging comment attachment with --debug-print-comments (write) 1`] = `Array []`; diff --git a/tests_integration/__tests__/debug-print-comments.js b/tests_integration/__tests__/debug-print-comments.js new file mode 100644 index 000000000..73358ce26 --- /dev/null +++ b/tests_integration/__tests__/debug-print-comments.js @@ -0,0 +1,14 @@ +"use strict"; + +const runPrettier = require("../runPrettier"); + +describe("prints information for debugging comment attachment with --debug-print-comments", () => { + runPrettier( + "cli/with-shebang", + ["--debug-print-comments", "--parser", "babel"], + { input: "/* 1 */\nconsole.log(foo /* 2 */); // 3" } + ).test({ + stderr: "", + status: 0, + }); +}); diff --git a/website/playground/EditorState.js b/website/playground/EditorState.js index c56478bb6..08ad92371 100644 --- a/website/playground/EditorState.js +++ b/website/playground/EditorState.js @@ -10,10 +10,12 @@ export default class extends React.Component { showSidebar: false, showAst: false, showDoc: false, + showComments: false, showSecondFormat: false, toggleSidebar: () => this.setState(stateToggler("showSidebar")), toggleAst: () => this.setState(stateToggler("showAst")), toggleDoc: () => this.setState(stateToggler("showDoc")), + toggleComments: () => this.setState(stateToggler("showComments")), toggleSecondFormat: () => this.setState(stateToggler("showSecondFormat")), ...storage.get("editor_state"), }; diff --git a/website/playground/Playground.js b/website/playground/Playground.js index 01b41baad..16d5ad998 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -151,9 +151,14 @@ class Playground extends React.Component { } render() { - const { worker } = this.props; + const { worker, version } = this.props; const { content, options } = this.state; + // TODO: remove this when v2.3.0 is released + const [major, minor] = version.split(".", 2).map(Number); + const showShowComments = + Number.isNaN(major) || (major === 2 && minor >= 3) || major > 2; + return ( {(editorState) => ( @@ -163,6 +168,7 @@ class Playground extends React.Component { options={options} debugAst={editorState.showAst} debugDoc={editorState.showDoc} + debugComments={showShowComments && editorState.showComments} reformat={editorState.showSecondFormat} > {({ formatted, debug }) => { @@ -223,6 +229,13 @@ class Playground extends React.Component { checked={editorState.showDoc} onChange={editorState.toggleDoc} /> + {showShowComments && ( + + )} ) : null} + {showShowComments && editorState.showComments ? ( + + ) : null} this.setState(result)); } diff --git a/website/static/worker.js b/website/static/worker.js index 9751137cc..8b06bd8ef 100644 --- a/website/static/worker.js +++ b/website/static/worker.js @@ -71,11 +71,14 @@ function handleMessage(message) { const plugins = [{ parsers }]; options.plugins = plugins; + const formatResult = formatCode(message.code, options); + const response = { - formatted: formatCode(message.code, options), + formatted: formatResult.formatted, debug: { ast: null, doc: null, + comments: null, reformatted: null, }, }; @@ -92,7 +95,7 @@ function handleMessage(message) { if (!errored) { try { - ast = formatCode(ast, { parser: "json", plugins }); + ast = formatCode(ast, { parser: "json", plugins }).formatted; } catch (e) { ast = serializeAst(ast); } @@ -111,8 +114,18 @@ function handleMessage(message) { } } + if (message.debug.comments) { + response.debug.comments = formatCode( + JSON.stringify(formatResult.comments || []), + { parser: "json", plugins } + ).formatted; + } + if (message.debug.reformat) { - response.debug.reformatted = formatCode(response.formatted, options); + response.debug.reformatted = formatCode( + response.formatted, + options + ).formatted; } return response; @@ -121,14 +134,14 @@ function handleMessage(message) { function formatCode(text, options) { try { - return prettier.format(text, options); + return prettier.formatWithCursor(text, options); } catch (e) { if (e.constructor && e.constructor.name === "SyntaxError") { // Likely something wrong with the user's code - return String(e); + return { formatted: String(e) }; } // Likely a bug in Prettier // Provide the whole stack for debugging - return e.stack || String(e); + return { formatted: e.stack || String(e) }; } } From 9786ce2fb628ac4ad3ed5088fd8f7c66a93d9c17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Jan 2021 18:42:47 +0800 Subject: [PATCH 023/237] Build(deps-dev): Bump webpack from 5.17.0 to 5.18.0 (#10148) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c28ea3b99..d11230482 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "synchronous-promise": "2.0.15", "tempy": "1.0.0", "terser-webpack-plugin": "5.1.1", - "webpack": "5.17.0" + "webpack": "5.18.0" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 9fa82137c..bde6c8522 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7334,10 +7334,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.17.0: - version "5.17.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.17.0.tgz#e92aebad45be25f86f788dc72fc11daacdcfd55d" - integrity sha512-R+IdNEaYcYaACpXZOt7reyc8txBK7J06lOPkX1SbgmeoAnUbyBZivJIksrDBnmMA3wlTWvPcX7DubxELyPB8rA== +webpack@5.18.0: + version "5.18.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.18.0.tgz#bbcf13094aa0da0534d513f27d7ee72d74e499c6" + integrity sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From bba719283d484f27659e2a69ff214cf287f15ab7 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 27 Jan 2021 20:36:02 +0800 Subject: [PATCH 024/237] JS: Simplify `clean` function (#10154) --- src/language-js/clean.js | 67 +++++++++++++--------------------------- 1 file changed, 22 insertions(+), 45 deletions(-) diff --git a/src/language-js/clean.js b/src/language-js/clean.js index 8da157caf..c96987da8 100644 --- a/src/language-js/clean.js +++ b/src/language-js/clean.js @@ -18,6 +18,12 @@ const ignoredProperties = new Set([ "tokens", ]); +const removeTemplateElementsValue = (node) => { + for (const templateElement of node.quasis) { + delete templateElement.value; + } +}; + function clean(ast, newObj, parent) { if (ast.type === "Program") { delete newObj.sourceType; @@ -94,21 +100,13 @@ function clean(ast, newObj, parent) { ast.openingElement.name.name === "style" && ast.openingElement.attributes.some((attr) => attr.name.name === "jsx") ) { - const templateLiterals = newObj.children - .filter( - (child) => - child.type === "JSXExpressionContainer" && - child.expression.type === "TemplateLiteral" - ) - .map((container) => container.expression); - - const quasis = templateLiterals.reduce( - (quasis, templateLiteral) => [...quasis, ...templateLiteral.quasis], - [] - ); - - for (const q of quasis) { - delete q.value; + for (const { type, expression } of newObj.children) { + if ( + type === "JSXExpressionContainer" && + expression.type === "TemplateLiteral" + ) { + removeTemplateElementsValue(expression); + } } } @@ -119,9 +117,7 @@ function clean(ast, newObj, parent) { ast.value.type === "JSXExpressionContainer" && ast.value.expression.type === "TemplateLiteral" ) { - for (const q of newObj.value.expression.quasis) { - delete q.value; - } + removeTemplateElementsValue(newObj.value.expression); } // We change quotes @@ -147,26 +143,18 @@ function clean(ast, newObj, parent) { index, prop, ] of newObj.expression.arguments[0].properties.entries()) { - let templateLiteral = null; - switch (astProps[index].key.name) { case "styles": if (prop.value.type === "ArrayExpression") { - templateLiteral = prop.value.elements[0]; + removeTemplateElementsValue(prop.value.elements[0]); } break; case "template": if (prop.value.type === "TemplateLiteral") { - templateLiteral = prop.value; + removeTemplateElementsValue(prop.value); } break; } - - if (templateLiteral) { - for (const q of templateLiteral.quasis) { - delete q.value; - } - } } } @@ -183,9 +171,7 @@ function clean(ast, newObj, parent) { ast.tag.name === "html")) || ast.tag.type === "CallExpression") ) { - for (const quasi of newObj.quasi.quasis) { - delete quasi.value; - } + removeTemplateElementsValue(newObj.quasi); } if (ast.type === "TemplateLiteral") { // This checks for a leading comment that is exactly `/* GraphQL */` @@ -204,21 +190,12 @@ function clean(ast, newObj, parent) { ); if ( hasLanguageComment || - (parent.type === "CallExpression" && parent.callee.name === "graphql") + (parent.type === "CallExpression" && parent.callee.name === "graphql") || + // TODO: check parser + // `flow` and `typescript` don't have `leadingComments` + !ast.leadingComments ) { - for (const quasi of newObj.quasis) { - delete quasi.value; - } - } - - // TODO: check parser - // `flow` and `typescript` don't have `leadingComments` - if (!ast.leadingComments) { - for (const quasi of newObj.quasis) { - if (quasi.value) { - delete quasi.value.cooked; - } - } + removeTemplateElementsValue(newObj); } } From 53b59d2d39fd38079a587c7ce7e7e62cc1cbb591 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Thu, 28 Jan 2021 00:29:34 +0200 Subject: [PATCH 025/237] Fix lineSuffixBoundary (#10122) --- changelog_unreleased/api/10122.md | 34 +++++++++++++++ src/document/doc-printer.js | 25 +++++++++-- .../__tests__/line-suffix-boundary.js | 41 +++++++++++++++++++ tests_integration/printDoc.js | 30 ++++++++++++++ 4 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 changelog_unreleased/api/10122.md create mode 100644 tests_integration/__tests__/line-suffix-boundary.js create mode 100644 tests_integration/printDoc.js diff --git a/changelog_unreleased/api/10122.md b/changelog_unreleased/api/10122.md new file mode 100644 index 000000000..5cc6e6219 --- /dev/null +++ b/changelog_unreleased/api/10122.md @@ -0,0 +1,34 @@ +#### Fix `lineSuffixBoundary` (#10122 by @thorn0) + +There was a bug in the implementation of the [`lineSuffixBoundary`][lsb] command that significantly limited its usefulness: the printer algorithm didn't correctly consider it a potential line break. Now that the bug has been fixed, we urge plugin authors to give this command another try and see if it can help them simplify printing of trailing comments. + +[lsb]: https://github.com/prettier/prettier/blob/main/commands.md#linesuffixboundary + + +```jsx +// Input +group([ + "let foo = [", + indent([ + softline, + [lineSuffixBoundary, "item1,"], + line, + [lineSuffixBoundary, "item2,", lineSuffix(" // comment")], + line, + [lineSuffixBoundary, "item3"], + ]), + softline, + "];", +]) + +// Prettier stable +let foo = [item1, item2, // comment + item3]; + +// Prettier main +let foo = [ + item1, + item2, // comment + item3 +]; +``` diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js index 39d8efdea..5e2558f1a 100644 --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -144,7 +144,7 @@ function trim(out) { return trimCount; } -function fits(next, restCommands, width, options, mustBeFlat) { +function fits(next, restCommands, width, options, hasLineSuffix, mustBeFlat) { let restIdx = restCommands.length; const cmds = [next]; // `out` is only used for width counting because `trim` requires to look @@ -237,6 +237,14 @@ function fits(next, restCommands, width, options, mustBeFlat) { return true; } break; + case "line-suffix": + hasLineSuffix = true; + break; + case "line-suffix-boundary": + if (hasLineSuffix) { + return false; + } + break; } } } @@ -306,8 +314,9 @@ function printDocToString(doc, options) { const next = [ind, MODE_FLAT, doc.contents]; const rem = width - pos; + const hasLineSuffix = lineSuffix.length > 0; - if (!doc.break && fits(next, cmds, rem, options)) { + if (!doc.break && fits(next, cmds, rem, options, hasLineSuffix)) { cmds.push(next); } else { // Expanded states are a rare case where a document @@ -335,7 +344,7 @@ function printDocToString(doc, options) { const state = doc.expandedStates[i]; const cmd = [ind, MODE_FLAT, state]; - if (fits(cmd, cmds, rem, options)) { + if (fits(cmd, cmds, rem, options, hasLineSuffix)) { cmds.push(cmd); break; @@ -387,7 +396,14 @@ function printDocToString(doc, options) { const [content, whitespace] = parts; const contentFlatCmd = [ind, MODE_FLAT, content]; const contentBreakCmd = [ind, MODE_BREAK, content]; - const contentFits = fits(contentFlatCmd, [], rem, options, true); + const contentFits = fits( + contentFlatCmd, + [], + rem, + options, + lineSuffix.length > 0, + true + ); if (parts.length === 1) { if (contentFits) { @@ -430,6 +446,7 @@ function printDocToString(doc, options) { [], rem, options, + lineSuffix.length > 0, true ); diff --git a/tests_integration/__tests__/line-suffix-boundary.js b/tests_integration/__tests__/line-suffix-boundary.js new file mode 100644 index 000000000..a420c561f --- /dev/null +++ b/tests_integration/__tests__/line-suffix-boundary.js @@ -0,0 +1,41 @@ +"use strict"; + +/** @type {import('prettier')} */ +const prettier = require("prettier-local"); + +const { + group, + indent, + line, + lineSuffix, + lineSuffixBoundary, + softline, +} = prettier.doc.builders; + +const printDoc = require("../printDoc"); + +describe("lineSuffixBoundary", () => { + test("should be correctly treated as a potential line break in `fits`", () => { + const doc = group([ + "let foo = [", + indent([ + softline, + [lineSuffixBoundary, "item1,"], + line, + [lineSuffixBoundary, "item2,", lineSuffix(" // comment")], + line, + [lineSuffixBoundary, "item3"], + ]), + softline, + "];", + ]); + + const expected = `let foo = [ + item1, + item2, // comment + item3 +];`; + + expect(printDoc(doc)).toBe(expected); + }); +}); diff --git a/tests_integration/printDoc.js b/tests_integration/printDoc.js new file mode 100644 index 000000000..08e58b2f4 --- /dev/null +++ b/tests_integration/printDoc.js @@ -0,0 +1,30 @@ +"use strict"; + +/** @type {import('prettier')} */ +const prettier = require("prettier-local"); + +function printDoc(doc) { + // This dummy plugin ignores the input and simply returns the given doc. + // This is to make sure that the doc will go through all the stages a real doc + // returned by a real plugin would go (e.g. `propagateBreaks`). + const dummyPlugin = { + parsers: { + dummy: { + parse: () => ({}), + astFormat: "dummy", + }, + }, + printers: { + dummy: { + print: () => doc, + }, + }, + }; + + return prettier.format("_", { + plugins: [dummyPlugin], + parser: "dummy", + }); +} + +module.exports = printDoc; From 3d9f102301b71a2e197792823bd6e7ad2e212cc4 Mon Sep 17 00:00:00 2001 From: Daron McIntosh Date: Wed, 27 Jan 2021 17:30:16 -0500 Subject: [PATCH 026/237] Add CLI option to prevent errors on unmatched patterns (#10058) --- .gitignore | 1 + changelog_unreleased/cli/8233.md | 16 +++++++ docs/cli.md | 4 ++ src/cli/constant.js | 4 ++ src/cli/expand-patterns.js | 6 ++- .../__snapshots__/early-exit.js.snap | 4 ++ .../error-on-unmatched-pattern.js.snap | 48 +++++++++++++++++++ .../__snapshots__/help-options.js.snap | 11 +++++ .../__tests__/error-on-unmatched-pattern.js | 37 ++++++++++++++ .../cli/error-on-unmatched-pattern/some.js | 1 + .../cli/error-on-unmatched-pattern/some.json | 3 ++ .../cli/error-on-unmatched-pattern/some.yml | 1 + 12 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 changelog_unreleased/cli/8233.md create mode 100644 tests_integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap create mode 100644 tests_integration/__tests__/error-on-unmatched-pattern.js create mode 100644 tests_integration/cli/error-on-unmatched-pattern/some.js create mode 100644 tests_integration/cli/error-on-unmatched-pattern/some.json create mode 100644 tests_integration/cli/error-on-unmatched-pattern/some.yml diff --git a/.gitignore b/.gitignore index cdee460be..824eebe1c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ package-lock.json .pnp.* .nyc_output /scripts/tools/eslint-plugin-prettier-internal-rules/node_modules +.devcontainer diff --git a/changelog_unreleased/cli/8233.md b/changelog_unreleased/cli/8233.md new file mode 100644 index 000000000..6af568c1a --- /dev/null +++ b/changelog_unreleased/cli/8233.md @@ -0,0 +1,16 @@ +#### Add CLI option to prevent errors on unmatched pattern (#8233 by @daronmcintosh) + +The following command will not throw an error when it doesn't find a YAML file. + +```sh +// Prettier stable +$ npx prettier --check "prettier/docs/*.yaml" +Checking formatting... +[error] No files matching the pattern were found: "prettier/docs/*.yaml". +All matched files use Prettier code style! + +// Prettier master +$ npx prettier --check --no-error-on-unmatched-pattern "prettier/docs/*.yaml" +Checking formatting... +All matched files use Prettier code style! +``` diff --git a/docs/cli.md b/docs/cli.md index 2e88f0fb9..86422e854 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -212,3 +212,7 @@ With `--ignore-unknown` (or `-u`), prettier will ignore unknown files matched by ```console $ prettier "**/*" --write --ignore-unknown ``` + +## `--no-error-on-unmatched-pattern` + +Prevent errors when pattern is unmatched. diff --git a/src/cli/constant.js b/src/cli/constant.js index 83a622863..52758d2e9 100644 --- a/src/cli/constant.js +++ b/src/cli/constant.js @@ -148,6 +148,10 @@ const options = { "Don't take .editorconfig into account when parsing configuration.", default: true, }, + "error-on-unmatched-pattern": { + type: "boolean", + oppositeDescription: "Prevent errors when pattern is unmatched.", + }, "find-config-path": { type: "path", category: coreOptions.CATEGORY_CONFIG, diff --git a/src/cli/expand-patterns.js b/src/cli/expand-patterns.js index d37ed34f5..b840ce723 100644 --- a/src/cli/expand-patterns.js +++ b/src/cli/expand-patterns.js @@ -33,7 +33,7 @@ function* expandPatterns(context) { yield relativePath; } - if (noResults) { + if (noResults && context.argv["error-on-unmatched-pattern"] !== false) { // If there was no files and no other errors, let's yield a general error. yield { error: `No matching files. Patterns: ${context.filePatterns.join(" ")}`, @@ -116,7 +116,9 @@ function* expandPatternsInternal(context) { } if (result.length === 0) { - yield { error: `${errorMessages.emptyResults[type]}: "${input}".` }; + if (context.argv["error-on-unmatched-pattern"] !== false) { + yield { error: `${errorMessages.emptyResults[type]}: "${input}".` }; + } } else { yield* sortPaths(result); } diff --git a/tests_integration/__tests__/__snapshots__/early-exit.js.snap b/tests_integration/__tests__/__snapshots__/early-exit.js.snap index eb58ce63e..932fd54c1 100644 --- a/tests_integration/__tests__/__snapshots__/early-exit.js.snap +++ b/tests_integration/__tests__/__snapshots__/early-exit.js.snap @@ -146,6 +146,8 @@ Editor options: Other options: --no-color Do not colorize error messages. + --no-error-on-unmatched-pattern + Prevent errors when pattern is unmatched. --file-info Extract the following info (as JSON) for a given file path. Reported fields: * ignored (boolean) - true if file path is filtered by --ignore-path * inferredParser (string | null) - name of parser inferred from file path @@ -308,6 +310,8 @@ Editor options: Other options: --no-color Do not colorize error messages. + --no-error-on-unmatched-pattern + Prevent errors when pattern is unmatched. --file-info Extract the following info (as JSON) for a given file path. Reported fields: * ignored (boolean) - true if file path is filtered by --ignore-path * inferredParser (string | null) - name of parser inferred from file path diff --git a/tests_integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap b/tests_integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap new file mode 100644 index 000000000..ddce6fcc5 --- /dev/null +++ b/tests_integration/__tests__/__snapshots__/error-on-unmatched-pattern.js.snap @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`error on unmatched pattern (stderr) 1`] = ` +"[error] No files matching the pattern were found: \\"**/*.toml\\". +" +`; + +exports[`error on unmatched pattern (stdout) 1`] = `""`; + +exports[`error on unmatched pattern (write) 1`] = `Array []`; + +exports[`error on unmatched pattern when 2nd glob has no match (stderr) 1`] = ` +"[error] No files matching the pattern were found: \\"**/*.toml\\". +" +`; + +exports[`error on unmatched pattern when 2nd glob has no match (stdout) 1`] = ` +"const hello = \\"there\\"; +{ + \\"hello\\": \\"there\\" +} +hello: there +" +`; + +exports[`error on unmatched pattern when 2nd glob has no match (write) 1`] = `Array []`; + +exports[`no error on unmatched pattern (stderr) 1`] = `""`; + +exports[`no error on unmatched pattern (stdout) 1`] = ` +"const hello = \\"there\\"; +" +`; + +exports[`no error on unmatched pattern (write) 1`] = `Array []`; + +exports[`no error on unmatched pattern when 2nd glob has no match (stderr) 1`] = `""`; + +exports[`no error on unmatched pattern when 2nd glob has no match (stdout) 1`] = ` +"const hello = \\"there\\"; +{ + \\"hello\\": \\"there\\" +} +hello: there +" +`; + +exports[`no error on unmatched pattern when 2nd glob has no match (write) 1`] = `Array []`; diff --git a/tests_integration/__tests__/__snapshots__/help-options.js.snap b/tests_integration/__tests__/__snapshots__/help-options.js.snap index 0b8f6343b..c98b0f62d 100644 --- a/tests_integration/__tests__/__snapshots__/help-options.js.snap +++ b/tests_integration/__tests__/__snapshots__/help-options.js.snap @@ -347,6 +347,17 @@ exports[`show detailed usage with --help no-editorconfig (stdout) 1`] = ` exports[`show detailed usage with --help no-editorconfig (write) 1`] = `Array []`; +exports[`show detailed usage with --help no-error-on-unmatched-pattern (stderr) 1`] = `""`; + +exports[`show detailed usage with --help no-error-on-unmatched-pattern (stdout) 1`] = ` +"--no-error-on-unmatched-pattern + + Prevent errors when pattern is unmatched. +" +`; + +exports[`show detailed usage with --help no-error-on-unmatched-pattern (write) 1`] = `Array []`; + exports[`show detailed usage with --help no-semi (stderr) 1`] = `""`; exports[`show detailed usage with --help no-semi (stdout) 1`] = ` diff --git a/tests_integration/__tests__/error-on-unmatched-pattern.js b/tests_integration/__tests__/error-on-unmatched-pattern.js new file mode 100644 index 000000000..102f61326 --- /dev/null +++ b/tests_integration/__tests__/error-on-unmatched-pattern.js @@ -0,0 +1,37 @@ +"use strict"; + +const runPrettier = require("../runPrettier"); + +describe("no error on unmatched pattern", () => { + runPrettier("cli/error-on-unmatched-pattern", [ + "--no-error-on-unmatched-pattern", + "**/*.js", + ]).test({ + status: 0, + }); +}); + +describe("error on unmatched pattern", () => { + runPrettier("cli/error-on-unmatched-pattern", ["**/*.toml"]).test({ + status: 2, + }); +}); + +describe("no error on unmatched pattern when 2nd glob has no match", () => { + runPrettier("cli/error-on-unmatched-pattern", [ + "--no-error-on-unmatched-pattern", + "**/*.{json,js,yml}", + "**/*.toml", + ]).test({ + status: 0, + }); +}); + +describe("error on unmatched pattern when 2nd glob has no match", () => { + runPrettier("cli/error-on-unmatched-pattern", [ + "**/*.{json,js,yml}", + "**/*.toml", + ]).test({ + status: 2, + }); +}); diff --git a/tests_integration/cli/error-on-unmatched-pattern/some.js b/tests_integration/cli/error-on-unmatched-pattern/some.js new file mode 100644 index 000000000..d91ae5302 --- /dev/null +++ b/tests_integration/cli/error-on-unmatched-pattern/some.js @@ -0,0 +1 @@ +const hello = "there"; diff --git a/tests_integration/cli/error-on-unmatched-pattern/some.json b/tests_integration/cli/error-on-unmatched-pattern/some.json new file mode 100644 index 000000000..f7df04e7c --- /dev/null +++ b/tests_integration/cli/error-on-unmatched-pattern/some.json @@ -0,0 +1,3 @@ +{ + "hello": "there" +} diff --git a/tests_integration/cli/error-on-unmatched-pattern/some.yml b/tests_integration/cli/error-on-unmatched-pattern/some.yml new file mode 100644 index 000000000..611962cf5 --- /dev/null +++ b/tests_integration/cli/error-on-unmatched-pattern/some.yml @@ -0,0 +1 @@ +hello: there From 4536fef4fe3515d99c17e3d54aef286478e7f569 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 28 Jan 2021 06:32:08 +0800 Subject: [PATCH 027/237] Simplify `printStartingTag` in glimmer printer (#10152) --- src/language-handlebars/printer-glimmer.js | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/language-handlebars/printer-glimmer.js b/src/language-handlebars/printer-glimmer.js index 50092ce7f..408c0cb4e 100644 --- a/src/language-handlebars/printer-glimmer.js +++ b/src/language-handlebars/printer-glimmer.js @@ -395,26 +395,14 @@ function print(path, options, print) { function printStartingTag(path, print) { const node = path.getValue(); - const attributesLike = []; - if (isNonEmptyArray(node.attributes)) { - const attributes = join(line, path.map(print, "attributes")); - attributesLike.push(line, attributes); - } - - if (isNonEmptyArray(node.modifiers)) { - const modifiers = join(line, path.map(print, "modifiers")); - attributesLike.push(line, modifiers); - } - - if (isNonEmptyArray(node.comments)) { - const comments = join(line, path.map(print, "comments")); - attributesLike.push(line, comments); - } - - if (isNonEmptyArray(node.blockParams)) { - const blockParams = printBlockParams(node); - attributesLike.push(line, blockParams); - } + const attributesLike = ["attributes", "modifiers", "comments", "blockParams"] + .filter((property) => isNonEmptyArray(node[property])) + .map((property) => [ + line, + property === "blockParams" + ? printBlockParams(node) + : join(line, path.map(print, property)), + ]); return [ "<", From b565b579f2111efd058723266fb0e795314c68ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Jan 2021 00:32:29 +0200 Subject: [PATCH 028/237] Build(deps): Bump graphql from 15.4.0 to 15.5.0 (#10149) Bumps [graphql](https://github.com/graphql/graphql-js) from 15.4.0 to 15.5.0. - [Release notes](https://github.com/graphql/graphql-js/releases) - [Commits](https://github.com/graphql/graphql-js/compare/v15.4.0...v15.5.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d11230482..591b68959 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "flow-parser": "0.143.1", "get-stdin": "8.0.0", "globby": "11.0.2", - "graphql": "15.4.0", + "graphql": "15.5.0", "html-element-attributes": "2.3.0", "html-styles": "1.0.0", "html-tag-names": "1.1.5", diff --git a/yarn.lock b/yarn.lock index bde6c8522..6b2412e62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3685,10 +3685,10 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== -graphql@15.4.0: - version "15.4.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.4.0.tgz#e459dea1150da5a106486ba7276518b5295a4347" - integrity sha512-EB3zgGchcabbsU9cFe1j+yxdzKQKAbGUWRb13DsrsMN1yyfmmIq+2+L5MqVWcDCE4V89R5AyUOi7sMOGxdsYtA== +graphql@15.5.0: + version "15.5.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.5.0.tgz#39d19494dbe69d1ea719915b578bf920344a69d5" + integrity sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA== growly@^1.3.0: version "1.3.0" From b7a0e253f67848de9951c19d688768dcc951f546 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Thu, 28 Jan 2021 00:34:39 +0200 Subject: [PATCH 029/237] Fix changelog for #8233 --- changelog_unreleased/cli/8233.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog_unreleased/cli/8233.md b/changelog_unreleased/cli/8233.md index 6af568c1a..6a7fdae12 100644 --- a/changelog_unreleased/cli/8233.md +++ b/changelog_unreleased/cli/8233.md @@ -9,7 +9,7 @@ Checking formatting... [error] No files matching the pattern were found: "prettier/docs/*.yaml". All matched files use Prettier code style! -// Prettier master +// Prettier main $ npx prettier --check --no-error-on-unmatched-pattern "prettier/docs/*.yaml" Checking formatting... All matched files use Prettier code style! From 7411285451b01078b7239356ab3bd3cb08363f18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Jan 2021 02:37:03 +0200 Subject: [PATCH 030/237] Build(deps): Bump node-notifier from 8.0.0 to 8.0.1 (#10161) Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/mikaelbr/node-notifier/releases) - [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md) - [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6b2412e62..6cc86f4eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4035,9 +4035,9 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: kind-of "^6.0.2" is-docker@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.0.0.tgz#2cb0df0e75e2d064fe1864c37cdeacb7b2dcf25b" - integrity sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ== + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.1.1.tgz#4125a88e44e450d384e09047ede71adc2d144156" + integrity sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw== is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" @@ -5316,9 +5316,9 @@ node-modules-regexp@^1.0.0: integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.0.tgz#a7eee2d51da6d0f7ff5094bc7108c911240c1620" - integrity sha512-46z7DUmcjoYdaWyXouuFNNfUo6eFa94t23c53c+lG/9Cvauk4a98rAUp9672X5dxGdQmLpPzTxzu8f/OeEPaFA== + version "8.0.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.1.tgz#f86e89bbc925f2b068784b31f382afdc6ca56be1" + integrity sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA== dependencies: growly "^1.3.0" is-wsl "^2.2.0" @@ -7209,9 +7209,9 @@ uuid@^3.3.2: integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.0.tgz#ab738085ca22dc9a8c92725e459b1d507df5d6ea" - integrity sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ== + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== v8-compile-cache@^2.0.3: version "2.1.1" From 53a7e9782b87523c732f4aef14fe1fdb6609a8b3 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 28 Jan 2021 23:03:16 +0900 Subject: [PATCH 031/237] Print trailing comma for type parameters (#10109) * Print type parameters for TypeScript * Add more tests * Add changelog * Avoid duplicates printing trailing-commas * Fix changelog * Address review * Update src/language-js/print/type-parameters.js * Update 10109.md Co-authored-by: Georgii Dolzhykov --- changelog_unreleased/typescript/10109.md | 43 +++ src/language-js/print/type-parameters.js | 34 +-- .../__snapshots__/jsfmt.spec.js.snap | 250 ++++++++++++++++++ .../trailing-comma/arrow-functions.tsx | 4 + tests/typescript/trailing-comma/jsfmt.spec.js | 2 + .../trailing-comma/type-parameters.ts | 10 + 6 files changed, 323 insertions(+), 20 deletions(-) create mode 100644 changelog_unreleased/typescript/10109.md create mode 100644 tests/typescript/trailing-comma/arrow-functions.tsx create mode 100644 tests/typescript/trailing-comma/type-parameters.ts diff --git a/changelog_unreleased/typescript/10109.md b/changelog_unreleased/typescript/10109.md new file mode 100644 index 000000000..1a54cb3b3 --- /dev/null +++ b/changelog_unreleased/typescript/10109.md @@ -0,0 +1,43 @@ +#### Print trailing commas for TS type parameters (#10109 by @sosukesuzuki) + +Initially, Prettier printed trailing commas in TypeScript type parameters with `--trailing-comma=all`, but TypeScript did not support it at the time, so the feature was removed. However, it is supported now (since TypeScript 2.7 released in January 2018). + + +```ts +// Input +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +// Prettier stable +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +// Prettier main +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH, +>; + +``` diff --git a/src/language-js/print/type-parameters.js b/src/language-js/print/type-parameters.js index ca1ecb06c..a747967fd 100644 --- a/src/language-js/print/type-parameters.js +++ b/src/language-js/print/type-parameters.js @@ -52,17 +52,24 @@ function printTypeParameters(path, options, print, paramsKey) { ]; } + // Keep comma if the file extension is .tsx and + // has one type parameter that isn't extend with any types. + // Because, otherwise formatted result will be invalid as tsx. + const trailingComma = + getFunctionParameters(n).length === 1 && + isTSXFile(options) && + !n[paramsKey][0].constraint && + path.getParentNode().type === "ArrowFunctionExpression" + ? "," + : shouldPrintComma(options, "all") + ? ifBreak(",") + : ""; + return group( [ "<", indent([softline, join([",", line], path.map(print, paramsKey))]), - ifBreak( - options.parser !== "typescript" && - options.parser !== "babel-ts" && - shouldPrintComma(options, "all") - ? "," - : "" - ), + trailingComma, softline, ">", ], @@ -124,19 +131,6 @@ function printTypeParameter(path, options, print) { parts.push(" = ", path.call(print, "default")); } - // Keep comma if the file extension is .tsx and - // has one type parameter that isn't extend with any types. - // Because, otherwise formatted result will be invalid as tsx. - const grandParent = path.getNode(2); - if ( - getFunctionParameters(parent).length === 1 && - isTSXFile(options) && - !n.constraint && - grandParent.type === "ArrowFunctionExpression" - ) { - parts.push(","); - } - return parts; } diff --git a/tests/typescript/trailing-comma/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/trailing-comma/__snapshots__/jsfmt.spec.js.snap index 2728bc25f..3fe0b32a0 100644 --- a/tests/typescript/trailing-comma/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/trailing-comma/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,68 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`arrow-functions.tsx - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "all" + | printWidth +=====================================input====================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +=====================================output===================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +================================================================================ +`; + +exports[`arrow-functions.tsx - {"trailingComma":"es5"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "es5" + | printWidth +=====================================input====================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +=====================================output===================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +================================================================================ +`; + +exports[`arrow-functions.tsx - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +=====================================output===================================== +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; + +================================================================================ +`; + exports[`trailing.ts - {"trailingComma":"all"} format 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -24,6 +87,50 @@ const { ...rest, } = something; +=====================================output===================================== +export class BaseSingleLevelProfileTargeting< + T extends ValidSingleLevelProfileNode, +> {} + +enum Enum { + x = 1, + y = 2, +} + +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest +} = something; + +================================================================================ +`; + +exports[`trailing.ts - {"trailingComma":"es5"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "es5" + | printWidth +=====================================input====================================== +export class BaseSingleLevelProfileTargeting< + T extends ValidSingleLevelProfileNode, +> { +} + +enum Enum { + x = 1, + y = 2, +} + +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; + =====================================output===================================== export class BaseSingleLevelProfileTargeting< T extends ValidSingleLevelProfileNode @@ -43,3 +150,146 @@ const { ================================================================================ `; + +exports[`trailing.ts - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +export class BaseSingleLevelProfileTargeting< + T extends ValidSingleLevelProfileNode, +> { +} + +enum Enum { + x = 1, + y = 2, +} + +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest, +} = something; + +=====================================output===================================== +export class BaseSingleLevelProfileTargeting< + T extends ValidSingleLevelProfileNode +> {} + +enum Enum { + x = 1, + y = 2 +} + +const { + longKeySoThisWillGoOnMultipleLines, + longKeySoThisWillGoOnMultipleLines2, + longKeySoThisWillGoOnMultipleLines3, + ...rest +} = something; + +================================================================================ +`; + +exports[`type-parameters.ts - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "all" + | printWidth +=====================================input====================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +=====================================output===================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH, +>; + +================================================================================ +`; + +exports[`type-parameters.ts - {"trailingComma":"es5"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "es5" + | printWidth +=====================================input====================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +=====================================output===================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +================================================================================ +`; + +exports[`type-parameters.ts - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +=====================================output===================================== +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; + +================================================================================ +`; diff --git a/tests/typescript/trailing-comma/arrow-functions.tsx b/tests/typescript/trailing-comma/arrow-functions.tsx new file mode 100644 index 000000000..a1555939a --- /dev/null +++ b/tests/typescript/trailing-comma/arrow-functions.tsx @@ -0,0 +1,4 @@ +const f1 = () => 1; +const f2 = < + Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt, +>() => 1; diff --git a/tests/typescript/trailing-comma/jsfmt.spec.js b/tests/typescript/trailing-comma/jsfmt.spec.js index 8f1fcce6b..87950996e 100644 --- a/tests/typescript/trailing-comma/jsfmt.spec.js +++ b/tests/typescript/trailing-comma/jsfmt.spec.js @@ -1 +1,3 @@ run_spec(__dirname, ["typescript"], { trailingComma: "all" }); +run_spec(__dirname, ["typescript"], { trailingComma: "es5" }); +run_spec(__dirname, ["typescript"], { trailingComma: "none" }); diff --git a/tests/typescript/trailing-comma/type-parameters.ts b/tests/typescript/trailing-comma/type-parameters.ts new file mode 100644 index 000000000..058c607a1 --- /dev/null +++ b/tests/typescript/trailing-comma/type-parameters.ts @@ -0,0 +1,10 @@ +var bar: Bar< + AAAAAAA, + BBBBBBB, + CCCCCCC, + DDDDDDD, + EEEEEEE, + FFFFFFF, + GGGGGGG, + HHHHHHH +>; From c881350e8caae716b5a373bbe8a5d7831cd195b8 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 28 Jan 2021 23:06:16 +0900 Subject: [PATCH 032/237] Break assignment whose rhs is wrapped by an unary expression (#10158) * Break assignment whose rhs is wrapped unary expression * Add changelog * Recursive * Refactor * With loop * Use if * Update assignment.js * Update assignment.js This rewrite not totally equal, but should safe. * Revert "Update assignment.js" This reverts commit 14549442b7726461b0e39d0b1077cdbb00195e73. * Try move parser check upper * Simplify `switch` * Simplify * Move parser check to top Co-authored-by: fisker Cheung --- changelog_unreleased/javascript/10158.md | 15 +++++ src/language-js/print/assignment.js | 62 +++++++++++++------ .../__snapshots__/jsfmt.spec.js.snap | 36 +++++++++++ tests/js/assignment/unary.js | 8 +++ 4 files changed, 103 insertions(+), 18 deletions(-) create mode 100644 changelog_unreleased/javascript/10158.md create mode 100644 tests/js/assignment/unary.js diff --git a/changelog_unreleased/javascript/10158.md b/changelog_unreleased/javascript/10158.md new file mode 100644 index 000000000..90c989c15 --- /dev/null +++ b/changelog_unreleased/javascript/10158.md @@ -0,0 +1,15 @@ +#### Break assignment whose rhs is wrapped by an unary expression (#10158 by @sosukesuzuki) + + +```js +// Input +const loooooooooooooooooooooooooong = !looooooooooooooong.looooooooooooooong.loooooong; + +// Prettier stable +const loooooooooooooooooooooooooong = !looooooooooooooong.looooooooooooooong + .loooooong; + +// Prettier main +const loooooooooooooooooooooooooong = + !looooooooooooooong.looooooooooooooong.loooooong; +``` diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js index 1a90748f1..8bdf23ce1 100644 --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -12,6 +12,10 @@ const { } = require("../utils"); const { shouldInlineLogicalExpression } = require("./binaryish"); +/** + * @typedef {import("../types/estree").Node} Node + */ + function printAssignment( leftNode, printedLeft, @@ -63,30 +67,52 @@ function printAssignmentRight(leftNode, rightNode, printedRight, options) { return indent([line, printedRight]); } - const canBreak = - (isBinaryish(rightNode) && !shouldInlineLogicalExpression(rightNode)) || - (rightNode.type === "ConditionalExpression" && - isBinaryish(rightNode.test) && - !shouldInlineLogicalExpression(rightNode.test)) || - rightNode.type === "StringLiteralTypeAnnotation" || - (rightNode.type === "ClassExpression" && - isNonEmptyArray(rightNode.decorators)) || - ((leftNode.type === "Identifier" || - isStringLiteral(leftNode) || - leftNode.type === "MemberExpression") && - (isStringLiteral(rightNode) || isMemberExpressionChain(rightNode)) && - // do not put values on a separate line from the key in json - options.parser !== "json" && - options.parser !== "json5") || - rightNode.type === "SequenceExpression"; - - if (canBreak) { + if (canBreakAssignmentRight(leftNode, rightNode, options)) { return group(indent([line, printedRight])); } return [" ", printedRight]; } +function canBreakAssignmentRight(leftNode, rightNode, options) { + // do not put values on a separate line from the key in json + if (options.parser === "json5" || options.parser === "json") { + return false; + } + + if (isBinaryish(rightNode) && !shouldInlineLogicalExpression(rightNode)) { + return true; + } + + switch (rightNode.type) { + case "StringLiteralTypeAnnotation": + case "SequenceExpression": + return true; + case "ConditionalExpression": { + const { test } = rightNode; + return isBinaryish(test) && !shouldInlineLogicalExpression(test); + } + case "ClassExpression": + return isNonEmptyArray(rightNode.decorators); + } + + if ( + leftNode.type === "Identifier" || + isStringLiteral(leftNode) || + leftNode.type === "MemberExpression" + ) { + let node = rightNode; + while (node.type === "UnaryExpression") { + node = node.argument; + } + if (isStringLiteral(node) || isMemberExpressionChain(node)) { + return true; + } + } + + return false; +} + module.exports = { printVariableDeclarator, printAssignmentExpression, diff --git a/tests/js/assignment/__snapshots__/jsfmt.spec.js.snap b/tests/js/assignment/__snapshots__/jsfmt.spec.js.snap index 76d745f14..076339f2a 100644 --- a/tests/js/assignment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/assignment/__snapshots__/jsfmt.spec.js.snap @@ -91,3 +91,39 @@ for (i = 0, len = arr.length; i < len; i++) { ================================================================================ `; + +exports[`unary.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const loooooooooooooooooooooooooong1 = void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong2 = void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong3 = !looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong4 = !"looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong5 = void void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong6 = void void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong7 = !!looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong8 = !!"looooooooooooooooooooooooooooooooooooooooooog"; + +=====================================output===================================== +const loooooooooooooooooooooooooong1 = + void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong2 = + void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong3 = + !looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong4 = + !"looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong5 = + void void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong6 = + void void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong7 = + !!looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong8 = + !!"looooooooooooooooooooooooooooooooooooooooooog"; + +================================================================================ +`; diff --git a/tests/js/assignment/unary.js b/tests/js/assignment/unary.js new file mode 100644 index 000000000..b39d899de --- /dev/null +++ b/tests/js/assignment/unary.js @@ -0,0 +1,8 @@ +const loooooooooooooooooooooooooong1 = void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong2 = void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong3 = !looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong4 = !"looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong5 = void void looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong6 = void void "looooooooooooooooooooooooooooooooooooooooooog"; +const loooooooooooooooooooooooooong7 = !!looooooooooooooong.looooooooooooooong.loooooong; +const loooooooooooooooooooooooooong8 = !!"looooooooooooooooooooooooooooooooooooooooooog"; From 12e82a89af937099f38ad7972631f90425532747 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Jan 2021 02:37:32 +0800 Subject: [PATCH 033/237] Build(deps): Bump @angular/compiler from 11.1.0 to 11.1.1 (#10167) Bumps [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) from 11.1.0 to 11.1.1. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/11.1.1/packages/compiler) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 591b68959..ecb648a3b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "11.1.0", + "@angular/compiler": "11.1.1", "@babel/code-frame": "7.12.11", "@babel/parser": "7.12.11", "@glimmer/syntax": "0.73.2", diff --git a/yarn.lock b/yarn.lock index 6cc86f4eb..dd0030002 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/compiler@11.1.0": - version "11.1.0" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.1.0.tgz#0e2e18fe0cb64ec696986f12f80debcbdccc8d20" - integrity sha512-XW+McH/RVjpLtNkft6UYZQbjhXwX/hvLgUa9jGlTuIFM5o7W4XRPnq5sfn3+QvzdROF0j8S5sy47mGVNQOYMNg== +"@angular/compiler@11.1.1": + version "11.1.1" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.1.1.tgz#cafe43b52fb69f0b9493e597baec14fcffd13d7d" + integrity sha512-kybGddMBL6E2BFBOHIX39VsKVxH3yD7NA1g2mQUE9KIqLAavH0KLBr8B03R9MKb6+BElGpk/5yCyCkzkwQES7w== dependencies: tslib "^2.0.0" From 8846448b85565d553013d9bbfc76bbbef21edbbe Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Thu, 28 Jan 2021 23:45:08 +0200 Subject: [PATCH 034/237] Handlebars: fix formatting of attributes (#10145) * Handlebars: fix formatting of attributes * Add group only for class * Add changelog * Update clean.js * Simplify ConcatStatement * Lowercase attr name in clean * Use text instead of n.chars --- changelog_unreleased/handlebars/10145.md | 25 +++ src/language-handlebars/clean.js | 5 + src/language-handlebars/printer-glimmer.js | 168 ++++++++++-------- .../__snapshots__/jsfmt.spec.js.snap | 70 ++++---- tests/handlebars/attr-node/class-name.hbs | 3 + tests/handlebars/attr-node/quotes.hbs | 2 + .../basics/__snapshots__/jsfmt.spec.js.snap | 3 +- .../__snapshots__/jsfmt.spec.js.snap | 44 +++-- .../escape/__snapshots__/jsfmt.spec.js.snap | 19 ++ tests/handlebars/escape/mustache.hbs | 2 + .../__snapshots__/jsfmt.spec.js.snap | 72 ++++---- .../__snapshots__/jsfmt.spec.js.snap | 40 ++--- 12 files changed, 259 insertions(+), 194 deletions(-) create mode 100644 changelog_unreleased/handlebars/10145.md create mode 100644 tests/handlebars/attr-node/quotes.hbs create mode 100644 tests/handlebars/escape/mustache.hbs diff --git a/changelog_unreleased/handlebars/10145.md b/changelog_unreleased/handlebars/10145.md new file mode 100644 index 000000000..2ba7277f5 --- /dev/null +++ b/changelog_unreleased/handlebars/10145.md @@ -0,0 +1,25 @@ +#### Fix formatting of attributes (#10145 by @thorn0) + +- fix escaping of `{{` in attributes and text +- fix the choice between `'` and `"` for attributes with interpolations +- fix the bug with `[object Object]` printed in the `class` attribute +- implement simple formatting for the `class` attribute, like Prettier formatted it in HTML before v2.3.0 + + +```html +// Input +
+
+
+ +// Prettier stable +
+
+
+ +// Prettier main +
+
+
+``` diff --git a/src/language-handlebars/clean.js b/src/language-handlebars/clean.js index db7b843ff..2ded535ca 100644 --- a/src/language-handlebars/clean.js +++ b/src/language-handlebars/clean.js @@ -9,6 +9,11 @@ function clean(ast, newNode /*, parent*/) { } newNode.chars = trimmed; } + + // `class` is reformatted + if (ast.type === "AttrNode" && ast.name.toLowerCase() === "class") { + delete newNode.value; + } } clean.ignoredProperties = new Set(["loc", "selfClosing"]); diff --git a/src/language-handlebars/printer-glimmer.js b/src/language-handlebars/printer-glimmer.js index 408c0cb4e..fccfa2dea 100644 --- a/src/language-handlebars/printer-glimmer.js +++ b/src/language-handlebars/printer-glimmer.js @@ -2,10 +2,10 @@ const { builders: { dedent, group, hardline, ifBreak, indent, join, line, softline }, - utils: { getDocParts }, } = require("../document"); -const { isNonEmptyArray } = require("../common/util"); +const { isNonEmptyArray, replaceEndOfLineWith } = require("../common/util"); +const { literalline } = require("../document/doc-builders"); const { locStart, locEnd } = require("./loc"); const clean = require("./clean"); const { @@ -152,23 +152,34 @@ function print(path, options, print) { if (isEmptyText && locStart(n.value) === locEnd(n.value)) { return n.name; } - const value = path.call(print, "value"); - const quotedValue = isText - ? printStringLiteral( - typeof value === "string" ? value : getDocParts(value).join(), - options - ) - : value; - return [n.name, "=", quotedValue]; + + // Let's assume quotes inside the content of text nodes are already + // properly escaped with entities, otherwise the parse wouldn't have parsed them. + const quote = isText + ? chooseEnclosingQuote(options, n.value.chars).quote + : n.value.type === "ConcatStatement" + ? chooseEnclosingQuote( + options, + n.value.parts + .filter((part) => part.type === "TextNode") + .map((part) => part.chars) + .join("") + ).quote + : ""; + + const valueDoc = path.call(print, "value"); + + return [ + n.name, + "=", + quote, + n.name === "class" && quote ? group(indent(valueDoc)) : valueDoc, + quote, + ]; } case "ConcatStatement": { - const quote = options.singleQuote ? "'" : '"'; - return [ - quote, - ...path.map((partPath) => print(partPath), "parts"), - quote, - ]; + return path.map(print, "parts"); } case "Hash": { @@ -178,18 +189,57 @@ function print(path, options, print) { return [n.key, "=", path.call(print, "value")]; } case "TextNode": { - const inAttrNode = path.stack.includes("attributes"); + /* if `{{my-component}}` (or any text containing "{{") + * makes it to the TextNode, it means it was escaped, + * so let's print it escaped, ie.; `\{{my-component}}` */ + let text = n.chars.replace(/{{/g, "\\{{"); - if (options.htmlWhitespaceSensitivity === "strict" && !inAttrNode) { + const attrName = getCurrentAttributeName(path); + + if (attrName) { + // TODO: format style and srcset attributes + if (attrName === "class") { + const formattedClasses = text.trim().split(/\s+/).join(" "); + + let leadingSpace = false; + let trailingSpace = false; + + if (isParentOfSomeType(path, ["ConcatStatement"])) { + if ( + isPreviousNodeOfSomeType(path, ["MustacheStatement"]) && + /^\s/.test(text) + ) { + leadingSpace = true; + } + if ( + isNextNodeOfSomeType(path, ["MustacheStatement"]) && + /\s$/.test(text) && + formattedClasses !== "" + ) { + trailingSpace = true; + } + } + + return [ + leadingSpace ? line : "", + formattedClasses, + trailingSpace ? line : "", + ]; + } + + return replaceEndOfLineWith(text, literalline); + } + + if (options.htmlWhitespaceSensitivity === "strict") { // https://infra.spec.whatwg.org/#ascii-whitespace const leadingWhitespacesRE = /^[\t\n\f\r ]*/; const trailingWhitespacesRE = /[\t\n\f\r ]*$/; const whitespacesOnlyRE = /^[\t\n\f\r ]*$/; - if (whitespacesOnlyRE.test(n.chars)) { + if (whitespacesOnlyRE.test(text)) { let breaks = [line]; - const newlines = countNewLines(n.chars); + const newlines = countNewLines(text); if (newlines) { breaks = generateHardlines(newlines, 2); } @@ -201,10 +251,8 @@ function print(path, options, print) { return breaks; } - const [lead] = n.chars.match(leadingWhitespacesRE); - const [tail] = n.chars.match(trailingWhitespacesRE); - - let text = n.chars; + const [lead] = text.match(leadingWhitespacesRE); + const [tail] = text.match(trailingWhitespacesRE); let leadBreaks = []; if (lead) { @@ -240,11 +288,11 @@ function print(path, options, print) { const maxLineBreaksToPreserve = 2; const isFirstElement = !getPreviousNode(path); const isLastElement = !getNextNode(path); - const isWhitespaceOnly = !/\S/.test(n.chars); - const lineBreaksCount = countNewLines(n.chars); + const isWhitespaceOnly = !/\S/.test(text); + const lineBreaksCount = countNewLines(text); - let leadingLineBreaksCount = countLeadingNewLines(n.chars); - let trailingLineBreaksCount = countTrailingNewLines(n.chars); + let leadingLineBreaksCount = countLeadingNewLines(text); + let trailingLineBreaksCount = countTrailingNewLines(text); if ( (isFirstElement || isLastElement) && @@ -270,34 +318,6 @@ function print(path, options, print) { } } - if (inAttrNode) { - // TODO: format style and srcset attributes - if (!isInAttributeOfName(path, "class")) { - return n.chars; - } - - let leadingSpace = ""; - let trailingSpace = ""; - - if (isParentOfSomeType(path, ["ConcatStatement"])) { - if (isPreviousNodeOfSomeType(path, ["MustacheStatement"])) { - leadingSpace = " "; - } - if (isNextNodeOfSomeType(path, ["MustacheStatement"])) { - trailingSpace = " "; - } - } - - return [ - ...generateHardlines(leadingLineBreaksCount, maxLineBreaksToPreserve), - n.chars.replace(/^\s+/g, leadingSpace).replace(/\s+$/, trailingSpace), - ...generateHardlines( - trailingLineBreaksCount, - maxLineBreaksToPreserve - ), - ]; - } - let leadingSpace = ""; let trailingSpace = ""; @@ -325,15 +345,6 @@ function print(path, options, print) { trailingSpace = ""; } - let text = n.chars; - /* if `{{my-component}}` (or any text starting with a mustache) - * makes it to the TextNode, - * it means it was escaped, - * so let's print it escaped, ie.; `\{{my-component}}` */ - if (text.startsWith("{{") && text.includes("}}")) { - text = "\\" + text; - } - return [ ...generateHardlines(leadingLineBreaksCount, maxLineBreaksToPreserve), text.replace(/^\s+/g, leadingSpace).replace(/\s+$/, trailingSpace), @@ -617,13 +628,13 @@ function printInverse(path, print, options) { /* TextNode print helpers */ -function isInAttributeOfName(path, type) { - return ( - (isParentOfSomeType(path, ["AttrNode"]) && - path.getParentNode().name.toLowerCase() === type) || - (isParentOfSomeType(path, ["ConcatStatement"]) && - path.getParentNode(1).name.toLowerCase() === type) - ); +function getCurrentAttributeName(path) { + for (let depth = 0; depth < 2; depth++) { + const parentNode = path.getParentNode(depth); + if (parentNode && parentNode.type === "AttrNode") { + return parentNode.name.toLowerCase(); + } + } } function countNewLines(string) { @@ -662,6 +673,11 @@ function generateHardlines(number = 0, max = 0) { * @param {object} options - the prettier options object */ function printStringLiteral(stringLiteral, options) { + const { quote, regex } = chooseEnclosingQuote(options, stringLiteral); + return [quote, stringLiteral.replace(regex, `\\${quote}`), quote]; +} + +function chooseEnclosingQuote(options, stringLiteral) { const double = { quote: '"', regex: /"/g }; const single = { quote: "'", regex: /'/g }; @@ -685,13 +701,7 @@ function printStringLiteral(stringLiteral, options) { shouldUseAlternateQuote = numPreferredQuotes > numAlternateQuotes; } - const enclosingQuote = shouldUseAlternateQuote ? alternate : preferred; - const escapedStringLiteral = stringLiteral.replace( - enclosingQuote.regex, - `\\${enclosingQuote.quote}` - ); - - return [enclosingQuote.quote, escapedStringLiteral, enclosingQuote.quote]; + return shouldUseAlternateQuote ? alternate : preferred; } /* SubExpression print helpers */ diff --git a/tests/handlebars/attr-node/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/attr-node/__snapshots__/jsfmt.spec.js.snap index f5438b7a5..455724984 100644 --- a/tests/handlebars/attr-node/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/attr-node/__snapshots__/jsfmt.spec.js.snap @@ -41,21 +41,26 @@ printWidth: 80 '> =====================================output===================================== -
+ newlines" +> -
+ newlines" +> -
+" +> -
+" +> ================================================================================ `; @@ -108,38 +116,38 @@ weirdly formatted {{this.classes}}">String

+ + =====================================output=====================================
-

+

String

-

+

String

-

+

String

+ + +================================================================================ +`; + +exports[`quotes.hbs format 1`] = ` +====================================options===================================== +parsers: ["glimmer"] +printWidth: 80 + | printWidth +=====================================input====================================== +
+
+ +=====================================output===================================== +
+
================================================================================ `; diff --git a/tests/handlebars/attr-node/class-name.hbs b/tests/handlebars/attr-node/class-name.hbs index c14f0fbe9..93d5a2b96 100644 --- a/tests/handlebars/attr-node/class-name.hbs +++ b/tests/handlebars/attr-node/class-name.hbs @@ -22,3 +22,6 @@ weirdly formatted {{this.classes}}">String

+ + diff --git a/tests/handlebars/attr-node/quotes.hbs b/tests/handlebars/attr-node/quotes.hbs new file mode 100644 index 000000000..75726267b --- /dev/null +++ b/tests/handlebars/attr-node/quotes.hbs @@ -0,0 +1,2 @@ +
+
diff --git a/tests/handlebars/basics/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/basics/__snapshots__/jsfmt.spec.js.snap index 56317cf5a..33c6a0773 100644 --- a/tests/handlebars/basics/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/basics/__snapshots__/jsfmt.spec.js.snap @@ -68,8 +68,7 @@ printWidth: 80 Hello -
    +
    ================================================================================ `; diff --git a/tests/handlebars/concat-statement/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/concat-statement/__snapshots__/jsfmt.spec.js.snap index c66778ee0..f3b990352 100644 --- a/tests/handlebars/concat-statement/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/concat-statement/__snapshots__/jsfmt.spec.js.snap @@ -33,9 +33,12 @@ singleQuote: true
    Hello
    @@ -51,7 +54,7 @@ singleQuote: true
    -
    +
    ================================================================================ `; @@ -87,9 +90,12 @@ printWidth: 80
    Hello
    @@ -105,7 +111,7 @@ printWidth: 80
    -
    +
    ================================================================================ `; @@ -126,9 +132,9 @@ singleQuote: true =====================================output=====================================
    hey
    @@ -141,8 +147,9 @@ singleQuote: true @@ -165,9 +172,9 @@ printWidth: 80 =====================================output=====================================
    hey
    @@ -180,8 +187,9 @@ printWidth: 80 diff --git a/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap index 63fa6f626..53584eb01 100644 --- a/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap @@ -13,3 +13,22 @@ printWidth: 80

    ================================================================================ `; + +exports[`mustache.hbs format 1`] = ` +====================================options===================================== +parsers: ["glimmer"] +printWidth: 80 + | printWidth +=====================================input====================================== +
    \\{{
    +
    \\{{
    + +=====================================output===================================== +
    + \\{{ +
    +
    + \\{{ +
    +================================================================================ +`; diff --git a/tests/handlebars/escape/mustache.hbs b/tests/handlebars/escape/mustache.hbs new file mode 100644 index 000000000..96e7a2f8c --- /dev/null +++ b/tests/handlebars/escape/mustache.hbs @@ -0,0 +1,2 @@ +
    \{{
    +
    \{{
    diff --git a/tests/handlebars/mustache-statement/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/mustache-statement/__snapshots__/jsfmt.spec.js.snap index 7890ecc17..c5aadaabb 100644 --- a/tests/handlebars/mustache-statement/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/mustache-statement/__snapshots__/jsfmt.spec.js.snap @@ -99,41 +99,37 @@ singleQuote: true />
    @@ -266,41 +262,37 @@ printWidth: 80 />
    diff --git a/tests/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap index 379c2bf64..891b513bc 100644 --- a/tests/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/single-quote-option/__snapshots__/jsfmt.spec.js.snap @@ -98,24 +98,20 @@ singleQuote: false ================================================================================ `; @@ -150,24 +146,20 @@ singleQuote: true ================================================================================ `; From c3a59148cfa1daacd912dc36244966f63715a575 Mon Sep 17 00:00:00 2001 From: fisker Cheing Date: Fri, 29 Jan 2021 17:59:25 +0800 Subject: [PATCH 035/237] Ignore `.nyc_output` dir --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index a9e368637..a51105f52 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,3 +10,4 @@ coverage/ /website/static/lib/ /website/static/playground.js cspell.json +.nyc_output From 07b30645ec0050b28466c32722e378fb77cdbb8e Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Fri, 29 Jan 2021 20:03:11 +0900 Subject: [PATCH 036/237] style: Add new ESLint rule `no-empty-string-for-ifbreak` (#10172) * Add new ESLint rule for ifBreak * Fix for third argument * Run fix with new rule * Address review * Fix * Update no-empty-flat-contents-for-if-break.js * Fix CI config Co-authored-by: fisker Cheung --- .eslintrc.yml | 1 + .github/workflows/eslint-rules.yml | 4 +- .../index.js | 1 + .../no-empty-flat-contents-for-if-break.js | 42 ++++++++++++++++++ .../test.js | 43 +++++++++++++++++++ src/language-css/printer-postcss.js | 2 +- src/language-js/print/ternary.js | 4 +- src/language-js/print/typescript.js | 2 +- .../print/flow-mapping-sequence.js | 2 +- 9 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 scripts/tools/eslint-plugin-prettier-internal-rules/no-empty-flat-contents-for-if-break.js diff --git a/.eslintrc.yml b/.eslintrc.yml index 89c520c2d..37c6964be 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -117,6 +117,7 @@ overrides: prettier-internal-rules/no-doc-builder-concat: error prettier-internal-rules/prefer-fast-path-each: error prettier-internal-rules/prefer-is-non-empty-array: error + prettier-internal-rules/no-empty-flat-contents-for-if-break: error - files: src/document/*.js rules: prettier-internal-rules/no-doc-builder-concat: off diff --git a/.github/workflows/eslint-rules.yml b/.github/workflows/eslint-rules.yml index 75b183a46..8f2b9db6a 100644 --- a/.github/workflows/eslint-rules.yml +++ b/.github/workflows/eslint-rules.yml @@ -3,11 +3,11 @@ name: Internal_ESLint_Rules_Test on: push: paths: - - "scripts/tools/eslint-plugin-prettier-internal-rules" + - "scripts/tools/eslint-plugin-prettier-internal-rules/**" - ".github/workflows/eslint-rules.yml" pull_request: paths: - - "scripts/tools/eslint-plugin-prettier-internal-rules" + - "scripts/tools/eslint-plugin-prettier-internal-rules/**" - ".github/workflows/eslint-rules.yml" jobs: diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js index 3bec6a3e2..a8ab40ff2 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js @@ -10,5 +10,6 @@ module.exports = { "prefer-fast-path-each": require("./prefer-fast-path-each"), "prefer-is-non-empty-array": require("./prefer-is-non-empty-array"), "require-json-extensions": require("./require-json-extensions"), + "no-empty-flat-contents-for-if-break": require("./no-empty-flat-contents-for-if-break"), }, }; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-empty-flat-contents-for-if-break.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-empty-flat-contents-for-if-break.js new file mode 100644 index 000000000..5d9d852e0 --- /dev/null +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-empty-flat-contents-for-if-break.js @@ -0,0 +1,42 @@ +"use strict"; + +const selector = [ + "CallExpression", + "[optional=false]", + '[callee.type="Identifier"]', + '[callee.name="ifBreak"]', + "[arguments.length=2]", + '[arguments.1.type="Literal"]', + '[arguments.1.value=""]', + ':not([arguments.0.type="SpreadElement"])', +].join(""); + +const messageId = "no-empty-flat-contents-for-if-break"; + +module.exports = { + meta: { + type: "suggestion", + docs: { + url: + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-empty-flat-contents-for-if-break.js", + }, + messages: { + [messageId]: + "Please don't pass an empty string to second parameter of ifBreak.", + }, + fixable: "code", + }, + create(context) { + return { + [selector](node) { + const [breakContents] = node.arguments; + context.report({ + node, + messageId, + fix: (fixer) => + fixer.removeRange([breakContents.range[1], node.range[1] - 1]), + }); + }, + }; + }, +}; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js index e02c8008e..85ab03c21 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js @@ -204,3 +204,46 @@ test("require-json-extensions", { }, ], }); + +test("no-empty-flat-contents-for-if-break", { + valid: [ + "ifBreak('foo', 'bar')", + "ifBreak(doc1, doc2)", + "ifBreak(',')", + "ifBreak(doc)", + "ifBreak('foo', '', { groupId })", + "ifBreak(...foo, { groupId })", + ], + invalid: [ + { + code: "ifBreak('foo', '')", + output: "ifBreak('foo')", + errors: [ + { + message: + "Please don't pass an empty string to second parameter of ifBreak.", + }, + ], + }, + { + code: "ifBreak('foo' , '' )", + output: "ifBreak('foo')", + errors: [ + { + message: + "Please don't pass an empty string to second parameter of ifBreak.", + }, + ], + }, + { + code: "ifBreak(doc, '')", + output: "ifBreak(doc)", + errors: [ + { + message: + "Please don't pass an empty string to second parameter of ifBreak.", + }, + ], + }, + ], +}); diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js index 10a2f0971..971bd3160 100644 --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -186,7 +186,7 @@ function genericPrint(path, options, print) { options.originalText[locEnd(node) - 1] !== ";" ? "" : options.__isHTMLStyleAttribute && isLastNode(path, node) - ? ifBreak(";", "") + ? ifBreak(";") : ";", ]; } diff --git a/src/language-js/print/ternary.js b/src/language-js/print/ternary.js index bcbf7315f..976f7b9cf 100644 --- a/src/language-js/print/ternary.js +++ b/src/language-js/print/ternary.js @@ -221,10 +221,10 @@ function printTernary(path, options, print) { // parens when using ?: within JSX, because the parens are analogous to // curly braces in an if statement. const wrap = (doc) => [ - ifBreak("(", ""), + ifBreak("("), indent([softline, doc]), softline, - ifBreak(")", ""), + ifBreak(")"), ]; // The only things we don't wrap are: diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index 331e4f732..a9b42d67d 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -348,7 +348,7 @@ function printTypescript(path, options, print) { n.optional ? getTypeScriptMappedTypeModifier(n.optional, "?") : "", n.typeAnnotation ? ": " : "", path.call(print, "typeAnnotation"), - ifBreak(semi, ""), + ifBreak(semi), ]), printDanglingComments(path, options, /* sameIndent */ true), options.bracketSpacing ? line : softline, diff --git a/src/language-yaml/print/flow-mapping-sequence.js b/src/language-yaml/print/flow-mapping-sequence.js index 28b87a059..b5d8152eb 100644 --- a/src/language-yaml/print/flow-mapping-sequence.js +++ b/src/language-yaml/print/flow-mapping-sequence.js @@ -29,7 +29,7 @@ function printFlowMapping(path, print, options) { alignWithSpaces(options.tabWidth, [ bracketSpacing, printChildren(path, print, options), - options.trailingComma === "none" ? "" : ifBreak(",", ""), + options.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline, join(hardline, path.map(print, "endComments"))] : "", From a7ea77e0eff76c31e992839576e99ef1f057ad47 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 29 Jan 2021 19:58:24 +0200 Subject: [PATCH 037/237] Fix regression after pr-10106 (#10160) --- changelog_unreleased/javascript/10106.md | 2 +- src/language-js/print/array.js | 18 +++++----- .../arrays/__snapshots__/jsfmt.spec.js.snap | 36 +++++++++++++++++++ tests/js/arrays/issue-10159.js | 4 +++ 4 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 tests/js/arrays/issue-10159.js diff --git a/changelog_unreleased/javascript/10106.md b/changelog_unreleased/javascript/10106.md index 63c2da6c5..cacf58331 100644 --- a/changelog_unreleased/javascript/10106.md +++ b/changelog_unreleased/javascript/10106.md @@ -1,4 +1,4 @@ -#### Concise formatting of number-only arrays (#10106 by @thorn0) +#### Concise formatting of number-only arrays (#10106, #10160 by @thorn0) While in general, Prettier avoids this kind of formatting because it's not diff-friendly, in this special case we decided that the benefits outweigh the risks. diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js index d503caf56..afa53aafb 100644 --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -57,14 +57,6 @@ function printArray(path, options, print) { const groupId = Symbol("array"); - const trailingComma = !canHaveTrailingComma - ? "" - : needsForcedTrailingComma - ? "," - : !shouldPrintComma(options) - ? "" - : ifBreak(",", "", { groupId }); - const shouldBreak = !options.__inJestEach && n.elements.length > 1 && @@ -106,6 +98,16 @@ function printArray(path, options, print) { ) ); + const trailingComma = !canHaveTrailingComma + ? "" + : needsForcedTrailingComma + ? "," + : !shouldPrintComma(options) + ? "" + : shouldUseConciseFormatting + ? ifBreak(",", "", { groupId }) + : ifBreak(","); + parts.push( group( [ diff --git a/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap index 9d428d70d..a5e5d3eac 100644 --- a/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrays/__snapshots__/jsfmt.spec.js.snap @@ -35,6 +35,42 @@ new Test().test().test([, 0]).test(); ================================================================================ `; +exports[`issue-10159.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +{for (const srcPath of [src, \`\${src}.js\`, \`\${src}/index\`, \`\${src}/index.js\`]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321]) {}} + +=====================================output===================================== +{ + for (const srcPath of [src, \`\${src}.js\`, \`\${src}/index\`, \`\${src}/index.js\`]) { + } +} +{ + for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43]) { + } +} +{ + for (const srcPath of [ + 123, 123_123_123, 123_123_123_1, 13_123_3123_31_432, + ]) { + } +} +{ + for (const srcPath of [ + 123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321, + ]) { + } +} + +================================================================================ +`; + exports[`last.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/arrays/issue-10159.js b/tests/js/arrays/issue-10159.js new file mode 100644 index 000000000..7b86423b4 --- /dev/null +++ b/tests/js/arrays/issue-10159.js @@ -0,0 +1,4 @@ +{for (const srcPath of [src, `${src}.js`, `${src}/index`, `${src}/index.js`]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432]) {}} +{for (const srcPath of [123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321]) {}} From 78b38d2282ab28a4638c4de0a262fcf121c05a15 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 29 Jan 2021 21:48:34 +0200 Subject: [PATCH 038/237] Round-trippable --debug-print-doc (#10169) --- changelog_unreleased/cli/10169.md | 3 + commands.md | 9 + cspell.json | 1 + src/document/doc-builders.js | 18 +- src/document/doc-debug.js | 201 +++++++++++------- src/document/doc-utils.js | 6 +- src/language-markdown/printer-markdown.js | 4 +- .../__tests__/__snapshots__/debug-api.js.snap | 1 - tests_integration/__tests__/debug-api.js | 20 +- .../__tests__/debug-print-doc.js | 2 +- 10 files changed, 171 insertions(+), 94 deletions(-) create mode 100644 changelog_unreleased/cli/10169.md diff --git a/changelog_unreleased/cli/10169.md b/changelog_unreleased/cli/10169.md new file mode 100644 index 000000000..60abb7d50 --- /dev/null +++ b/changelog_unreleased/cli/10169.md @@ -0,0 +1,3 @@ +#### Round-trippable `--debug-print-doc` (#10169 by @thorn0) + +The idea is to make the output of `--debug-print-doc` closer to actual code for generating docs (Prettier's intermediate representation). Ideally, it should be possible for it to work without modification after copy-pasting into a JS file. That ideal hasn't probably been reached by this PR, but it's pretty close. This is going to make `--debug-print-doc` and the corresponding part of the Playground a bit more useful. diff --git a/commands.md b/commands.md index 0a0145418..ced50fa62 100644 --- a/commands.md +++ b/commands.md @@ -237,6 +237,15 @@ declare var trim: Doc; This will trim any whitespace or tab character on the current line. This is used for preprocessor directives. +### hardlineWithoutBreakParent and literallineWithoutBreakParent + +These are used very rarely, for advanced formatting tricks. + +Examples: + +- `hardlineWithoutBreakParent` is used for printing tables in Prettier's Markdown printer. With `proseWrap` set to `never`, the columns are aligned only if none of the rows exceeds `printWidth`. +- `literallineWithoutBreakParent` (called `literalLineNoBreak` [there](https://github.com/prettier/plugin-ruby/blob/9e658db13d3f0524d816528e060b1381e0431559/src/ruby/nodes/heredocs.js)) is used in the [Ruby plugin](https://github.com/prettier/plugin-ruby) for printing heredoc syntax. + ### cursor ```ts diff --git a/cspell.json b/cspell.json index 8edacecc9..81a7a1e1f 100644 --- a/cspell.json +++ b/cspell.json @@ -370,6 +370,7 @@ "Tomasek", "Tradeshift", "Transloadit", + "trippable", "TSAs", "tsep", "TSESTree", diff --git a/src/document/doc-builders.js b/src/document/doc-builders.js index ad08e1775..3b3c90da8 100644 --- a/src/document/doc-builders.js +++ b/src/document/doc-builders.js @@ -186,13 +186,19 @@ function lineSuffix(contents) { const lineSuffixBoundary = { type: "line-suffix-boundary" }; const breakParent = { type: "break-parent" }; const trim = { type: "trim" }; + +const hardlineWithoutBreakParent = { type: "line", hard: true }; +const literallineWithoutBreakParent = { + type: "line", + hard: true, + literal: true, +}; + const line = { type: "line" }; const softline = { type: "line", soft: true }; -const hardline = concat([{ type: "line", hard: true }, breakParent]); -const literalline = concat([ - { type: "line", hard: true, literal: true }, - breakParent, -]); +const hardline = concat([hardlineWithoutBreakParent, breakParent]); +const literalline = concat([literallineWithoutBreakParent, breakParent]); + const cursor = { type: "cursor", placeholder: Symbol("cursor") }; /** @@ -257,4 +263,6 @@ module.exports = { markAsRoot, dedentToRoot, dedent, + hardlineWithoutBreakParent, + literallineWithoutBreakParent, }; diff --git a/src/document/doc-debug.js b/src/document/doc-debug.js index 0c31aa99f..11926eca1 100644 --- a/src/document/doc-debug.js +++ b/src/document/doc-debug.js @@ -5,13 +5,11 @@ const { isConcat, getDocParts } = require("./doc-utils"); function flattenDoc(doc) { if (isConcat(doc)) { const res = []; - const parts = getDocParts(doc); - for (let i = 0; i < parts.length; ++i) { - const doc2 = parts[i]; - if (typeof doc2 !== "string" && isConcat(doc2)) { - res.push(...flattenDoc(doc2).parts); + for (const part of getDocParts(doc)) { + if (isConcat(part)) { + res.push(...flattenDoc(part).parts); } else { - const flattened = flattenDoc(doc2); + const flattened = flattenDoc(part); if (flattened !== "") { res.push(flattened); } @@ -35,100 +33,149 @@ function flattenDoc(doc) { ? doc.expandedStates.map(flattenDoc) : doc.expandedStates, }; + } else if (doc.type === "fill") { + return { type: "fill", parts: doc.parts.map(flattenDoc) }; } else if (doc.contents) { return { ...doc, contents: flattenDoc(doc.contents) }; } return doc; } -function printDoc(doc) { - if (typeof doc === "string") { - return JSON.stringify(doc); - } +function printDocToDebug(doc) { + /** @type Record */ + const printedSymbols = Object.create(null); + /** @type Set */ + const usedKeysForSymbols = new Set(); + return printDoc(flattenDoc(doc)); - if (isConcat(doc)) { - return "[" + getDocParts(doc).map(printDoc).join(", ") + "]"; - } - - if (doc.type === "line") { - if (doc.literal) { - return "literalline"; + function printDoc(doc, index, parentParts) { + if (typeof doc === "string") { + return JSON.stringify(doc); } - if (doc.hard) { - return "hardline"; + + if (isConcat(doc)) { + return `[${getDocParts(doc).map(printDoc).filter(Boolean).join(", ")}]`; } - if (doc.soft) { - return "softline"; + + if (doc.type === "line") { + const withBreakParent = + Array.isArray(parentParts) && + parentParts[index + 1] && + parentParts[index + 1].type === "break-parent"; + if (doc.literal) { + return withBreakParent + ? "literalline" + : "literallineWithoutBreakParent"; + } + if (doc.hard) { + return withBreakParent ? "hardline" : "hardlineWithoutBreakParent"; + } + if (doc.soft) { + return "softline"; + } + return "line"; } - return "line"; - } - if (doc.type === "break-parent") { - return "breakParent"; - } + if (doc.type === "break-parent") { + const afterHardline = + Array.isArray(parentParts) && + parentParts[index - 1] && + parentParts[index - 1].type === "line" && + parentParts[index - 1].hard; + return afterHardline ? undefined : "breakParent"; + } - if (doc.type === "trim") { - return "trim"; - } + if (doc.type === "trim") { + return "trim"; + } - if (doc.type === "indent") { - return "indent(" + printDoc(doc.contents) + ")"; - } + if (doc.type === "indent") { + return "indent(" + printDoc(doc.contents) + ")"; + } - if (doc.type === "align") { - return doc.n === Number.NEGATIVE_INFINITY - ? "dedentToRoot(" + printDoc(doc.contents) + ")" - : doc.n < 0 - ? "dedent(" + printDoc(doc.contents) + ")" - : doc.n.type === "root" - ? "markAsRoot(" + printDoc(doc.contents) + ")" - : "align(" + JSON.stringify(doc.n) + ", " + printDoc(doc.contents) + ")"; - } + if (doc.type === "align") { + return doc.n === Number.NEGATIVE_INFINITY + ? "dedentToRoot(" + printDoc(doc.contents) + ")" + : doc.n < 0 + ? "dedent(" + printDoc(doc.contents) + ")" + : doc.n.type === "root" + ? "markAsRoot(" + printDoc(doc.contents) + ")" + : "align(" + + JSON.stringify(doc.n) + + ", " + + printDoc(doc.contents) + + ")"; + } - if (doc.type === "if-break") { - return ( - "ifBreak(" + - printDoc(doc.breakContents) + - (doc.flatContents ? ", " + printDoc(doc.flatContents) : "") + - ")" - ); - } - - if (doc.type === "group") { - if (doc.expandedStates) { + if (doc.type === "if-break") { return ( - "conditionalGroup(" + - "[" + - doc.expandedStates.map(printDoc).join(",") + - "])" + "ifBreak(" + + printDoc(doc.breakContents) + + (doc.flatContents ? ", " + printDoc(doc.flatContents) : "") + + (doc.groupId + ? (!doc.flatContents ? ', ""' : "") + + `, { groupId: ${printGroupId(doc.groupId)} }` + : "") + + ")" ); } - return ( - (doc.break ? "wrappedGroup" : "group") + - "(" + - printDoc(doc.contents) + - ")" - ); + if (doc.type === "group") { + const optionsParts = []; + + if (doc.break && doc.break !== "propagated") { + optionsParts.push("break: true"); + } + + if (doc.id) { + optionsParts.push(`id: ${printGroupId(doc.id)}`); + } + + const options = + optionsParts.length > 0 ? `, { ${optionsParts.join(", ")} }` : ""; + + if (doc.expandedStates) { + return `conditionalGroup([${doc.expandedStates + .map(printDoc) + .join(",")}]${options})`; + } + + return `group(${printDoc(doc.contents)}${options})`; + } + + if (doc.type === "fill") { + return `fill([${doc.parts.map(printDoc).join(", ")}])`; + } + + if (doc.type === "line-suffix") { + return "lineSuffix(" + printDoc(doc.contents) + ")"; + } + + if (doc.type === "line-suffix-boundary") { + return "lineSuffixBoundary"; + } + + throw new Error("Unknown doc type " + doc.type); } - if (doc.type === "fill") { - return "fill" + "(" + doc.parts.map(printDoc).join(", ") + ")"; - } + function printGroupId(id) { + if (typeof id !== "symbol") { + return JSON.stringify(String(id)); + } - if (doc.type === "line-suffix") { - return "lineSuffix(" + printDoc(doc.contents) + ")"; - } + if (id in printedSymbols) { + return printedSymbols[id]; + } - if (doc.type === "line-suffix-boundary") { - return "lineSuffixBoundary"; + const prefix = id.description || "symbol"; + for (let counter = 0; ; counter++) { + const key = prefix + (counter > 0 ? ` #${counter}` : ""); + if (!usedKeysForSymbols.has(key)) { + usedKeysForSymbols.add(key); + return (printedSymbols[id] = `Symbol.for(${JSON.stringify(key)})`); + } + } } - - throw new Error("Unknown doc type " + doc.type); } -module.exports = { - printDocToDebug(doc) { - return printDoc(flattenDoc(doc)); - }, -}; +module.exports = { printDocToDebug }; diff --git a/src/document/doc-utils.js b/src/document/doc-utils.js index 34f1ba1f2..738527336 100644 --- a/src/document/doc-utils.js +++ b/src/document/doc-utils.js @@ -131,8 +131,10 @@ function breakParentGroup(groupStack) { const parentGroup = groupStack[groupStack.length - 1]; // Breaks are not propagated through conditional groups because // the user is expected to manually handle what breaks. - if (!parentGroup.expandedStates) { - parentGroup.break = true; + if (!parentGroup.expandedStates && !parentGroup.break) { + // An alternative truthy value allows to distinguish propagated group breaks + // and not to print them as `group(..., { break: true })` in `--debug-print-doc`. + parentGroup.break = "propagated"; } } return null; diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index c31e1b394..179132dc2 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -21,8 +21,9 @@ const { align, indent, group, + hardlineWithoutBreakParent, }, - utils: { normalizeDoc, getDocParts }, + utils: { normalizeDoc }, printer: { printDocToString }, } = require("../document"); const { replaceEndOfLineWith } = require("../common/util"); @@ -557,7 +558,6 @@ function printLine(path, value, options) { } function printTable(path, options, print) { - const hardlineWithoutBreakParent = getDocParts(hardline)[0]; const node = path.getValue(); const columnMaxWidths = []; diff --git a/tests_integration/__tests__/__snapshots__/debug-api.js.snap b/tests_integration/__tests__/__snapshots__/debug-api.js.snap index 455167804..80e57f3d6 100644 --- a/tests_integration/__tests__/__snapshots__/debug-api.js.snap +++ b/tests_integration/__tests__/__snapshots__/debug-api.js.snap @@ -10,7 +10,6 @@ exports[`API prettier.formatDoc 1`] = ` \\";\\", ]), hardline, - breakParent, ]; " `; diff --git a/tests_integration/__tests__/debug-api.js b/tests_integration/__tests__/debug-api.js index bf49aafcd..6451571e4 100644 --- a/tests_integration/__tests__/debug-api.js +++ b/tests_integration/__tests__/debug-api.js @@ -1,12 +1,9 @@ "use strict"; const { - parse, - formatAST, - formatDoc, - printToDoc, - printDocToString, -} = require("prettier-local").__debug; + __debug: { parse, formatAST, formatDoc, printToDoc, printDocToString }, + doc: { builders }, +} = require("prettier-local"); const { outdent } = require("outdent"); const code = outdent` @@ -45,4 +42,15 @@ describe("API", () => { test("prettier.printDocToString", () => { expect(stringFromDoc).toBe(formatted); }); + + const doc2 = new Function( + `{ ${Object.keys(builders)} }`, + `return ${formatResultFromDoc}` + )(builders); + const { formatted: stringFromDoc2 } = printDocToString(doc2, options); + const formatResultFromDoc2 = formatDoc(doc2, options); + test("output of prettier.formatDoc can be reused as code", () => { + expect(stringFromDoc2).toBe(formatted); + expect(formatResultFromDoc2).toBe(formatResultFromDoc); + }); }); diff --git a/tests_integration/__tests__/debug-print-doc.js b/tests_integration/__tests__/debug-print-doc.js index 074cbca57..fccdb0b8a 100644 --- a/tests_integration/__tests__/debug-print-doc.js +++ b/tests_integration/__tests__/debug-print-doc.js @@ -6,7 +6,7 @@ describe("prints doc with --debug-print-doc", () => { runPrettier("cli/with-shebang", ["--debug-print-doc", "--parser", "babel"], { input: "0", }).test({ - stdout: '["0", ";", hardline, breakParent];\n', + stdout: '["0", ";", hardline];\n', stderr: "", status: 0, }); From 56840d4890b9b70a890cc35e7da15854d92d34dc Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Sat, 30 Jan 2021 18:25:43 +0200 Subject: [PATCH 039/237] Followup for #10169: minor tweaks (#10177) * Followup for #10169: minor tweaks * Add Copy doc button to Playground --- changelog_unreleased/cli/10169.md | 2 +- src/cli/format.js | 2 +- src/document/doc-debug.js | 5 ++- src/main/core.js | 2 +- .../__tests__/__snapshots__/debug-api.js.snap | 3 +- .../__snapshots__/debug-print-doc.js.snap | 3 -- tests_integration/__tests__/debug-api.js | 24 +++++++++++- .../__tests__/debug-print-doc.js | 3 +- website/playground/Playground.js | 39 ++++++++++++------- website/playground/markdown.js | 16 ++++---- 10 files changed, 66 insertions(+), 33 deletions(-) delete mode 100644 tests_integration/__tests__/__snapshots__/debug-print-doc.js.snap diff --git a/changelog_unreleased/cli/10169.md b/changelog_unreleased/cli/10169.md index 60abb7d50..7a0b6249a 100644 --- a/changelog_unreleased/cli/10169.md +++ b/changelog_unreleased/cli/10169.md @@ -1,3 +1,3 @@ -#### Round-trippable `--debug-print-doc` (#10169 by @thorn0) +#### Round-trippable `--debug-print-doc` (#10169, #10177 by @thorn0) The idea is to make the output of `--debug-print-doc` closer to actual code for generating docs (Prettier's intermediate representation). Ideally, it should be possible for it to work without modification after copy-pasting into a JS file. That ideal hasn't probably been reached by this PR, but it's pretty close. This is going to make `--debug-print-doc` and the corresponding part of the Playground a bit more useful. diff --git a/src/cli/format.js b/src/cli/format.js index e54bf7cac..0af5fa202 100644 --- a/src/cli/format.js +++ b/src/cli/format.js @@ -113,7 +113,7 @@ function format(context, input, opt) { if (context.argv["debug-print-doc"]) { const doc = prettier.__debug.printToDoc(input, opt); - return { formatted: prettier.__debug.formatDoc(doc) }; + return { formatted: prettier.__debug.formatDoc(doc) + "\n" }; } if (context.argv["debug-print-comments"]) { diff --git a/src/document/doc-debug.js b/src/document/doc-debug.js index 11926eca1..f824ceb12 100644 --- a/src/document/doc-debug.js +++ b/src/document/doc-debug.js @@ -54,7 +54,8 @@ function printDocToDebug(doc) { } if (isConcat(doc)) { - return `[${getDocParts(doc).map(printDoc).filter(Boolean).join(", ")}]`; + const printed = getDocParts(doc).map(printDoc).filter(Boolean); + return printed.length === 1 ? printed[0] : `[${printed.join(", ")}]`; } if (doc.type === "line") { @@ -144,7 +145,7 @@ function printDocToDebug(doc) { } if (doc.type === "fill") { - return `fill([${doc.parts.map(printDoc).join(", ")}])`; + return `fill([${doc.parts.map((part) => printDoc(part)).join(", ")}])`; } if (doc.type === "line-suffix") { diff --git a/src/main/core.js b/src/main/core.js index 47f0d1e18..feb3f169a 100644 --- a/src/main/core.js +++ b/src/main/core.js @@ -348,7 +348,7 @@ module.exports = { formatDoc(doc, options) { return formatWithCursor(printDocToDebug(doc), { ...options, - parser: "babel", + parser: "__js_expression", }).formatted; }, diff --git a/tests_integration/__tests__/__snapshots__/debug-api.js.snap b/tests_integration/__tests__/__snapshots__/debug-api.js.snap index 80e57f3d6..97cbf03f8 100644 --- a/tests_integration/__tests__/__snapshots__/debug-api.js.snap +++ b/tests_integration/__tests__/__snapshots__/debug-api.js.snap @@ -10,6 +10,5 @@ exports[`API prettier.formatDoc 1`] = ` \\";\\", ]), hardline, -]; -" +]" `; diff --git a/tests_integration/__tests__/__snapshots__/debug-print-doc.js.snap b/tests_integration/__tests__/__snapshots__/debug-print-doc.js.snap deleted file mode 100644 index d4087111d..000000000 --- a/tests_integration/__tests__/__snapshots__/debug-print-doc.js.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`prints doc with --debug-print-doc (write) 1`] = `Array []`; diff --git a/tests_integration/__tests__/debug-api.js b/tests_integration/__tests__/debug-api.js index 6451571e4..69c556ef5 100644 --- a/tests_integration/__tests__/debug-api.js +++ b/tests_integration/__tests__/debug-api.js @@ -2,7 +2,10 @@ const { __debug: { parse, formatAST, formatDoc, printToDoc, printDocToString }, - doc: { builders }, + doc: { + builders, + utils: { cleanDoc }, + }, } = require("prettier-local"); const { outdent } = require("outdent"); @@ -53,4 +56,23 @@ describe("API", () => { expect(stringFromDoc2).toBe(formatted); expect(formatResultFromDoc2).toBe(formatResultFromDoc); }); + + test("prettier.formatDoc prints things as expected", () => { + const { indent, hardline, literalline, fill } = builders; + + expect(formatDoc([indent(hardline), indent(literalline)])).toBe( + "[indent(hardline), indent(literalline)]" + ); + + expect(formatDoc(fill(["foo", hardline, "bar", literalline, "baz"]))).toBe( + 'fill(["foo", hardline, "bar", literalline, "baz"])' + ); + + expect( + formatDoc( + // The argument of fill must not be passed to cleanDoc because it's not a doc + fill(cleanDoc(["foo", literalline, "bar"])) // invalid fill + ) + ).toBe('fill(["foo", literallineWithoutBreakParent, breakParent, "bar"])'); + }); }); diff --git a/tests_integration/__tests__/debug-print-doc.js b/tests_integration/__tests__/debug-print-doc.js index fccdb0b8a..aa0995cdf 100644 --- a/tests_integration/__tests__/debug-print-doc.js +++ b/tests_integration/__tests__/debug-print-doc.js @@ -6,8 +6,9 @@ describe("prints doc with --debug-print-doc", () => { runPrettier("cli/with-shebang", ["--debug-print-doc", "--parser", "babel"], { input: "0", }).test({ - stdout: '["0", ";", hardline];\n', + stdout: '["0", ";", hardline]\n', stderr: "", status: 0, + write: [], }); }); diff --git a/website/playground/Playground.js b/website/playground/Playground.js index 16d5ad998..2e512fb42 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -134,20 +134,21 @@ class Playground extends React.Component { }); } - getMarkdown(formatted, reformatted, full) { + getMarkdown({ formatted, reformatted, full, doc }) { const { content, options } = this.state; const { availableOptions, version } = this.props; - return formatMarkdown( - content, - formatted, - reformatted || "", + return formatMarkdown({ + input: content, + output: formatted, + output2: reformatted, + doc, version, - window.location.href, + url: window.location.href, options, - util.buildCliArgs(availableOptions, options), - full - ); + cliOptions: util.buildCliArgs(availableOptions, options), + full, + }); } render() { @@ -172,11 +173,11 @@ class Playground extends React.Component { reformat={editorState.showSecondFormat} > {({ formatted, debug }) => { - const fullReport = this.getMarkdown( + const fullReport = this.getMarkdown({ formatted, - debug.reformatted, - true - ); + reformatted: debug.reformatted, + full: true, + }); const showFullReport = encodeURIComponent(fullReport).length < MAX_LENGTH; return ( @@ -241,6 +242,13 @@ class Playground extends React.Component { checked={editorState.showSecondFormat} onChange={editorState.toggleSecondFormat} /> + {editorState.showDoc && debug.doc && ( + this.getMarkdown({ doc: debug.doc })} + > + Copy doc + + )}
    + )} +
    - + {editorState.showInput ? ( + + ) : null} {editorState.showAst ? ( ) : null} - + {editorState.showOutput ? ( + + ) : null} {editorState.showSecondFormat ? ( Date: Wed, 3 Feb 2021 12:09:53 +0800 Subject: [PATCH 061/237] Build(deps-dev): Bump webpack from 5.18.0 to 5.20.0 (#10223) Bumps [webpack](https://github.com/webpack/webpack) from 5.18.0 to 5.20.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.18.0...v5.20.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 40 +++++----------------------------------- 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 250556c48..dbfaadfc6 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "synchronous-promise": "2.0.15", "tempy": "1.0.0", "terser-webpack-plugin": "5.1.1", - "webpack": "5.18.0" + "webpack": "5.20.0" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 76c2e180b..5b3064e6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3482,14 +3482,6 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -5070,13 +5062,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -5557,7 +5542,7 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2, p-limit@^3.1.0: +p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== @@ -5578,13 +5563,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -5760,13 +5738,6 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - platform@^1.3.3: version "1.3.5" resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" @@ -7339,10 +7310,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.18.0: - version "5.18.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.18.0.tgz#bbcf13094aa0da0534d513f27d7ee72d74e499c6" - integrity sha512-RmiP/iy6ROvVe/S+u0TrvL/oOmvP+2+Bs8MWjvBwwY/j82Q51XJyDJ75m0QAGntL1Wx6B//Xc0+4VPP/hlNHmw== +webpack@5.20.0: + version "5.20.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.20.0.tgz#7225c2e780f4332aef18e0b323b8b3ec01e16d66" + integrity sha512-k7X/+gisrvirr4bzv8JVLzy2RhWiVzd3gA9qzS5je3lwqYrMc5F549vLOk34BoNkkUp4SIpt1rQp48pTxBMXvA== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" @@ -7362,7 +7333,6 @@ webpack@5.18.0: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - pkg-dir "^5.0.0" schema-utils "^3.0.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.1" From 1d2497ccc3c212178872deb91d03fafea236ea8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 14:32:19 +0800 Subject: [PATCH 062/237] Build(deps-dev): Bump @babel/preset-env from 7.12.11 to 7.12.13 (#10231) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 918 ++++++++++++++++++++++++++++----------------------- 2 files changed, 513 insertions(+), 407 deletions(-) diff --git a/package.json b/package.json index dbfaadfc6..bbdd6bc2b 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ }, "devDependencies": { "@babel/core": "7.12.10", - "@babel/preset-env": "7.12.11", + "@babel/preset-env": "7.12.13", "@babel/types": "7.12.12", "@glimmer/reference": "0.74.2", "@rollup/plugin-alias": "3.1.2", diff --git a/yarn.lock b/yarn.lock index 5b3064e6a..5daf81de3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,17 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/compat-data@^7.12.5", "@babel/compat-data@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.7.tgz#9329b4782a7d6bbd7eef57e11addf91ee3ef1e41" - integrity sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw== +"@babel/code-frame@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + dependencies: + "@babel/highlight" "^7.12.13" + +"@babel/compat-data@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.13.tgz#27e19e0ed3726ccf54067ced4109501765e7e2e8" + integrity sha512-U/hshG5R+SIoW7HVWIdmy1cB7s3ki+r3FpyEZiCgpi4tFgPnX/vynY80ZGSASOIrUM6O7VxOgCZgdt7h97bUGg== "@babel/core@7.12.10", "@babel/core@^7.1.0", "@babel/core@^7.7.5": version "7.12.10" @@ -58,67 +65,65 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" - integrity sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA== +"@babel/generator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.13.tgz#5f6ebe6c85db99886db2d7b044409196f872a503" + integrity sha512-9qQ8Fgo8HaSvHEt6A5+BATP7XktD/AdAnObUeTRz5/e2y3kbrxZgz32qUJJsdmwUvBJzF4AeV21nGTNwv05Mpw== dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" + jsesc "^2.5.1" + source-map "^0.5.0" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz#bb0b75f31bf98cbf9ff143c1ae578b87274ae1a3" - integrity sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg== +"@babel/helper-annotate-as-pure@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" + integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== dependencies: - "@babel/helper-explode-assignable-expression" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz#cb470c76198db6a24e9dbc8987275631e5d29831" - integrity sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.12.13.tgz#6bc20361c88b0a74d05137a65cac8d3cbf6f61fc" + integrity sha512-CZOv9tGphhDRlVjVkAgm8Nhklm9RzSmWpX2my+t7Ua/KT616pEzXsQCjinzvkRvHWJ9itO4f296efroX23XCMA== dependencies: - "@babel/compat-data" "^7.12.5" - "@babel/helper-validator-option" "^7.12.1" + "@babel/helper-explode-assignable-expression" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/helper-compilation-targets@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.13.tgz#d689cdef88810aa74e15a7a94186f26a3d773c98" + integrity sha512-dXof20y/6wB5HnLOGyLh/gobsMvDNoekcC+8MCV2iaTd5JemhFkPD73QB+tK3iFC9P0xJC73B6MvKkyUfS9cCw== + dependencies: + "@babel/compat-data" "^7.12.13" + "@babel/helper-validator-option" "^7.12.11" browserslist "^4.14.5" semver "^5.5.0" -"@babel/helper-create-class-features-plugin@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz#3c45998f431edd4a9214c5f1d3ad1448a6137f6e" - integrity sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w== +"@babel/helper-create-class-features-plugin@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.13.tgz#0f1707c2eec1a4604f2a22a6fb209854ef2a399a" + integrity sha512-Vs/e9wv7rakKYeywsmEBSRC9KtmE7Px+YBlESekLeJOF0zbGUicGfXSNi3o+tfXSNS48U/7K9mIOOCR79Cl3+Q== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-member-expression-to-functions" "^7.12.13" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" -"@babel/helper-create-regexp-features-plugin@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.1.tgz#18b1302d4677f9dc4740fe8c9ed96680e29d37e8" - integrity sha512-rsZ4LGvFTZnzdNZR5HZdmJVuXK8834R5QkF3WvcnBhrlVtF0HSIUC6zbreL9MgjTywhKokn8RIYRiq99+DLAxA== +"@babel/helper-create-regexp-features-plugin@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.13.tgz#0996d370a92896c612ae41a4215544bd152579c0" + integrity sha512-XC+kiA0J3at6E85dL5UnCYfVOcIZ834QcAY0TIpgUVnz0zDzg+0TtvZTnJ4g9L1dPRGe30Qi03XCIS4tYCLtqw== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-regex" "^7.10.4" + "@babel/helper-annotate-as-pure" "^7.12.13" regexpu-core "^4.7.1" -"@babel/helper-define-map@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.10.4.tgz#f037ad794264f729eda1889f4ee210b870999092" - integrity sha512-nIij0oKErfCnLUCWaCaHW0Bmtl2RO9cN7+u2QT8yqTywgALKlyUVOvHDElh+b5DwVC6YB1FOYFOTWcN/+41EDA== +"@babel/helper-explode-assignable-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.13.tgz#0e46990da9e271502f77507efa4c9918d3d8634a" + integrity sha512-5loeRNvMo9mx1dA/d6yNi+YiKziJZFylZnCo1nmFF4qPU4yJ14abhWESuSMQSlQxWdxdOFzxXjk/PpfudTtYyw== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/types" "^7.10.4" - lodash "^4.17.13" - -"@babel/helper-explode-assignable-expression@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz#40a1cd917bff1288f699a94a75b37a1a2dbd8c7c" - integrity sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A== - dependencies: - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" "@babel/helper-function-name@^7.10.4": version "7.10.4" @@ -129,6 +134,15 @@ "@babel/template" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/helper-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" + integrity sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA== + dependencies: + "@babel/helper-get-function-arity" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/types" "^7.12.13" + "@babel/helper-get-function-arity@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" @@ -136,12 +150,19 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-hoist-variables@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" - integrity sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA== +"@babel/helper-get-function-arity@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" + integrity sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg== dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" + +"@babel/helper-hoist-variables@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.12.13.tgz#13aba58b7480b502362316ea02f52cca0e9796cd" + integrity sha512-KSC5XSj5HreRhYQtZ3cnSnQwDzgnbdUDEFsxkN0m6Q3WrCRt72xrnZ8+h+pX7YxM7hr87zIO3a/v5p/H3TrnVw== + dependencies: + "@babel/types" "^7.12.13" "@babel/helper-member-expression-to-functions@^7.12.1": version "7.12.1" @@ -150,12 +171,19 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz#1bfc0229f794988f76ed0a4d4e90860850b54dfb" - integrity sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA== +"@babel/helper-member-expression-to-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.13.tgz#c5715695b4f8bab32660dbdcdc2341dec7e3df40" + integrity sha512-B+7nN0gIL8FZ8SvMcF+EPyB21KnCcZHQZFczCxbiNGV/O0rsrSBlWGLzmtBJ3GMjSVMIm4lpFhR+VdVBuIsUcQ== dependencies: - "@babel/types" "^7.12.5" + "@babel/types" "^7.12.13" + +"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz#ec67e4404f41750463e455cc3203f6a32e93fcb0" + integrity sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g== + dependencies: + "@babel/types" "^7.12.13" "@babel/helper-module-transforms@^7.12.1": version "7.12.1" @@ -172,6 +200,21 @@ "@babel/types" "^7.12.1" lodash "^4.17.19" +"@babel/helper-module-transforms@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz#01afb052dcad2044289b7b20beb3fa8bd0265bea" + integrity sha512-acKF7EjqOR67ASIlDTupwkKM1eUisNAjaSduo5Cz+793ikfnpe7p4Q7B7EWU2PCoSTPWsQkR7hRUWEIZPiVLGA== + dependencies: + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" + "@babel/helper-simple-access" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/helper-validator-identifier" "^7.12.11" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.12.13" + "@babel/types" "^7.12.13" + lodash "^4.17.19" + "@babel/helper-optimise-call-expression@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" @@ -179,26 +222,26 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== - -"@babel/helper-regex@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.10.4.tgz#59b373daaf3458e5747dece71bbaf45f9676af6d" - integrity sha512-inWpnHGgtg5NOF0eyHlC0/74/VkdRITY9dtTpB2PrxKKn+AkVMRiZz/Adrx+Ssg+MLDesi2zohBW6MVq6b4pOQ== +"@babel/helper-optimise-call-expression@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" + integrity sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA== dependencies: - lodash "^4.17.13" + "@babel/types" "^7.12.13" -"@babel/helper-remap-async-to-generator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.1.tgz#8c4dbbf916314f6047dc05e6a2217074238347fd" - integrity sha512-9d0KQCRM8clMPcDwo8SevNs+/9a8yWVVmaE80FGJcEP8N1qToREmWEGnBn8BUlJhYRFz6fqxeRL1sl5Ogsed7A== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.12.13.tgz#174254d0f2424d8aefb4dd48057511247b0a9eeb" + integrity sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA== + +"@babel/helper-remap-async-to-generator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.13.tgz#170365f4140e2d20e5c88f8ba23c24468c296878" + integrity sha512-Qa6PU9vNcj1NZacZZI1Mvwt+gXDH6CTfgAkSjeRMLE8HxtDK76+YDId6NQR+z7Rgd5arhD2cIbS74r0SxD6PDA== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-wrap-function" "^7.10.4" - "@babel/types" "^7.12.1" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-wrap-function" "^7.12.13" + "@babel/types" "^7.12.13" "@babel/helper-replace-supers@^7.12.1": version "7.12.1" @@ -210,6 +253,16 @@ "@babel/traverse" "^7.12.1" "@babel/types" "^7.12.1" +"@babel/helper-replace-supers@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz#00ec4fb6862546bd3d0aff9aac56074277173121" + integrity sha512-pctAOIAMVStI2TMLhozPKbf5yTEXc0OJa0eENheb4w09SrgOWEs+P4nTOZYJQCqs8JlErGLDPDJTiGIp3ygbLg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.12.13" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.12.13" + "@babel/types" "^7.12.13" + "@babel/helper-simple-access@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz#32427e5aa61547d38eb1e6eaf5fd1426fdad9136" @@ -217,6 +270,13 @@ dependencies: "@babel/types" "^7.12.1" +"@babel/helper-simple-access@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz#8478bcc5cacf6aa1672b251c1d2dde5ccd61a6c4" + integrity sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-skip-transparent-expression-wrappers@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.12.1.tgz#462dc63a7e435ade8468385c63d2b84cce4b3cbf" @@ -224,13 +284,6 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-split-export-declaration@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz#2c70576eaa3b5609b24cb99db2888cc3fc4251d1" - integrity sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg== - dependencies: - "@babel/types" "^7.10.4" - "@babel/helper-split-export-declaration@^7.11.0": version "7.11.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" @@ -238,25 +291,32 @@ dependencies: "@babel/types" "^7.11.0" +"@babel/helper-split-export-declaration@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" + integrity sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg== + dependencies: + "@babel/types" "^7.12.13" + "@babel/helper-validator-identifier@^7.10.4", "@babel/helper-validator-identifier@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== -"@babel/helper-validator-option@^7.12.1", "@babel/helper-validator-option@^7.12.11": +"@babel/helper-validator-option@^7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz#d66cb8b7a3e7fe4c6962b32020a131ecf0847f4f" integrity sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw== -"@babel/helper-wrap-function@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz#8a6f701eab0ff39f765b5a1cfef409990e624b87" - integrity sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug== +"@babel/helper-wrap-function@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.12.13.tgz#e3ea8cb3ee0a16911f9c1b50d9e99fe8fe30f9ff" + integrity sha512-t0aZFEmBJ1LojdtJnhOaQEVejnzYhyjWHSsNSNo8vOYRbAJNh6r6GQF7pd36SqG7OKGbn+AewVQ/0IfYfIuGdw== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/helper-function-name" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.12.13" + "@babel/types" "^7.12.13" "@babel/helpers@^7.12.5": version "7.12.5" @@ -276,27 +336,41 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.12.13.tgz#8ab538393e00370b26271b01fa08f7f27f2e795c" + integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@7.12.11", "@babel/parser@^7.1.0", "@babel/parser@^7.12.10", "@babel/parser@^7.12.7", "@babel/parser@^7.7.0": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== -"@babel/plugin-proposal-async-generator-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.1.tgz#dc6c1170e27d8aca99ff65f4925bd06b1c90550e" - integrity sha512-d+/o30tJxFxrA1lhzJqiUcEJdI6jKlNregCv5bASeGf2Q4MXmnwH7viDo7nhx1/ohf09oaH8j1GVYG/e3Yqk6A== +"@babel/parser@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.13.tgz#3ee7be4131fe657ba9143d5c5b3a9f253fdb75e9" + integrity sha512-z7n7ybOUzaRc3wwqLpAX8UFIXsrVXUJhtNGBwAnLz6d1KUapqyq7ad2La8gZ6CXhHmGAIL32cop8Tst4/PNWLw== + +"@babel/plugin-proposal-async-generator-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.13.tgz#d1c6d841802ffb88c64a2413e311f7345b9e66b5" + integrity sha512-1KH46Hx4WqP77f978+5Ye/VUbuwQld2hph70yaw2hXS2v7ER2f3nlpNMu909HO2rbvP0NKLlMVDPh9KXklVMhA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.12.1" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-remap-async-to-generator" "^7.12.13" "@babel/plugin-syntax-async-generators" "^7.8.0" -"@babel/plugin-proposal-class-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.1.tgz#a082ff541f2a29a4821065b8add9346c0c16e5de" - integrity sha512-cKp3dlQsFsEs5CWKnN7BnSHOd0EOW8EKpEjkoz1pO2E5KzIDNV9Ros1b0CnmbVgAGXJubOYVBOGCT1OmJwOI7w== +"@babel/plugin-proposal-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.13.tgz#3d2ce350367058033c93c098e348161d6dc0d8c8" + integrity sha512-8SCJ0Ddrpwv4T7Gwb33EmW1V9PY5lggTO+A8WjyIwxrSHDUyBw4MtF96ifn1n8H806YlxbVCoKXbbmzD6RD+cA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-proposal-dynamic-import@^7.12.1": version "7.12.1" @@ -306,87 +380,87 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-dynamic-import" "^7.8.0" -"@babel/plugin-proposal-export-namespace-from@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.1.tgz#8b9b8f376b2d88f5dd774e4d24a5cc2e3679b6d4" - integrity sha512-6CThGf0irEkzujYS5LQcjBx8j/4aQGiVv7J9+2f7pGfxqyKh3WnmVJYW3hdrQjyksErMGBPQrCnHfOtna+WLbw== +"@babel/plugin-proposal-export-namespace-from@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.12.13.tgz#393be47a4acd03fa2af6e3cde9b06e33de1b446d" + integrity sha512-INAgtFo4OnLN3Y/j0VwAgw3HDXcDtX+C/erMvWzuV9v71r7urb6iyMXu7eM9IgLr1ElLlOkaHjJ0SbCmdOQ3Iw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.1.tgz#d45423b517714eedd5621a9dfdc03fa9f4eb241c" - integrity sha512-GoLDUi6U9ZLzlSda2Df++VSqDJg3CG+dR0+iWsv6XRw1rEq+zwt4DirM9yrxW6XWaTpmai1cWJLMfM8qQJf+yw== +"@babel/plugin-proposal-json-strings@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.13.tgz#ced7888a2db92a3d520a2e35eb421fdb7fcc9b5d" + integrity sha512-v9eEi4GiORDg8x+Dmi5r8ibOe0VXoKDeNPYcTTxdGN4eOWikrJfDJCJrr1l5gKGvsNyGJbrfMftC2dTL6oz7pg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-json-strings" "^7.8.0" -"@babel/plugin-proposal-logical-assignment-operators@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.1.tgz#f2c490d36e1b3c9659241034a5d2cd50263a2751" - integrity sha512-k8ZmVv0JU+4gcUGeCDZOGd0lCIamU/sMtIiX3UWnUc5yzgq6YUGyEolNYD+MLYKfSzgECPcqetVcJP9Afe/aCA== +"@babel/plugin-proposal-logical-assignment-operators@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.13.tgz#575b5d9a08d8299eeb4db6430da6e16e5cf14350" + integrity sha512-fqmiD3Lz7jVdK6kabeSr1PZlWSUVqSitmHEe3Z00dtGTKieWnX9beafvavc32kjORa5Bai4QNHgFDwWJP+WtSQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.1.tgz#3ed4fff31c015e7f3f1467f190dbe545cd7b046c" - integrity sha512-nZY0ESiaQDI1y96+jk6VxMOaL4LPo/QDHBqL+SF3/vl6dHkTwHlOI8L4ZwuRBHgakRBw5zsVylel7QPbbGuYgg== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.13.tgz#24867307285cee4e1031170efd8a7ac807deefde" + integrity sha512-Qoxpy+OxhDBI5kRqliJFAl4uWXk3Bn24WeFstPH0iLymFehSAUR8MHpqU7njyXv/qbo7oN6yTy5bfCmXdKpo1Q== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-numeric-separator@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz#8bf253de8139099fea193b297d23a9d406ef056b" - integrity sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ== +"@babel/plugin-proposal-numeric-separator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.13.tgz#bd9da3188e787b5120b4f9d465a8261ce67ed1db" + integrity sha512-O1jFia9R8BUCl3ZGB7eitaAPu62TXJRHn7rh+ojNERCFyqRwJMTmhz+tJ+k0CwI6CLjX/ee4qW74FSqlq9I35w== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.1.tgz#def9bd03cea0f9b72283dac0ec22d289c7691069" - integrity sha512-s6SowJIjzlhx8o7lsFx5zmY4At6CTtDvgNQDdPzkBQucle58A6b/TTeEBYtyDgmcXjUTM+vE8YOGHZzzbc/ioA== +"@babel/plugin-proposal-object-rest-spread@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.13.tgz#f93f3116381ff94bc676fdcb29d71045cd1ec011" + integrity sha512-WvA1okB/0OS/N3Ldb3sziSrXg6sRphsBgqiccfcQq7woEn5wQLNX82Oc4PlaFcdwcWHuQXAtb8ftbS8Fbsg/sg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.13" -"@babel/plugin-proposal-optional-catch-binding@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.1.tgz#ccc2421af64d3aae50b558a71cede929a5ab2942" - integrity sha512-hFvIjgprh9mMw5v42sJWLI1lzU5L2sznP805zeT6rySVRA0Y18StRhDqhSxlap0oVgItRsB6WSROp4YnJTJz0g== +"@babel/plugin-proposal-optional-catch-binding@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.13.tgz#4640520afe57728af14b4d1574ba844f263bcae5" + integrity sha512-9+MIm6msl9sHWg58NvqpNpLtuFbmpFYk37x8kgnGzAHvX35E1FyAwSUt5hIkSoWJFSAH+iwU8bJ4fcD1zKXOzg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz#e02f0ea1b5dc59d401ec16fb824679f683d3303c" - integrity sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA== +"@babel/plugin-proposal-optional-chaining@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.13.tgz#63a7d805bc8ce626f3234ee5421a2a7fb23f66d9" + integrity sha512-0ZwjGfTcnZqyV3y9DSD1Yk3ebp+sIUpT2YDqP8hovzaNZnQq2Kd7PEqa6iOIUDBXBt7Jl3P7YAcEIL5Pz8u09Q== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-proposal-private-methods@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.1.tgz#86814f6e7a21374c980c10d38b4493e703f4a389" - integrity sha512-mwZ1phvH7/NHK6Kf8LP7MYDogGV+DKB1mryFOEwx5EBNQrosvIczzZFTUmWaeujd5xT6G1ELYWUz3CutMhjE1w== +"@babel/plugin-proposal-private-methods@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.13.tgz#ea78a12554d784ecf7fc55950b752d469d9c4a71" + integrity sha512-sV0V57uUwpauixvR7s2o75LmwJI6JECwm5oPUY5beZB1nBl2i37hc7CJGqB5G+58fur5Y6ugvl3LRONk5x34rg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-proposal-unicode-property-regex@^7.12.1", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.1.tgz#2a183958d417765b9eae334f47758e5d6a82e072" - integrity sha512-MYq+l+PvHuw/rKUz1at/vb6nCnQ2gmJBNaM62z0OgH7B2W1D9pvkpYtlti9bGtizNIU1K3zm4bZF9F91efVY0w== +"@babel/plugin-proposal-unicode-property-regex@^7.12.13", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.12.13.tgz#bebde51339be829c17aaaaced18641deb62b39ba" + integrity sha512-XyJmZidNfofEkqFV5VC/bLabGmO5QzenPO/YOfGuEbgU+2sSwMmio3YLb4WtBgcmmdwZHyVyv8on77IUjQ5Gvg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-async-generators@^7.8.0", "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -402,12 +476,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.12.1", "@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz#bcb297c5366e79bebadef509549cd93b04f19978" - integrity sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA== +"@babel/plugin-syntax-class-properties@^7.12.13", "@babel/plugin-syntax-class-properties@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-dynamic-import@^7.8.0": version "7.8.3" @@ -479,287 +553,286 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.12.1", "@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz#dd6c0b357ac1bb142d98537450a319625d13d2a0" - integrity sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A== +"@babel/plugin-syntax-top-level-await@^7.12.13", "@babel/plugin-syntax-top-level-await@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.13.tgz#c5f0fa6e249f5b739727f923540cf7a806130178" + integrity sha512-A81F9pDwyS7yM//KwbCSDqy3Uj4NMIurtplxphWxoYtNPov7cJsDkAFNNyVlIZ3jwGycVsurZ+LtOA8gZ376iQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-arrow-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.1.tgz#8083ffc86ac8e777fbe24b5967c4b2521f3cb2b3" - integrity sha512-5QB50qyN44fzzz4/qxDPQMBCTHgxg3n0xRBLJUmBlLoU/sFvxVWGZF/ZUfMVDQuJUKXaBhbupxIzIfZ6Fwk/0A== +"@babel/plugin-transform-arrow-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.13.tgz#eda5670b282952100c229f8a3bd49e0f6a72e9fe" + integrity sha512-tBtuN6qtCTd+iHzVZVOMNp+L04iIJBpqkdY42tWbmjIT5wvR2kx7gxMBsyhQtFzHwBbyGi9h8J8r9HgnOpQHxg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-async-to-generator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.1.tgz#3849a49cc2a22e9743cbd6b52926d30337229af1" - integrity sha512-SDtqoEcarK1DFlRJ1hHRY5HvJUj5kX4qmtpMAm2QnhOlyuMC4TMdCRgW6WXpv93rZeYNeLP22y8Aq2dbcDRM1A== +"@babel/plugin-transform-async-to-generator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.13.tgz#fed8c69eebf187a535bfa4ee97a614009b24f7ae" + integrity sha512-psM9QHcHaDr+HZpRuJcE1PXESuGWSCcbiGFFhhwfzdbTxaGDVzuVtdNYliAwcRo3GFg0Bc8MmI+AvIGYIJG04A== dependencies: - "@babel/helper-module-imports" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.12.1" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-remap-async-to-generator" "^7.12.13" -"@babel/plugin-transform-block-scoped-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.1.tgz#f2a1a365bde2b7112e0a6ded9067fdd7c07905d9" - integrity sha512-5OpxfuYnSgPalRpo8EWGPzIYf0lHBWORCkj5M0oLBwHdlux9Ri36QqGW3/LR13RSVOAoUUMzoPI/jpE4ABcHoA== +"@babel/plugin-transform-block-scoped-functions@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.12.13.tgz#a9bf1836f2a39b4eb6cf09967739de29ea4bf4c4" + integrity sha512-zNyFqbc3kI/fVpqwfqkg6RvBgFpC4J18aKKMmv7KdQ/1GgREapSJAykLMVNwfRGO3BtHj3YQZl8kxCXPcVMVeg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-block-scoping@^7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.11.tgz#83ae92a104dbb93a7d6c6dd1844f351083c46b4f" - integrity sha512-atR1Rxc3hM+VPg/NvNvfYw0npQEAcHuJ+MGZnFn6h3bo+1U3BWXMdFMlvVRApBTWKQMX7SOwRJZA5FBF/JQbvA== +"@babel/plugin-transform-block-scoping@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.13.tgz#f36e55076d06f41dfd78557ea039c1b581642e61" + integrity sha512-Pxwe0iqWJX4fOOM2kEZeUuAxHMWb9nK+9oh5d11bsLoB0xMg+mkDpt0eYuDZB7ETrY9bbcVlKUGTOGWy7BHsMQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-classes@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.1.tgz#65e650fcaddd3d88ddce67c0f834a3d436a32db6" - integrity sha512-/74xkA7bVdzQTBeSUhLLJgYIcxw/dpEpCdRDiHgPJ3Mv6uC11UhjpOhl72CgqbBCmt1qtssCyB2xnJm1+PFjog== +"@babel/plugin-transform-classes@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.13.tgz#9728edc1838b5d62fc93ad830bd523b1fcb0e1f6" + integrity sha512-cqZlMlhCC1rVnxE5ZGMtIb896ijL90xppMiuWXcwcOAuFczynpd3KYemb91XFFPi3wJSe/OcrX9lXoowatkkxA== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-define-map" "^7.10.4" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.1.tgz#d68cf6c9b7f838a8a4144badbe97541ea0904852" - integrity sha512-vVUOYpPWB7BkgUWPo4C44mUQHpTZXakEqFjbv8rQMg7TC6S6ZhGZ3otQcRH6u7+adSlE5i0sp63eMC/XGffrzg== +"@babel/plugin-transform-computed-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.13.tgz#6a210647a3d67f21f699cfd2a01333803b27339d" + integrity sha512-dDfuROUPGK1mTtLKyDPUavmj2b6kFu82SmgpztBFEO974KMjJT+Ytj3/oWsTUMBmgPcp9J5Pc1SlcAYRpJ2hRA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-destructuring@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.1.tgz#b9a570fe0d0a8d460116413cb4f97e8e08b2f847" - integrity sha512-fRMYFKuzi/rSiYb2uRLiUENJOKq4Gnl+6qOv5f8z0TZXg3llUwUhsNNwrwaT/6dUhJTzNpBr+CUvEWBtfNY1cw== +"@babel/plugin-transform-destructuring@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.13.tgz#fc56c5176940c5b41735c677124d1d20cecc9aeb" + integrity sha512-Dn83KykIFzjhA3FDPA1z4N+yfF3btDGhjnJwxIj0T43tP0flCujnU8fKgEkf0C1biIpSv9NZegPBQ1J6jYkwvQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-dotall-regex@^7.12.1", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.1.tgz#a1d16c14862817b6409c0a678d6f9373ca9cd975" - integrity sha512-B2pXeRKoLszfEW7J4Hg9LoFaWEbr/kzo3teWHmtFCszjRNa/b40f9mfeqZsIDLLt/FjwQ6pz/Gdlwy85xNckBA== +"@babel/plugin-transform-dotall-regex@^7.12.13", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.12.13.tgz#3f1601cc29905bfcb67f53910f197aeafebb25ad" + integrity sha512-foDrozE65ZFdUC2OfgeOCrEPTxdB3yjqxpXh8CH+ipd9CHd4s/iq81kcUpyH8ACGNEPdFqbtzfgzbT/ZGlbDeQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-duplicate-keys@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.1.tgz#745661baba295ac06e686822797a69fbaa2ca228" - integrity sha512-iRght0T0HztAb/CazveUpUQrZY+aGKKaWXMJ4uf9YJtqxSUe09j3wteztCUDRHs+SRAL7yMuFqUsLoAKKzgXjw== +"@babel/plugin-transform-duplicate-keys@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.12.13.tgz#6f06b87a8b803fd928e54b81c258f0a0033904de" + integrity sha512-NfADJiiHdhLBW3pulJlJI2NB0t4cci4WTZ8FtdIuNc2+8pslXdPtRRAEWqUY+m9kNOk2eRYbTAOipAxlrOcwwQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-exponentiation-operator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.1.tgz#b0f2ed356ba1be1428ecaf128ff8a24f02830ae0" - integrity sha512-7tqwy2bv48q+c1EHbXK0Zx3KXd2RVQp6OC7PbwFNt/dPTAV3Lu5sWtWuAj8owr5wqtWnqHfl2/mJlUmqkChKug== +"@babel/plugin-transform-exponentiation-operator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.12.13.tgz#4d52390b9a273e651e4aba6aee49ef40e80cd0a1" + integrity sha512-fbUelkM1apvqez/yYx1/oICVnGo2KM5s63mhGylrmXUxK/IAXSIf87QIxVfZldWf4QsOafY6vV3bX8aMHSvNrA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-for-of@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.1.tgz#07640f28867ed16f9511c99c888291f560921cfa" - integrity sha512-Zaeq10naAsuHo7heQvyV0ptj4dlZJwZgNAtBYBnu5nNKJoW62m0zKcIEyVECrUKErkUkg6ajMy4ZfnVZciSBhg== +"@babel/plugin-transform-for-of@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.13.tgz#561ff6d74d9e1c8879cb12dbaf4a14cd29d15cf6" + integrity sha512-xCbdgSzXYmHGyVX3+BsQjcd4hv4vA/FDy7Kc8eOpzKmBBPEOTurt0w5fCRQaGl+GSBORKgJdstQ1rHl4jbNseQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-function-name@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.1.tgz#2ec76258c70fe08c6d7da154003a480620eba667" - integrity sha512-JF3UgJUILoFrFMEnOJLJkRHSk6LUSXLmEFsA23aR2O5CSLUxbeUX1IZ1YQ7Sn0aXb601Ncwjx73a+FVqgcljVw== +"@babel/plugin-transform-function-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.12.13.tgz#bb024452f9aaed861d374c8e7a24252ce3a50051" + integrity sha512-6K7gZycG0cmIwwF7uMK/ZqeCikCGVBdyP2J5SKNCXO5EOHcqi+z7Jwf8AmyDNcBgxET8DrEtCt/mPKPyAzXyqQ== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.1.tgz#d73b803a26b37017ddf9d3bb8f4dc58bfb806f57" - integrity sha512-+PxVGA+2Ag6uGgL0A5f+9rklOnnMccwEBzwYFL3EUaKuiyVnUipyXncFcfjSkbimLrODoqki1U9XxZzTvfN7IQ== +"@babel/plugin-transform-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.12.13.tgz#2ca45bafe4a820197cf315794a4d26560fe4bdb9" + integrity sha512-FW+WPjSR7hiUxMcKqyNjP05tQ2kmBCdpEpZHY1ARm96tGQCCBvXKnpjILtDplUnJ/eHZ0lALLM+d2lMFSpYJrQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-member-expression-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.1.tgz#496038602daf1514a64d43d8e17cbb2755e0c3ad" - integrity sha512-1sxePl6z9ad0gFMB9KqmYofk34flq62aqMt9NqliS/7hPEpURUCMbyHXrMPlo282iY7nAvUB1aQd5mg79UD9Jg== +"@babel/plugin-transform-member-expression-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.12.13.tgz#5ffa66cd59b9e191314c9f1f803b938e8c081e40" + integrity sha512-kxLkOsg8yir4YeEPHLuO2tXP9R/gTjpuTOjshqSpELUN3ZAg2jfDnKUvzzJxObun38sw3wm4Uu69sX/zA7iRvg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-modules-amd@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.1.tgz#3154300b026185666eebb0c0ed7f8415fefcf6f9" - integrity sha512-tDW8hMkzad5oDtzsB70HIQQRBiTKrhfgwC/KkJeGsaNFTdWhKNt/BiE8c5yj19XiGyrxpbkOfH87qkNg1YGlOQ== +"@babel/plugin-transform-modules-amd@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.13.tgz#43db16249b274ee2e551e2422090aa1c47692d56" + integrity sha512-JHLOU0o81m5UqG0Ulz/fPC68/v+UTuGTWaZBUwpEk1fYQ1D9LfKV6MPn4ttJKqRo5Lm460fkzjLTL4EHvCprvA== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.1.tgz#fa403124542636c786cf9b460a0ffbb48a86e648" - integrity sha512-dY789wq6l0uLY8py9c1B48V8mVL5gZh/+PQ5ZPrylPYsnAvnEMjqsUXkuoDVPeVK+0VyGar+D08107LzDQ6pag== +"@babel/plugin-transform-modules-commonjs@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.13.tgz#5043b870a784a8421fa1fd9136a24f294da13e50" + integrity sha512-OGQoeVXVi1259HjuoDnsQMlMkT9UkZT9TpXAsqWplS/M0N1g3TJAn/ByOCeQu7mfjc5WpSsRU+jV1Hd89ts0kQ== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-simple-access" "^7.12.1" + "@babel/helper-module-transforms" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-simple-access" "^7.12.13" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.1.tgz#663fea620d593c93f214a464cd399bf6dc683086" - integrity sha512-Hn7cVvOavVh8yvW6fLwveFqSnd7rbQN3zJvoPNyNaQSvgfKmDBO9U1YL9+PCXGRlZD9tNdWTy5ACKqMuzyn32Q== +"@babel/plugin-transform-modules-systemjs@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.13.tgz#351937f392c7f07493fc79b2118201d50404a3c5" + integrity sha512-aHfVjhZ8QekaNF/5aNdStCGzwTbU7SI5hUybBKlMzqIMC7w7Ho8hx5a4R/DkTHfRfLwHGGxSpFt9BfxKCoXKoA== dependencies: - "@babel/helper-hoist-variables" "^7.10.4" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-validator-identifier" "^7.10.4" + "@babel/helper-hoist-variables" "^7.12.13" + "@babel/helper-module-transforms" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-validator-identifier" "^7.12.11" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.1.tgz#eb5a218d6b1c68f3d6217b8fa2cc82fec6547902" - integrity sha512-aEIubCS0KHKM0zUos5fIoQm+AZUMt1ZvMpqz0/H5qAQ7vWylr9+PLYurT+Ic7ID/bKLd4q8hDovaG3Zch2uz5Q== +"@babel/plugin-transform-modules-umd@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.13.tgz#26c66f161d3456674e344b4b1255de4d530cfb37" + integrity sha512-BgZndyABRML4z6ibpi7Z98m4EVLFI9tVsZDADC14AElFaNHHBcJIovflJ6wtCqFxwy2YJ1tJhGRsr0yLPKoN+w== dependencies: - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-named-capturing-groups-regex@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.1.tgz#b407f5c96be0d9f5f88467497fa82b30ac3e8753" - integrity sha512-tB43uQ62RHcoDp9v2Nsf+dSM8sbNodbEicbQNA53zHz8pWUhsgHSJCGpt7daXxRydjb0KnfmB+ChXOv3oADp1Q== +"@babel/plugin-transform-named-capturing-groups-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.12.13.tgz#2213725a5f5bbbe364b50c3ba5998c9599c5c9d9" + integrity sha512-Xsm8P2hr5hAxyYblrfACXpQKdQbx4m2df9/ZZSQ8MAhsadw06+jW7s9zsSw6he+mJZXRlVMyEnVktJo4zjk1WA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" -"@babel/plugin-transform-new-target@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.1.tgz#80073f02ee1bb2d365c3416490e085c95759dec0" - integrity sha512-+eW/VLcUL5L9IvJH7rT1sT0CzkdUTvPrXC2PXTn/7z7tXLBuKvezYbGdxD5WMRoyvyaujOq2fWoKl869heKjhw== +"@babel/plugin-transform-new-target@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.12.13.tgz#e22d8c3af24b150dd528cbd6e685e799bf1c351c" + integrity sha512-/KY2hbLxrG5GTQ9zzZSc3xWiOy379pIETEhbtzwZcw9rvuaVV4Fqy7BYGYOWZnaoXIQYbbJ0ziXLa/sKcGCYEQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-object-super@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.1.tgz#4ea08696b8d2e65841d0c7706482b048bed1066e" - integrity sha512-AvypiGJH9hsquNUn+RXVcBdeE3KHPZexWRdimhuV59cSoOt5kFBmqlByorAeUlGG2CJWd0U+4ZtNKga/TB0cAw== +"@babel/plugin-transform-object-super@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.12.13.tgz#b4416a2d63b8f7be314f3d349bd55a9c1b5171f7" + integrity sha512-JzYIcj3XtYspZDV8j9ulnoMPZZnF/Cj0LUxPOjR89BdBVx+zYJI9MdMIlUZjbXDX+6YVeS6I3e8op+qQ3BYBoQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-replace-supers" "^7.12.1" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.1.tgz#d2e963b038771650c922eff593799c96d853255d" - integrity sha512-xq9C5EQhdPK23ZeCdMxl8bbRnAgHFrw5EOC3KJUsSylZqdkCaFEXxGSBuTSObOpiiHHNyb82es8M1QYgfQGfNg== +"@babel/plugin-transform-parameters@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.13.tgz#461e76dfb63c2dfd327b8a008a9e802818ce9853" + integrity sha512-e7QqwZalNiBRHCpJg/P8s/VJeSRYgmtWySs1JwvfwPqhBbiWfOcHDKdeAi6oAyIimoKWBlwc8oTgbZHdhCoVZA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-property-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.1.tgz#41bc81200d730abb4456ab8b3fbd5537b59adecd" - integrity sha512-6MTCR/mZ1MQS+AwZLplX4cEySjCpnIF26ToWo942nqn8hXSm7McaHQNeGx/pt7suI1TWOWMfa/NgBhiqSnX0cQ== +"@babel/plugin-transform-property-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.12.13.tgz#4e6a9e37864d8f1b3bc0e2dce7bf8857db8b1a81" + integrity sha512-nqVigwVan+lR+g8Fj8Exl0UQX2kymtjcWfMOYM1vTYEKujeyv2SkMgazf2qNcK7l4SDiKyTA/nHCPqL4e2zo1A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-regenerator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.1.tgz#5f0a28d842f6462281f06a964e88ba8d7ab49753" - integrity sha512-gYrHqs5itw6i4PflFX3OdBPMQdPbF4bj2REIUxlMRUFk0/ZOAIpDFuViuxPjUL7YC8UPnf+XG7/utJvqXdPKng== +"@babel/plugin-transform-regenerator@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.12.13.tgz#b628bcc9c85260ac1aeb05b45bde25210194a2f5" + integrity sha512-lxb2ZAvSLyJ2PEe47hoGWPmW22v7CtSl9jW8mingV4H2sEX/JOcrAj2nPuGWi56ERUm2bUpjKzONAuT6HCn2EA== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.1.tgz#6fdfc8cc7edcc42b36a7c12188c6787c873adcd8" - integrity sha512-pOnUfhyPKvZpVyBHhSBoX8vfA09b7r00Pmm1sH+29ae2hMTKVmSp4Ztsr8KBKjLjx17H0eJqaRC3bR2iThM54A== +"@babel/plugin-transform-reserved-words@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.12.13.tgz#7d9988d4f06e0fe697ea1d9803188aa18b472695" + integrity sha512-xhUPzDXxZN1QfiOy/I5tyye+TRz6lA7z6xaT4CLOjPRMVg1ldRf0LHw0TDBpYL4vG78556WuHdyO9oi5UmzZBg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-shorthand-properties@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.1.tgz#0bf9cac5550fce0cfdf043420f661d645fdc75e3" - integrity sha512-GFZS3c/MhX1OusqB1MZ1ct2xRzX5ppQh2JU1h2Pnfk88HtFTM+TWQqJNfwkmxtPQtb/s1tk87oENfXJlx7rSDw== +"@babel/plugin-transform-shorthand-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.12.13.tgz#db755732b70c539d504c6390d9ce90fe64aff7ad" + integrity sha512-xpL49pqPnLtf0tVluuqvzWIgLEhuPpZzvs2yabUHSKRNlN7ScYU7aMlmavOeyXJZKgZKQRBlh8rHbKiJDraTSw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-spread@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.1.tgz#527f9f311be4ec7fdc2b79bb89f7bf884b3e1e1e" - integrity sha512-vuLp8CP0BE18zVYjsEBZ5xoCecMK6LBMMxYzJnh01rxQRvhNhH1csMMmBfNo5tGpGO+NhdSNW2mzIvBu3K1fng== +"@babel/plugin-transform-spread@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.13.tgz#ca0d5645abbd560719c354451b849f14df4a7949" + integrity sha512-dUCrqPIowjqk5pXsx1zPftSq4sT0aCeZVAxhdgs3AMgyaDmoUT0G+5h3Dzja27t76aUEIJWlFgPJqJ/d4dbTtg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" -"@babel/plugin-transform-sticky-regex@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz#560224613ab23987453948ed21d0b0b193fa7fad" - integrity sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg== +"@babel/plugin-transform-sticky-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.13.tgz#760ffd936face73f860ae646fb86ee82f3d06d1f" + integrity sha512-Jc3JSaaWT8+fr7GRvQP02fKDsYk4K/lYwWq38r/UGfaxo89ajud321NH28KRQ7xy1Ybc0VUE5Pz8psjNNDUglg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-template-literals@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.1.tgz#b43ece6ed9a79c0c71119f576d299ef09d942843" - integrity sha512-b4Zx3KHi+taXB1dVRBhVJtEPi9h1THCeKmae2qP0YdUHIFhVjtpqqNfxeVAa1xeHVhAy4SbHxEwx5cltAu5apw== +"@babel/plugin-transform-template-literals@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.13.tgz#655037b07ebbddaf3b7752f55d15c2fd6f5aa865" + integrity sha512-arIKlWYUgmNsF28EyfmiQHJLJFlAJNYkuQO10jL46ggjBpeb2re1P9K9YGxNJB45BqTbaslVysXDYm/g3sN/Qg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-typeof-symbol@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.10.tgz#de01c4c8f96580bd00f183072b0d0ecdcf0dec4b" - integrity sha512-JQ6H8Rnsogh//ijxspCjc21YPd3VLVoYtAwv3zQmqAt8YGYUtdo5usNhdl4b9/Vir2kPFZl6n1h0PfUz4hJhaA== +"@babel/plugin-transform-typeof-symbol@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.13.tgz#785dd67a1f2ea579d9c2be722de8c84cb85f5a7f" + integrity sha512-eKv/LmUJpMnu4npgfvs3LiHhJua5fo/CysENxa45YCQXZwKnGCQKAg87bvoqSW1fFT+HA32l03Qxsm8ouTY3ZQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-unicode-escapes@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.1.tgz#5232b9f81ccb07070b7c3c36c67a1b78f1845709" - integrity sha512-I8gNHJLIc7GdApm7wkVnStWssPNbSRMPtgHdmH3sRM1zopz09UWPS4x5V4n1yz/MIWTVnJ9sp6IkuXdWM4w+2Q== +"@babel/plugin-transform-unicode-escapes@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.12.13.tgz#840ced3b816d3b5127dd1d12dcedc5dead1a5e74" + integrity sha512-0bHEkdwJ/sN/ikBHfSmOXPypN/beiGqjo+o4/5K+vxEFNPRPdImhviPakMKG4x96l85emoa0Z6cDflsdBusZbw== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-unicode-regex@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.1.tgz#cc9661f61390db5c65e3febaccefd5c6ac3faecb" - integrity sha512-SqH4ClNngh/zGwHZOOQMTD+e8FGWexILV+ePMyiDJttAWRh5dhDL8rcl5lSgU3Huiq6Zn6pWTMvdPAb21Dwdyg== +"@babel/plugin-transform-unicode-regex@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.12.13.tgz#b52521685804e155b1202e83fc188d34bb70f5ac" + integrity sha512-mDRzSNY7/zopwisPZ5kM9XKCfhchqIYwAKRERtEnhYscZB79VRekuRSoYbN0+KVe3y8+q1h6A4svXtP7N+UoCA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.12.1" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/preset-env@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.11.tgz#55d5f7981487365c93dbbc84507b1c7215e857f9" - integrity sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw== +"@babel/preset-env@7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.13.tgz#3aa2d09cf7d255177538dff292ac9af29ad46525" + integrity sha512-JUVlizG8SoFTz4LmVUL8++aVwzwxcvey3N0j1tRbMAXVEy95uQ/cnEkmEKHN00Bwq4voAV3imQGnQvpkLAxsrw== dependencies: - "@babel/compat-data" "^7.12.7" - "@babel/helper-compilation-targets" "^7.12.5" - "@babel/helper-module-imports" "^7.12.5" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/compat-data" "^7.12.13" + "@babel/helper-compilation-targets" "^7.12.13" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/helper-validator-option" "^7.12.11" - "@babel/plugin-proposal-async-generator-functions" "^7.12.1" - "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-async-generator-functions" "^7.12.13" + "@babel/plugin-proposal-class-properties" "^7.12.13" "@babel/plugin-proposal-dynamic-import" "^7.12.1" - "@babel/plugin-proposal-export-namespace-from" "^7.12.1" - "@babel/plugin-proposal-json-strings" "^7.12.1" - "@babel/plugin-proposal-logical-assignment-operators" "^7.12.1" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-numeric-separator" "^7.12.7" - "@babel/plugin-proposal-object-rest-spread" "^7.12.1" - "@babel/plugin-proposal-optional-catch-binding" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.7" - "@babel/plugin-proposal-private-methods" "^7.12.1" - "@babel/plugin-proposal-unicode-property-regex" "^7.12.1" + "@babel/plugin-proposal-export-namespace-from" "^7.12.13" + "@babel/plugin-proposal-json-strings" "^7.12.13" + "@babel/plugin-proposal-logical-assignment-operators" "^7.12.13" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.13" + "@babel/plugin-proposal-numeric-separator" "^7.12.13" + "@babel/plugin-proposal-object-rest-spread" "^7.12.13" + "@babel/plugin-proposal-optional-catch-binding" "^7.12.13" + "@babel/plugin-proposal-optional-chaining" "^7.12.13" + "@babel/plugin-proposal-private-methods" "^7.12.13" + "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" "@babel/plugin-syntax-async-generators" "^7.8.0" - "@babel/plugin-syntax-class-properties" "^7.12.1" + "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-dynamic-import" "^7.8.0" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" "@babel/plugin-syntax-json-strings" "^7.8.0" @@ -769,41 +842,41 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" "@babel/plugin-syntax-optional-chaining" "^7.8.0" - "@babel/plugin-syntax-top-level-await" "^7.12.1" - "@babel/plugin-transform-arrow-functions" "^7.12.1" - "@babel/plugin-transform-async-to-generator" "^7.12.1" - "@babel/plugin-transform-block-scoped-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.11" - "@babel/plugin-transform-classes" "^7.12.1" - "@babel/plugin-transform-computed-properties" "^7.12.1" - "@babel/plugin-transform-destructuring" "^7.12.1" - "@babel/plugin-transform-dotall-regex" "^7.12.1" - "@babel/plugin-transform-duplicate-keys" "^7.12.1" - "@babel/plugin-transform-exponentiation-operator" "^7.12.1" - "@babel/plugin-transform-for-of" "^7.12.1" - "@babel/plugin-transform-function-name" "^7.12.1" - "@babel/plugin-transform-literals" "^7.12.1" - "@babel/plugin-transform-member-expression-literals" "^7.12.1" - "@babel/plugin-transform-modules-amd" "^7.12.1" - "@babel/plugin-transform-modules-commonjs" "^7.12.1" - "@babel/plugin-transform-modules-systemjs" "^7.12.1" - "@babel/plugin-transform-modules-umd" "^7.12.1" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.1" - "@babel/plugin-transform-new-target" "^7.12.1" - "@babel/plugin-transform-object-super" "^7.12.1" - "@babel/plugin-transform-parameters" "^7.12.1" - "@babel/plugin-transform-property-literals" "^7.12.1" - "@babel/plugin-transform-regenerator" "^7.12.1" - "@babel/plugin-transform-reserved-words" "^7.12.1" - "@babel/plugin-transform-shorthand-properties" "^7.12.1" - "@babel/plugin-transform-spread" "^7.12.1" - "@babel/plugin-transform-sticky-regex" "^7.12.7" - "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/plugin-transform-typeof-symbol" "^7.12.10" - "@babel/plugin-transform-unicode-escapes" "^7.12.1" - "@babel/plugin-transform-unicode-regex" "^7.12.1" + "@babel/plugin-syntax-top-level-await" "^7.12.13" + "@babel/plugin-transform-arrow-functions" "^7.12.13" + "@babel/plugin-transform-async-to-generator" "^7.12.13" + "@babel/plugin-transform-block-scoped-functions" "^7.12.13" + "@babel/plugin-transform-block-scoping" "^7.12.13" + "@babel/plugin-transform-classes" "^7.12.13" + "@babel/plugin-transform-computed-properties" "^7.12.13" + "@babel/plugin-transform-destructuring" "^7.12.13" + "@babel/plugin-transform-dotall-regex" "^7.12.13" + "@babel/plugin-transform-duplicate-keys" "^7.12.13" + "@babel/plugin-transform-exponentiation-operator" "^7.12.13" + "@babel/plugin-transform-for-of" "^7.12.13" + "@babel/plugin-transform-function-name" "^7.12.13" + "@babel/plugin-transform-literals" "^7.12.13" + "@babel/plugin-transform-member-expression-literals" "^7.12.13" + "@babel/plugin-transform-modules-amd" "^7.12.13" + "@babel/plugin-transform-modules-commonjs" "^7.12.13" + "@babel/plugin-transform-modules-systemjs" "^7.12.13" + "@babel/plugin-transform-modules-umd" "^7.12.13" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.12.13" + "@babel/plugin-transform-new-target" "^7.12.13" + "@babel/plugin-transform-object-super" "^7.12.13" + "@babel/plugin-transform-parameters" "^7.12.13" + "@babel/plugin-transform-property-literals" "^7.12.13" + "@babel/plugin-transform-regenerator" "^7.12.13" + "@babel/plugin-transform-reserved-words" "^7.12.13" + "@babel/plugin-transform-shorthand-properties" "^7.12.13" + "@babel/plugin-transform-spread" "^7.12.13" + "@babel/plugin-transform-sticky-regex" "^7.12.13" + "@babel/plugin-transform-template-literals" "^7.12.13" + "@babel/plugin-transform-typeof-symbol" "^7.12.13" + "@babel/plugin-transform-unicode-escapes" "^7.12.13" + "@babel/plugin-transform-unicode-regex" "^7.12.13" "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.12.11" + "@babel/types" "^7.12.13" core-js-compat "^3.8.0" semver "^5.5.0" @@ -834,7 +907,16 @@ "@babel/parser" "^7.12.7" "@babel/types" "^7.12.7" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.10.4", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.7.0": +"@babel/template@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" + integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.7.0": version "7.12.10" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.10.tgz#2d1f4041e8bf42ea099e5b2dc48d6a594c00017a" integrity sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg== @@ -849,7 +931,22 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@7.12.12", "@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": +"@babel/traverse@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" + integrity sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.12.13" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@7.12.12": version "7.12.12" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== @@ -858,6 +955,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.13", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" + integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -5067,7 +5173,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@4.17.20, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: +lodash@4.17.20, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== From 252371cc80791eb71e6794cda5af1586262286eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 14:36:01 +0800 Subject: [PATCH 063/237] Build(deps-dev): Bump webpack from 5.19.0 to 5.20.0 in /website (#10227) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/package.json | 2 +- website/yarn.lock | 45 ++++---------------------------------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/website/package.json b/website/package.json index 836052dcf..aa7c5b556 100644 --- a/website/package.json +++ b/website/package.json @@ -23,7 +23,7 @@ "docusaurus": "1.14.6", "js-yaml": "4.0.0", "svgo": "1.3.2", - "webpack": "5.19.0", + "webpack": "5.20.0", "webpack-cli": "4.4.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index 9e50aba0e..1f7282250 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -3291,14 +3291,6 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - find-versions@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.1.0.tgz#10161f29cf3eb4350dec10a29bdde75bff0df32d" @@ -4551,13 +4543,6 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -5307,13 +5292,6 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" -p-limit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.0.2.tgz#1664e010af3cadc681baafd3e2a437be7b0fb5fe" - integrity sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg== - dependencies: - p-try "^2.0.0" - p-limit@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -5341,13 +5319,6 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" @@ -5519,13 +5490,6 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - pkg-up@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" @@ -7439,10 +7403,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.19.0: - version "5.19.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.19.0.tgz#1a5fee84dd63557e68336b0774ac4a1c81aa2c73" - integrity sha512-egX19vAQ8fZ4cVYtA9Y941eqJtcZAK68mQq87MMv+GTXKZOc3TpKBBxdGX+HXUYlquPxiluNsJ1VHvwwklW7CQ== +webpack@5.20.0: + version "5.20.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.20.0.tgz#7225c2e780f4332aef18e0b323b8b3ec01e16d66" + integrity sha512-k7X/+gisrvirr4bzv8JVLzy2RhWiVzd3gA9qzS5je3lwqYrMc5F549vLOk34BoNkkUp4SIpt1rQp48pTxBMXvA== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" @@ -7462,7 +7426,6 @@ webpack@5.19.0: loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - pkg-dir "^5.0.0" schema-utils "^3.0.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.1" From 5527b078ac630a941eb6de43d411e6d9a76f6441 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 14:38:57 +0800 Subject: [PATCH 064/237] Build(deps-dev): Bump @babel/preset-react from 7.12.10 to 7.12.13 in /website (#10225) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/package.json | 2 +- website/yarn.lock | 150 ++++++++++++++++--------------------------- 2 files changed, 57 insertions(+), 95 deletions(-) diff --git a/website/package.json b/website/package.json index aa7c5b556..36df8d210 100644 --- a/website/package.json +++ b/website/package.json @@ -16,7 +16,7 @@ "react-dom": "17.0.1" }, "devDependencies": { - "@babel/preset-react": "7.12.10", + "@babel/preset-react": "7.12.13", "@sandhose/prettier-animated-logo": "1.0.3", "babel-loader": "8.2.2", "concurrently": "5.3.0", diff --git a/website/yarn.lock b/website/yarn.lock index 1f7282250..ee9303bf0 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -70,12 +70,12 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-annotate-as-pure@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.10.tgz#54ab9b000e60a93644ce17b3f37d313aaf1d115d" - integrity sha512-XplmVbC1n+KY6jL8/fgLVXXUauDIB+lD5+GsQEh6F6GBF1dq1qy4DP4yXWzDKcoqXB3X58t61e85Fitoww4JVQ== +"@babel/helper-annotate-as-pure@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab" + integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw== dependencies: - "@babel/types" "^7.12.10" + "@babel/types" "^7.12.13" "@babel/helper-builder-binary-assignment-operator-visitor@^7.10.4": version "7.10.4" @@ -85,32 +85,6 @@ "@babel/helper-explode-assignable-expression" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/helper-builder-react-jsx-experimental@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.12.10.tgz#a58cb96a793dc0fcd5c9ed3bb36d62fdc60534c2" - integrity sha512-3Kcr2LGpL7CTRDTTYm1bzeor9qZbxbvU2AxsLA6mUG9gYarSfIKMK0UlU+azLWI+s0+BH768bwyaziWB2NOJlQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.12.10" - "@babel/helper-module-imports" "^7.12.5" - "@babel/types" "^7.12.10" - -"@babel/helper-builder-react-jsx-experimental@^7.12.4": - version "7.12.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.12.4.tgz#55fc1ead5242caa0ca2875dcb8eed6d311e50f48" - integrity sha512-AjEa0jrQqNk7eDQOo0pTfUOwQBMF+xVqrausQwT9/rTKy0g04ggFNaJpaE09IQMn9yExluigWMJcj0WC7bq+Og== - dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-module-imports" "^7.12.1" - "@babel/types" "^7.12.1" - -"@babel/helper-builder-react-jsx@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.10.4.tgz#8095cddbff858e6fa9c326daee54a2f2732c1d5d" - integrity sha512-5nPcIZ7+KKDxT1427oBivl9V9YTal7qk0diccnh7RrcgrT/pGFOjgGw1dgryyx1GvHEpXVfoDF6Ak3rTiWh8Rg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/types" "^7.10.4" - "@babel/helper-compilation-targets@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz#804ae8e3f04376607cc791b9d47d540276332bd2" @@ -206,19 +180,12 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-module-imports@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz#1644c01591a15a2f084dd6d092d9430eb1d1216c" - integrity sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA== +"@babel/helper-module-imports@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz#ec67e4404f41750463e455cc3203f6a32e93fcb0" + integrity sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g== dependencies: - "@babel/types" "^7.12.1" - -"@babel/helper-module-imports@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz#1bfc0229f794988f76ed0a4d4e90860850b54dfb" - integrity sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA== - dependencies: - "@babel/types" "^7.12.5" + "@babel/types" "^7.12.13" "@babel/helper-module-transforms@^7.10.4", "@babel/helper-module-transforms@^7.10.5", "@babel/helper-module-transforms@^7.11.0": version "7.11.0" @@ -240,10 +207,10 @@ dependencies: "@babel/types" "^7.10.4" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.1", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" - integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.1", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.12.13.tgz#174254d0f2424d8aefb4dd48057511247b0a9eeb" + integrity sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA== "@babel/helper-regex@^7.10.1": version "7.10.1" @@ -312,6 +279,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + "@babel/helper-wrap-function@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz#8a6f701eab0ff39f765b5a1cfef409990e624b87" @@ -504,12 +476,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.1.tgz#9d9d357cc818aa7ae7935917c1257f67677a0926" - integrity sha512-1yRi7yAtB0ETgxdY9ti/p2TivUxJkTdhu/ZbF9MshVGqOx1TdB3b7xCXs49Fupgg50N45KcAsRP/ZqWjs9SRjg== +"@babel/plugin-syntax-jsx@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.12.13.tgz#044fb81ebad6698fe62c478875575bcbb9b70f15" + integrity sha512-d4HM23Q1K7oq/SLNmG6mRt85l2csmQ0cHRaxRXjKW0YFdEXqlZ5kzFQKH5Uc3rDJECgu+yCRgPkG04Mm98R/1g== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -752,31 +724,30 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-react-display-name@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.12.1.tgz#1cbcd0c3b1d6648c55374a22fc9b6b7e5341c00d" - integrity sha512-cAzB+UzBIrekfYxyLlFqf/OagTvHLcVBb5vpouzkYkBclRPraiygVnafvAoipErZLI8ANv8Ecn6E/m5qPXD26w== +"@babel/plugin-transform-react-display-name@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.12.13.tgz#c28effd771b276f4647411c9733dbb2d2da954bd" + integrity sha512-MprESJzI9O5VnJZrL7gg1MpdqmiFcUv41Jc7SahxYsNP2kDkFqClxxTZq+1Qv4AFCamm+GXMRDQINNn+qrxmiA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-react-jsx-development@^7.12.7": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.7.tgz#4c2a647de79c7e2b16bfe4540677ba3121e82a08" - integrity sha512-Rs3ETtMtR3VLXFeYRChle5SsP/P9Jp/6dsewBQfokDSzKJThlsuFcnzLTDRALiUmTC48ej19YD9uN1mupEeEDg== +"@babel/plugin-transform-react-jsx-development@^7.12.12": + version "7.12.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.12.tgz#bccca33108fe99d95d7f9e82046bfe762e71f4e7" + integrity sha512-i1AxnKxHeMxUaWVXQOSIco4tvVvvCxMSfeBMnMM06mpaJt3g+MpxYQQrDfojUQldP1xxraPSJYSMEljoWM/dCg== dependencies: - "@babel/helper-builder-react-jsx-experimental" "^7.12.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-jsx" "^7.12.1" + "@babel/plugin-transform-react-jsx" "^7.12.12" -"@babel/plugin-transform-react-jsx@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.10.tgz#a7af3097c73479123594c8c8fe39545abebd44e3" - integrity sha512-MM7/BC8QdHXM7Qc1wdnuk73R4gbuOpfrSUgfV/nODGc86sPY1tgmY2M9E9uAnf2e4DOIp8aKGWqgZfQxnTNGuw== +"@babel/plugin-transform-react-jsx@^7.12.12", "@babel/plugin-transform-react-jsx@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.13.tgz#6c9f993b9f6fb6f0e32a4821ed59349748576a3e" + integrity sha512-hhXZMYR8t9RvduN2uW4sjl6MRtUhzNE726JvoJhpjhxKgRUVkZqTsA0xc49ALZxQM7H26pZ/lLvB2Yrea9dllA== dependencies: - "@babel/helper-builder-react-jsx" "^7.10.4" - "@babel/helper-builder-react-jsx-experimental" "^7.12.10" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-jsx" "^7.12.1" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-syntax-jsx" "^7.12.13" + "@babel/types" "^7.12.13" "@babel/plugin-transform-react-pure-annotations@^7.12.1": version "7.12.1" @@ -946,15 +917,15 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@7.12.10", "@babel/preset-react@^7.9.4": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.12.10.tgz#4fed65f296cbb0f5fb09de6be8cddc85cc909be9" - integrity sha512-vtQNjaHRl4DUpp+t+g4wvTHsLQuye+n0H/wsXIZRn69oz/fvNC7gQ4IK73zGJBaxvHoxElDvnYCthMcT7uzFoQ== +"@babel/preset-react@7.12.13", "@babel/preset-react@^7.9.4": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.12.13.tgz#5f911b2eb24277fa686820d5bd81cad9a0602a0a" + integrity sha512-TYM0V9z6Abb6dj1K7i5NrEhA13oS5ujUYQYDfqIBXYHOc2c2VkFgc+q9kyssIyUfy4/hEwqrgSlJ/Qgv8zJLsA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-transform-react-display-name" "^7.12.1" - "@babel/plugin-transform-react-jsx" "^7.12.10" - "@babel/plugin-transform-react-jsx-development" "^7.12.7" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/plugin-transform-react-display-name" "^7.12.13" + "@babel/plugin-transform-react-jsx" "^7.12.13" + "@babel/plugin-transform-react-jsx-development" "^7.12.12" "@babel/plugin-transform-react-pure-annotations" "^7.12.1" "@babel/register@^7.9.0": @@ -1008,21 +979,12 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@babel/types@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.1.tgz#e109d9ab99a8de735be287ee3d6a9947a190c4ae" - integrity sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA== +"@babel/types@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" + integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@babel/types@^7.12.10", "@babel/types@^7.12.5": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.10.tgz#7965e4a7260b26f09c56bcfcb0498af1f6d9b260" - integrity sha512-sf6wboJV5mGyip2hIpDSKsr80RszPinEFjsHTalMxZAZkoQ2/2yQzxlcFN52SJqsyPfLtPmenL4g2KB3KJXPDw== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" + "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" to-fast-properties "^2.0.0" From 831c783e9eaeae075f9be9ef7a5b6344cce3f367 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:46:46 +0800 Subject: [PATCH 065/237] Build(deps-dev): Bump webpack-cli from 4.4.0 to 4.5.0 in /website (#10229) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- website/package.json | 2 +- website/yarn.lock | 48 ++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/website/package.json b/website/package.json index 36df8d210..bfda79e4d 100644 --- a/website/package.json +++ b/website/package.json @@ -24,6 +24,6 @@ "js-yaml": "4.0.0", "svgo": "1.3.2", "webpack": "5.20.0", - "webpack-cli": "4.4.0" + "webpack-cli": "4.5.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index ee9303bf0..2fe24cd9d 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1184,22 +1184,22 @@ "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.0.tgz#2aff5f1ebc6f793c13ba9b2a701d180eab17f5ee" - integrity sha512-Un0SdBoN1h4ACnIO7EiCjWuyhNI0Jl96JC+63q6xi4HDUYRZn8Auluea9D+v9NWKc5J4sICVEltdBaVjLX39xw== +"@webpack-cli/configtest@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.1.tgz#241aecfbdc715eee96bed447ed402e12ec171935" + integrity sha512-B+4uBUYhpzDXmwuo3V9yBH6cISwxEI4J+NO5ggDaGEEHb0osY/R7MzeKc0bHURXQuZjMM4qD+bSJCKIuI3eNBQ== -"@webpack-cli/info@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.1.tgz#af98311f983d0b9fce7284cfcf1acaf1e9f4879c" - integrity sha512-fLnDML5HZ5AEKzHul8xLAksoKN2cibu6MgonkUj8R9V7bbeVRkd1XbGEGWrAUNYHbX1jcqCsDEpBviE5StPMzQ== +"@webpack-cli/info@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.2.tgz#ef3c0cd947a1fa083e174a59cb74e0b6195c236c" + integrity sha512-5U9kUJHnwU+FhKH4PWGZuBC1hTEPYyxGSL5jjoBI96Gx8qcYJGOikpiIpFoTq8mmgX3im2zAo2wanv/alD74KQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.2.2.tgz#1f8eee44f96524756268f5e3f43e9d943f864d41" - integrity sha512-03GkWxcgFfm8+WIwcsqJb9agrSDNDDoxaNnexPnCCexP5SCE4IgFd9lNpSy+K2nFqVMpgTFw6SwbmVAVTndVew== +"@webpack-cli/serve@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.0.tgz#2730c770f5f1f132767c63dcaaa4ec28f8c56a6c" + integrity sha512-k2p2VrONcYVX1wRRrf0f3X2VGltLWcv+JzXRBDmvCxGlCeESx4OXw91TsWeKOkp784uNoVQo313vxJFHXPPwfw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2063,10 +2063,10 @@ commander@^4.0.1: resolved "https://registry.yarnpkg.com/commander/-/commander-4.0.1.tgz#b67622721785993182e807f4883633e6401ba53c" integrity sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA== -commander@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.0.tgz#b990bfb8ac030aedc6d11bc04d1488ffef56db75" - integrity sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q== +commander@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.0.0.tgz#3e2bbfd8bb6724760980988fb5b22b7ee6b71ab2" + integrity sha512-ovx/7NkTrnPuIV8sqk/GjUIIM1+iUQeqA3ye2VNpq9sVoiZsooObWlQy+OPWGI17GDaEoybuAGJm6U8yC077BA== commondir@^1.0.1: version "1.0.1" @@ -7329,17 +7329,17 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webpack-cli@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.4.0.tgz#38c7fa01ea31510f5c490245dd1bb28018792f1b" - integrity sha512-/Qh07CXfXEkMu5S8wEpjuaw2Zj/CC0hf/qbTDp6N8N7JjdGuaOjZ7kttz+zhuJO/J5m7alQEhNk9lsc4rC6xgQ== +webpack-cli@4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.5.0.tgz#b5213b84adf6e1f5de6391334c9fa53a48850466" + integrity sha512-wXg/ef6Ibstl2f50mnkcHblRPN/P9J4Nlod5Hg9HGFgSeF8rsqDGHJeVe4aR26q9l62TUJi6vmvC2Qz96YJw1Q== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.0.0" - "@webpack-cli/info" "^1.2.1" - "@webpack-cli/serve" "^1.2.2" + "@webpack-cli/configtest" "^1.0.1" + "@webpack-cli/info" "^1.2.2" + "@webpack-cli/serve" "^1.3.0" colorette "^1.2.1" - commander "^6.2.0" + commander "^7.0.0" enquirer "^2.3.6" execa "^5.0.0" fastest-levenshtein "^1.0.12" From d34fb7ff3faa3094c3a45a4c4aa5bf7dbbe2fd93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Feb 2021 08:36:38 +0000 Subject: [PATCH 066/237] Build(deps-dev): Bump @babel/types from 7.12.12 to 7.12.13 (#10230) --- package.json | 2 +- yarn.lock | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index bbdd6bc2b..214740c9c 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "devDependencies": { "@babel/core": "7.12.10", "@babel/preset-env": "7.12.13", - "@babel/types": "7.12.12", + "@babel/types": "7.12.13", "@glimmer/reference": "0.74.2", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.2.3", diff --git a/yarn.lock b/yarn.lock index 5daf81de3..749f22ed6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -946,16 +946,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@7.12.12": - version "7.12.12" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.12.tgz#4608a6ec313abbd87afa55004d373ad04a96c299" - integrity sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ== - dependencies: - "@babel/helper-validator-identifier" "^7.12.11" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.13", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": +"@babel/types@7.12.13", "@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.13", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== From 650c21c311079ff107ad871b532e0b088a11b70d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 3 Feb 2021 18:17:22 +0800 Subject: [PATCH 067/237] CI: Fix coverage report (#10224) --- .github/workflows/dev-test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 10758dee7..532547283 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -44,6 +44,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2.3.4 + # `codecov/codecov-action` require depth to be at least `2`, see #10219 + with: + fetch-depth: 2 - name: Setup Node.js uses: actions/setup-node@v2.1.4 @@ -65,8 +68,6 @@ jobs: uses: codecov/codecov-action@v1.2.1 if: matrix.ENABLE_CODE_COVERAGE with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage/lcov.info fail_ci_if_error: true # #8073 test @@ -79,6 +80,4 @@ jobs: uses: codecov/codecov-action@v1.2.1 if: matrix.ENABLE_CODE_COVERAGE with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage/lcov.info fail_ci_if_error: true From 30f9e1adbc54d7283363ed550ec50ffd94d45813 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Feb 2021 09:08:29 +0800 Subject: [PATCH 068/237] Build(deps-dev): Bump @babel/core from 7.12.10 to 7.12.13 (#10232) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker Cheing --- package.json | 2 +- .../__snapshots__/third-party.js.snap | 4 +- yarn.lock | 156 +++--------------- 3 files changed, 30 insertions(+), 132 deletions(-) diff --git a/package.json b/package.json index 214740c9c..6065e55e9 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "yaml-unist-parser": "1.3.1" }, "devDependencies": { - "@babel/core": "7.12.10", + "@babel/core": "7.12.13", "@babel/preset-env": "7.12.13", "@babel/types": "7.12.13", "@glimmer/reference": "0.74.2", diff --git a/tests_integration/__tests__/__snapshots__/third-party.js.snap b/tests_integration/__tests__/__snapshots__/third-party.js.snap index b31fc3040..59921aedb 100644 --- a/tests_integration/__tests__/__snapshots__/third-party.js.snap +++ b/tests_integration/__tests__/__snapshots__/third-party.js.snap @@ -5,12 +5,12 @@ exports[`cosmiconfig Invalid json file 1`] = ` > 1 | {a':} | ^ - 2 | + 2 | Unexpected token a in JSON at position 1 while parsing near '{a':}' > 1 | {a':} | ^ - 2 | + 2 | " `; diff --git a/yarn.lock b/yarn.lock index 749f22ed6..31f3462ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,14 +16,14 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/code-frame@7.12.11", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4": +"@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.12.13": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== @@ -35,19 +35,19 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.13.tgz#27e19e0ed3726ccf54067ced4109501765e7e2e8" integrity sha512-U/hshG5R+SIoW7HVWIdmy1cB7s3ki+r3FpyEZiCgpi4tFgPnX/vynY80ZGSASOIrUM6O7VxOgCZgdt7h97bUGg== -"@babel/core@7.12.10", "@babel/core@^7.1.0", "@babel/core@^7.7.5": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.10.tgz#b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd" - integrity sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w== +"@babel/core@7.12.13", "@babel/core@^7.1.0", "@babel/core@^7.7.5": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.13.tgz#b73a87a3a3e7d142a66248bf6ad88b9ceb093425" + integrity sha512-BQKE9kXkPlXHPeqissfxo0lySWJcYdEP0hdtJOH/iJfDdhOCcgtNCjftCJg3qqauB4h+lz2N6ixM++b9DN1Tcw== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.10" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.5" - "@babel/parser" "^7.12.10" - "@babel/template" "^7.12.7" - "@babel/traverse" "^7.12.10" - "@babel/types" "^7.12.10" + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.12.13" + "@babel/helper-module-transforms" "^7.12.13" + "@babel/helpers" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.12.13" + "@babel/types" "^7.12.13" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" @@ -56,15 +56,6 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.12.10": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.10.tgz#2b188fc329fb8e4f762181703beffc0fe6df3460" - integrity sha512-6mCdfhWgmqLdtTkhXjnIz0LcdVCd26wS2JXRtj2XY0u5klDsXBREA/pG5NVOuVnF2LUrBGNFtQkIqqTbblg0ww== - dependencies: - "@babel/types" "^7.12.10" - jsesc "^2.5.1" - source-map "^0.5.0" - "@babel/generator@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.13.tgz#5f6ebe6c85db99886db2d7b044409196f872a503" @@ -125,15 +116,6 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" - integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== - dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" - "@babel/helper-function-name@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz#93ad656db3c3c2232559fd7b2c3dbdcbe0eb377a" @@ -143,13 +125,6 @@ "@babel/template" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-get-function-arity@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== - dependencies: - "@babel/types" "^7.10.4" - "@babel/helper-get-function-arity@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz#bc63451d403a3b3082b97e1d8b3fe5bd4091e583" @@ -164,13 +139,6 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-member-expression-to-functions@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz#fba0f2fcff3fba00e6ecb664bb5e6e26e2d6165c" - integrity sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ== - dependencies: - "@babel/types" "^7.12.1" - "@babel/helper-member-expression-to-functions@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.13.tgz#c5715695b4f8bab32660dbdcdc2341dec7e3df40" @@ -178,28 +146,13 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.1", "@babel/helper-module-imports@^7.12.13": +"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz#ec67e4404f41750463e455cc3203f6a32e93fcb0" integrity sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g== dependencies: "@babel/types" "^7.12.13" -"@babel/helper-module-transforms@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" - integrity sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w== - dependencies: - "@babel/helper-module-imports" "^7.12.1" - "@babel/helper-replace-supers" "^7.12.1" - "@babel/helper-simple-access" "^7.12.1" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/helper-validator-identifier" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - lodash "^4.17.19" - "@babel/helper-module-transforms@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz#01afb052dcad2044289b7b20beb3fa8bd0265bea" @@ -215,13 +168,6 @@ "@babel/types" "^7.12.13" lodash "^4.17.19" -"@babel/helper-optimise-call-expression@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" - integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== - dependencies: - "@babel/types" "^7.10.4" - "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz#5c02d171b4c8615b1e7163f888c1c81c30a2aaea" @@ -243,16 +189,6 @@ "@babel/helper-wrap-function" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-replace-supers@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz#f15c9cc897439281891e11d5ce12562ac0cf3fa9" - integrity sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.12.1" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - "@babel/helper-replace-supers@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz#00ec4fb6862546bd3d0aff9aac56074277173121" @@ -263,13 +199,6 @@ "@babel/traverse" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-simple-access@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz#32427e5aa61547d38eb1e6eaf5fd1426fdad9136" - integrity sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA== - dependencies: - "@babel/types" "^7.12.1" - "@babel/helper-simple-access@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz#8478bcc5cacf6aa1672b251c1d2dde5ccd61a6c4" @@ -284,13 +213,6 @@ dependencies: "@babel/types" "^7.12.1" -"@babel/helper-split-export-declaration@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz#f8a491244acf6a676158ac42072911ba83ad099f" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== - dependencies: - "@babel/types" "^7.11.0" - "@babel/helper-split-export-declaration@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz#e9430be00baf3e88b0e13e6f9d4eaf2136372b05" @@ -318,14 +240,14 @@ "@babel/traverse" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helpers@^7.12.5": - version "7.12.5" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.5.tgz#1a1ba4a768d9b58310eda516c449913fe647116e" - integrity sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA== +"@babel/helpers@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.13.tgz#3c75e993632e4dadc0274eae219c73eb7645ba47" + integrity sha512-oohVzLRZ3GQEk4Cjhfs9YkJA4TdIDTObdBEZGrd6F/T0GPSnuV6l22eMcxlvcvzVIPH3VTtxbseudM1zIE+rPQ== dependencies: - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.5" - "@babel/types" "^7.12.5" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.12.13" + "@babel/types" "^7.12.13" "@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4": version "7.10.4" @@ -345,12 +267,12 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.12.11", "@babel/parser@^7.1.0", "@babel/parser@^7.12.10", "@babel/parser@^7.12.7", "@babel/parser@^7.7.0": +"@babel/parser@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== -"@babel/parser@^7.12.13": +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.13.tgz#3ee7be4131fe657ba9143d5c5b3a9f253fdb75e9" integrity sha512-z7n7ybOUzaRc3wwqLpAX8UFIXsrVXUJhtNGBwAnLz6d1KUapqyq7ad2La8gZ6CXhHmGAIL32cop8Tst4/PNWLw== @@ -898,16 +820,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.12.7", "@babel/template@^7.3.3": - version "7.12.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" - integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/parser" "^7.12.7" - "@babel/types" "^7.12.7" - -"@babel/template@^7.12.13": +"@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" integrity sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA== @@ -916,22 +829,7 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5", "@babel/traverse@^7.7.0": - version "7.12.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.10.tgz#2d1f4041e8bf42ea099e5b2dc48d6a594c00017a" - integrity sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.10" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.12.10" - "@babel/types" "^7.12.10" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.19" - -"@babel/traverse@^7.12.13": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.13", "@babel/traverse@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" integrity sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA== @@ -946,7 +844,7 @@ globals "^11.1.0" lodash "^4.17.19" -"@babel/types@7.12.13", "@babel/types@^7.0.0", "@babel/types@^7.10.4", "@babel/types@^7.11.0", "@babel/types@^7.12.1", "@babel/types@^7.12.10", "@babel/types@^7.12.13", "@babel/types@^7.12.5", "@babel/types@^7.12.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": +"@babel/types@7.12.13", "@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.13.tgz#8be1aa8f2c876da11a9cf650c0ecf656913ad611" integrity sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ== From d0942b8fae17916917387dd77bb5b7ff79238b94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Feb 2021 09:42:00 +0800 Subject: [PATCH 069/237] Build(deps): Bump @babel/code-frame from 7.12.11 to 7.12.13 (#10226) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung --- package.json | 2 +- .../range/__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../range/__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 134 ++++++++--------- .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- tests/js/bom/__snapshots__/jsfmt.spec.js.snap | 18 +-- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 20 +-- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../cursor/__snapshots__/jsfmt.spec.js.snap | 20 +-- .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 24 ++-- .../__snapshots__/jsfmt.spec.js.snap | 8 +- tests/js/eol/__snapshots__/jsfmt.spec.js.snap | 96 ++++++------- .../exports/__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 24 ++-- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../literal/__snapshots__/jsfmt.spec.js.snap | 10 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../no-semi/__snapshots__/jsfmt.spec.js.snap | 4 +- .../objects/__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 12 +- .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../js/range/__snapshots__/jsfmt.spec.js.snap | 136 +++++++++--------- .../record/__snapshots__/jsfmt.spec.js.snap | 24 ++-- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../js/tuple/__snapshots__/jsfmt.spec.js.snap | 26 ++-- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../range/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../babel-ts/__snapshots__/jsfmt.spec.js.snap | 6 +- .../flow/__snapshots__/jsfmt.spec.js.snap | 18 +-- .../graphql/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../__snapshots__/jsfmt.spec.js.snap | 34 ++--- .../js/__snapshots__/jsfmt.spec.js.snap | 20 +-- .../less/__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 14 +- .../vue/__snapshots__/jsfmt.spec.js.snap | 4 +- .../yaml/__snapshots__/jsfmt.spec.js.snap | 2 +- .../js/__snapshots__/jsfmt.spec.js.snap | 4 +- .../class/__snapshots__/jsfmt.spec.js.snap | 8 +- .../compiler/__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 4 +- .../abstract/__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 8 +- .../keywords/__snapshots__/jsfmt.spec.js.snap | 4 +- .../range/__snapshots__/jsfmt.spec.js.snap | 6 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +- .../range/__snapshots__/jsfmt.spec.js.snap | 6 +- tests_config/run_spec.js | 2 +- .../__tests__/__snapshots__/format.js.snap | 2 +- yarn.lock | 12 +- 72 files changed, 466 insertions(+), 472 deletions(-) diff --git a/package.json b/package.json index 6065e55e9..b177a4abf 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ ], "dependencies": { "@angular/compiler": "11.1.1", - "@babel/code-frame": "7.12.11", + "@babel/code-frame": "7.12.13", "@babel/parser": "7.12.11", "@glimmer/syntax": "0.74.2", "@iarna/toml": "2.2.5", diff --git a/tests/css/range/__snapshots__/jsfmt.spec.js.snap b/tests/css/range/__snapshots__/jsfmt.spec.js.snap index 090dfdf59..887c9437f 100644 --- a/tests/css/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/css/range/__snapshots__/jsfmt.spec.js.snap @@ -9,7 +9,7 @@ rangeEnd: 4 =====================================input====================================== > 1 | .x{} | ^^^^ - 2 | + 2 | =====================================output===================================== .x{} diff --git a/tests/flow/this-annotation/__snapshots__/jsfmt.spec.js.snap b/tests/flow/this-annotation/__snapshots__/jsfmt.spec.js.snap index 676102b83..6c97fb86a 100644 --- a/tests/flow/this-annotation/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow/this-annotation/__snapshots__/jsfmt.spec.js.snap @@ -57,12 +57,12 @@ function baz(this: number, ...a) {} exports[`function_type.js - {"trailingComma":"all"} [babel-flow] format 1`] = ` "Unexpected token, expected \\")\\" (3:16) 1 | // @flow - 2 | + 2 | > 3 | type T = (this : number, a : string, b : number) => void | ^ - 4 | + 4 | 5 | type U = (this : number, ...c : any) => void - 6 | " + 6 |" `; exports[`function_type.js - {"trailingComma":"all"} format 1`] = ` @@ -95,11 +95,11 @@ type V = (this: number) => void; exports[`line_break.js - {"trailingComma":"all"} [babel-flow] format 1`] = ` "Unexpected token, expected \\")\\" (3:15) 1 | // @flow - 2 | + 2 | > 3 | type T = (this: boolean, | ^ 4 | a: number, - 5 | + 5 | 6 | b: number," `; @@ -197,13 +197,13 @@ class A { exports[`union_type.js - {"trailingComma":"all"} [babel-flow] format 1`] = ` "Unexpected token, expected \\")\\" (4:7) - 2 | + 2 | 3 | type A = ( > 4 | this: | SupperLongLongLongLongLongLongLongLongLongLongLongType | FooBarBazLorem12345, | ^ 5 | b: number, 6 | ) => boolean; - 7 | " + 7 |" `; exports[`union_type.js - {"trailingComma":"all"} format 1`] = ` diff --git a/tests/graphql/range/__snapshots__/jsfmt.spec.js.snap b/tests/graphql/range/__snapshots__/jsfmt.spec.js.snap index 648665abd..7a5bd1d3d 100644 --- a/tests/graphql/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/graphql/range/__snapshots__/jsfmt.spec.js.snap @@ -9,7 +9,7 @@ rangeEnd: 3 =====================================input====================================== > 1 | {NPC{life}} | ^^^ - 2 | + 2 | =====================================output===================================== { NPC { diff --git a/tests/js/arrow-call/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrow-call/__snapshots__/jsfmt.spec.js.snap index c11bf4473..c7d0ae146 100644 --- a/tests/js/arrow-call/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrow-call/__snapshots__/jsfmt.spec.js.snap @@ -309,7 +309,7 @@ exports[`class-property.js [espree] format 1`] = ` > 3 | static propTypes = {}; | ^ 4 | }; - 5 | " + 5 |" `; exports[`class-property.js - {"arrowParens":"always"} [espree] format 1`] = ` @@ -319,7 +319,7 @@ exports[`class-property.js - {"arrowParens":"always"} [espree] format 1`] = ` > 3 | static propTypes = {}; | ^ 4 | }; - 5 | " + 5 |" `; exports[`class-property.js - {"arrowParens":"always"} format 1`] = ` @@ -350,7 +350,7 @@ exports[`class-property.js - {"trailingComma":"all"} [espree] format 1`] = ` > 3 | static propTypes = {}; | ^ 4 | }; - 5 | " + 5 |" `; exports[`class-property.js - {"trailingComma":"all"} format 1`] = ` diff --git a/tests/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap index a6820e80c..6e78ef4d3 100644 --- a/tests/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrows-bind/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`arrows-bind.js [espree] format 1`] = ` | ^ 2 | (a => b)::c; 3 | a::(b => c); - 4 | " + 4 |" `; exports[`arrows-bind.js [meriyah] format 1`] = ` @@ -15,7 +15,7 @@ exports[`arrows-bind.js [meriyah] format 1`] = ` | ^ 2 | (a => b)::c; 3 | a::(b => c); - 4 | " + 4 |" `; exports[`arrows-bind.js format 1`] = ` diff --git a/tests/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap index 6618920b1..cb22f4f14 100644 --- a/tests/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrows/newline-before-arrow/__snapshots__/jsfmt.spec.js.snap @@ -5,7 +5,7 @@ exports[`newline-before-arrow.js [espree] format 1`] = ` 1 | async x > 2 | => x | ^ - 3 | " + 3 |" `; exports[`newline-before-arrow.js [meriyah] format 1`] = ` @@ -13,7 +13,7 @@ exports[`newline-before-arrow.js [meriyah] format 1`] = ` 1 | async x > 2 | => x | ^ - 3 | " + 3 |" `; exports[`newline-before-arrow.js format 1`] = ` diff --git a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index ac88339fa..4adcb644e 100644 --- a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -425,7 +425,7 @@ class C { exports[`decimal.js [espree] format 1`] = ` "Identifier directly after number (3:4) 1 | // https://github.com/babel/babel/pull/11640 - 2 | + 2 | > 3 | 100m; | ^ 4 | 9223372036854775807m; @@ -436,7 +436,7 @@ exports[`decimal.js [espree] format 1`] = ` exports[`decimal.js [meriyah] format 1`] = ` "[3:3]: No identifiers allowed directly after numeric literal (3:3) 1 | // https://github.com/babel/babel/pull/11640 - 2 | + 2 | > 3 | 100m; | ^ 4 | 9223372036854775807m; @@ -510,11 +510,11 @@ typeof 1m === "decimal128"; exports[`decorators.js [espree] format 1`] = ` "Unexpected character '@' (3:1) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-decorators - 2 | + 2 | > 3 | @annotation | ^ 4 | class MyClass { } - 5 | + 5 | 6 | function annotation(target) {" `; @@ -591,7 +591,7 @@ function enumerable(value) { exports[`do-expressions.js [espree] format 1`] = ` "Unexpected token do (3:9) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions - 2 | + 2 | > 3 | let a = do { | ^ 4 | if(x > 10) { @@ -602,7 +602,7 @@ exports[`do-expressions.js [espree] format 1`] = ` exports[`do-expressions.js [meriyah] format 1`] = ` "[3:10]: Unexpected token: 'do' (3:10) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-do-expressions - 2 | + 2 | > 3 | let a = do { | ^ 4 | if(x > 10) { @@ -674,20 +674,20 @@ import(prettier).then((module) => console.log(module)); exports[`export-default-from.js [espree] format 1`] = ` "Unexpected token v (4:8) - 2 | - 3 | + 2 | + 3 | > 4 | export v from 'mod'; | ^ - 5 | " + 5 |" `; exports[`export-default-from.js [meriyah] format 1`] = ` "[4:8]: Unexpected token: 'identifier' (4:8) - 2 | - 3 | + 2 | + 3 | > 4 | export v from 'mod'; | ^ - 5 | " + 5 |" `; exports[`export-default-from.js format 1`] = ` @@ -730,19 +730,19 @@ export * as ns from "mod"; exports[`flow.js [espree] format 1`] = ` "Unexpected token : (3:17) 1 | // https://babeljs.io/docs/en/babel-preset-flow - 2 | + 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ - 4 | " + 4 |" `; exports[`flow.js [meriyah] format 1`] = ` "[3:17]: Expected ')' (3:17) 1 | // https://babeljs.io/docs/en/babel-preset-flow - 2 | + 2 | > 3 | function foo(one: any, two: number, three?): string {} | ^ - 4 | " + 4 |" `; exports[`flow.js format 1`] = ` @@ -766,23 +766,23 @@ function foo(one: any, two: number, three?): string {} exports[`function-bind.js [espree] format 1`] = ` "Unexpected token : (3:5) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind - 2 | + 2 | > 3 | obj::func | ^ 4 | // is equivalent to: 5 | func.bind(obj) - 6 | " + 6 |" `; exports[`function-bind.js [meriyah] format 1`] = ` "[3:5]: Unexpected token: ':' (3:5) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-function-bind - 2 | + 2 | > 3 | obj::func | ^ 4 | // is equivalent to: 5 | func.bind(obj) - 6 | " + 6 |" `; exports[`function-bind.js format 1`] = ` @@ -832,24 +832,24 @@ obj.func.call(obj, val); exports[`function-sent.js [espree] format 1`] = ` "Unexpected token . (4:33) - 2 | + 2 | 3 | function* generator() { > 4 | console.log(\\"Sent\\", function.sent); | ^ 5 | console.log(\\"Yield\\", yield); 6 | } - 7 | " + 7 |" `; exports[`function-sent.js [meriyah] format 1`] = ` "[4:33]: Expected '(' (4:33) - 2 | + 2 | 3 | function* generator() { > 4 | console.log(\\"Sent\\", function.sent); | ^ 5 | console.log(\\"Yield\\", yield); 6 | } - 7 | " + 7 |" `; exports[`function-sent.js format 1`] = ` @@ -888,14 +888,14 @@ exports[`import-assertions-dynamic.js [espree] format 1`] = ` "Unexpected token , (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`import-assertions-dynamic.js [meriyah] format 1`] = ` "[1:20]: Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`import-assertions-dynamic.js format 1`] = ` @@ -916,14 +916,14 @@ exports[`import-assertions-static.js [espree] format 1`] = ` "Unexpected token assert (1:31) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`import-assertions-static.js [meriyah] format 1`] = ` "[1:36]: Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`import-assertions-static.js format 1`] = ` @@ -1017,11 +1017,11 @@ var profile = ( exports[`logical-assignment-operators.js [meriyah] format 1`] = ` "[3:5]: Unexpected token: '=' (3:5) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-logical-assignment-operators - 2 | + 2 | > 3 | a ||= b; | ^ 4 | obj.a.b ||= c; - 5 | + 5 | 6 | a &&= b;" `; @@ -1056,7 +1056,7 @@ exports[`module-string-names.js [espree] format 1`] = ` > 1 | import { \\"πŸ˜„\\" as smile } from \\"./emojis.js\\"; | ^ 2 | export { smile as \\"πŸ˜„\\" } from \\"./emojis.js\\"; - 3 | " + 3 |" `; exports[`module-string-names.js [meriyah] format 1`] = ` @@ -1064,7 +1064,7 @@ exports[`module-string-names.js [meriyah] format 1`] = ` > 1 | import { \\"πŸ˜„\\" as smile } from \\"./emojis.js\\"; | ^ 2 | export { smile as \\"πŸ˜„\\" } from \\"./emojis.js\\"; - 3 | " + 3 |" `; exports[`module-string-names.js format 1`] = ` @@ -1260,10 +1260,10 @@ try { exports[`optional-chaining.js [espree] format 1`] = ` "Optional chaining cannot appear in the callee of new expressions (56:21) 54 | }; - 55 | + 55 | > 56 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance | ^ - 57 | + 57 | 58 | const safe5 = new obj?.qux?.baz(); // undefined 59 | const safe6 = new obj?.foo.bar.qux?.(); // undefined" `; @@ -1271,10 +1271,10 @@ exports[`optional-chaining.js [espree] format 1`] = ` exports[`optional-chaining.js [meriyah] format 1`] = ` "[56:22]: Invalid optional chain from new expression (56:22) 54 | }; - 55 | + 55 | > 56 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance | ^ - 57 | + 57 | 58 | const safe5 = new obj?.qux?.baz(); // undefined 59 | const safe6 = new obj?.foo.bar.qux?.(); // undefined" `; @@ -1444,22 +1444,22 @@ const ret = delete obj?.foo?.bar?.baz; // true exports[`partial-application.js [espree] format 1`] = ` "Unexpected token ? (5:23) 3 | function add(x, y) { return x + y; } - 4 | + 4 | > 5 | const addOne = add(1, ?); // apply from the left | ^ 6 | addOne(2); // 3 - 7 | + 7 | 8 | const addTen = add(?, 10); // apply from the right" `; exports[`partial-application.js [meriyah] format 1`] = ` "[5:23]: Unexpected token: '?' (5:23) 3 | function add(x, y) { return x + y; } - 4 | + 4 | > 5 | const addOne = add(1, ?); // apply from the left | ^ 6 | addOne(2); // 3 - 7 | + 7 | 8 | const addTen = add(?, 10); // apply from the right" `; @@ -1519,7 +1519,7 @@ super.f(?); // partial application allowed for call on |SuperProperty| exports[`pipeline-operator-fsharp.js [espree] format 1`] = ` "Unexpected token > (5:4) - 3 | + 3 | 4 | promise > 5 | |> await | ^ @@ -1530,7 +1530,7 @@ exports[`pipeline-operator-fsharp.js [espree] format 1`] = ` exports[`pipeline-operator-fsharp.js [meriyah] format 1`] = ` "[5:4]: Unexpected token: '>' (5:4) - 3 | + 3 | 4 | promise > 5 | |> await | ^ @@ -1617,7 +1617,7 @@ let newScore = boundScore(0, 100, add(7, double(person.score))); exports[`pipeline-operator-minimal.js [espree] format 1`] = ` "Identifier 'result' has already been declared (7:5) 5 | result //=> \\"Hello, hello!\\" - 6 | + 6 | > 7 | let result = \\"hello\\" | ^ 8 | |> doubleSay @@ -1627,13 +1627,13 @@ exports[`pipeline-operator-minimal.js [espree] format 1`] = ` exports[`pipeline-operator-minimal.js [meriyah] format 1`] = ` "[8:4]: Unexpected token: '>' (8:4) - 6 | + 6 | 7 | let result = \\"hello\\" > 8 | |> doubleSay | ^ 9 | |> capitalize 10 | |> exclaim; - 11 | " + 11 |" `; exports[`pipeline-operator-minimal.js format 1`] = ` @@ -1671,7 +1671,7 @@ result; //=> "Hello, hello!" exports[`pipeline-operator-smart.js [espree] format 1`] = ` "Unexpected token > (5:2) - 3 | + 3 | 4 | value > 5 | |> await # | ^ @@ -1682,7 +1682,7 @@ exports[`pipeline-operator-smart.js [espree] format 1`] = ` exports[`pipeline-operator-smart.js [meriyah] format 1`] = ` "[5:2]: Unexpected token: '>' (5:2) - 3 | + 3 | 4 | value > 5 | |> await # | ^ @@ -1731,11 +1731,11 @@ value exports[`private-fields-in-in.js [espree] format 1`] = ` "Unexpected character '#' (4:3) - 2 | + 2 | 3 | class C { > 4 | #brand; | ^ - 5 | + 5 | 6 | static isC(obj) { 7 | try {" `; @@ -1864,11 +1864,11 @@ class C { exports[`private-methods.js [espree] format 1`] = ` "Unexpected character '#' (6:3) - 4 | + 4 | 5 | class Counter extends HTMLElement { > 6 | #xValue = 0; | ^ - 7 | + 7 | 8 | get #x() { return this.#xValue; } 9 | set #x(value) {" `; @@ -1970,14 +1970,14 @@ exports[`record-tuple-tuple.js [espree] format 1`] = ` "Unexpected character '#' (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ - 2 | " + 2 |" `; exports[`record-tuple-tuple.js [meriyah] format 1`] = ` "[1:16]: '#' not followed by identifier (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ - 2 | " + 2 |" `; exports[`record-tuple-tuple.js format 1`] = ` @@ -1997,23 +1997,23 @@ const tuple1 = #[1, 2, 3]; exports[`throw-expressions.js [espree] format 1`] = ` "Unexpected token throw (3:23) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions - 2 | + 2 | > 3 | function test(param = throw new Error('required!')) { | ^ 4 | const test = param === true || throw new Error('Falsy!'); 5 | } - 6 | " + 6 |" `; exports[`throw-expressions.js [meriyah] format 1`] = ` "[3:27]: Unexpected token: 'throw' (3:27) 1 | // https://babeljs.io/docs/en/babel-plugin-proposal-throw-expressions - 2 | + 2 | > 3 | function test(param = throw new Error('required!')) { | ^ 4 | const test = param === true || throw new Error('Falsy!'); 5 | } - 6 | " + 6 |" `; exports[`throw-expressions.js format 1`] = ` @@ -2041,19 +2041,19 @@ function test(param = throw new Error("required!")) { exports[`typescript.js [espree] format 1`] = ` "Unexpected token : (3:8) 1 | // https://babeljs.io/docs/en/babel-preset-typescript - 2 | + 2 | > 3 | const x: number = 0; | ^ - 4 | " + 4 |" `; exports[`typescript.js [meriyah] format 1`] = ` "[3:8]: Missing initializer in const declaration (3:8) 1 | // https://babeljs.io/docs/en/babel-preset-typescript - 2 | + 2 | > 3 | const x: number = 0; | ^ - 4 | " + 4 |" `; exports[`typescript.js format 1`] = ` @@ -2077,22 +2077,22 @@ const x: number = 0; exports[`v8intrinsic.js [espree] format 1`] = ` "Unexpected token % (3:1) 1 | // https://github.com/babel/babel/pull/10148 - 2 | + 2 | > 3 | %DebugPrint(foo); | ^ - 4 | - 5 | + 4 | + 5 | 6 | // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json" `; exports[`v8intrinsic.js [meriyah] format 1`] = ` "[3:1]: Unexpected token: '%' (3:1) 1 | // https://github.com/babel/babel/pull/10148 - 2 | + 2 | > 3 | %DebugPrint(foo); | ^ - 4 | - 5 | + 4 | + 5 | 6 | // Invalid code https://github.com/JLHwung/babel/blob/c1a3cbfd65e08b7013fd6f8c62add8cb10b4b169/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json" `; diff --git a/tests/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap index 912e5c4eb..5effef05e 100644 --- a/tests/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/binary-expressions/__snapshots__/jsfmt.spec.js.snap @@ -744,7 +744,7 @@ exports[`like-regexp.js [espree] format 1`] = ` "Unterminated regular expression (1:19) > 1 | 0 ? a : { b : 1 }/2; | ^ - 2 | " + 2 |" `; exports[`like-regexp.js format 1`] = ` diff --git a/tests/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap b/tests/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap index 1de03edb8..c5580b524 100644 --- a/tests/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/bind-expressions/__snapshots__/jsfmt.spec.js.snap @@ -7,7 +7,7 @@ exports[`await.js [espree] format 1`] = ` > 3 | return (await request)::doSyncThing(); | ^ 4 | }; - 5 | " + 5 |" `; exports[`await.js [meriyah] format 1`] = ` @@ -17,7 +17,7 @@ exports[`await.js [meriyah] format 1`] = ` > 3 | return (await request)::doSyncThing(); | ^ 4 | }; - 5 | " + 5 |" `; exports[`await.js - {"semi":false} [espree] format 1`] = ` @@ -27,7 +27,7 @@ exports[`await.js - {"semi":false} [espree] format 1`] = ` > 3 | return (await request)::doSyncThing(); | ^ 4 | }; - 5 | " + 5 |" `; exports[`await.js - {"semi":false} [meriyah] format 1`] = ` @@ -37,7 +37,7 @@ exports[`await.js - {"semi":false} [meriyah] format 1`] = ` > 3 | return (await request)::doSyncThing(); | ^ 4 | }; - 5 | " + 5 |" `; exports[`await.js - {"semi":false} format 1`] = ` diff --git a/tests/js/bom/__snapshots__/jsfmt.spec.js.snap b/tests/js/bom/__snapshots__/jsfmt.spec.js.snap index ea19003f7..b14dd255e 100644 --- a/tests/js/bom/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/bom/__snapshots__/jsfmt.spec.js.snap @@ -27,13 +27,13 @@ rangeStart: 11 | | printWidth =====================================input====================================== 1 | ο»Ώ - 2 | + 2 | > 3 | class a { | ^^^^ > 4 | b( <|> ) {} | ^^^^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== ο»Ώ @@ -55,15 +55,15 @@ rangeStart: 11 | | printWidth =====================================input====================================== 1 | ο»Ώ - 2 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x - 8 | + 8 | =====================================output===================================== ο»Ώ @@ -86,16 +86,16 @@ rangeStart: 12 | | printWidth =====================================input====================================== 1 | ο»Ώ - 2 | - 3 | + 2 | + 3 | > 4 | class a { | ^^^^ > 5 | b( <|> ) {} | ^^^^^^^^^^^^^^ 6 | } - 7 | + 7 | 8 | let x - 9 | + 9 | =====================================output===================================== ο»Ώ diff --git a/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap b/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap index d211bc9a1..439b8891e 100644 --- a/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap @@ -5,7 +5,7 @@ exports[`import.js [espree] format 1`] = ` > 1 | import(/* comment */) | ^ 2 | new import(/* comment */) - 3 | " + 3 |" `; exports[`import.js [flow] format 1`] = ` @@ -13,7 +13,7 @@ exports[`import.js [flow] format 1`] = ` > 1 | import(/* comment */) | ^ 2 | new import(/* comment */) - 3 | " + 3 |" `; exports[`import.js [meriyah] format 1`] = ` @@ -21,7 +21,7 @@ exports[`import.js [meriyah] format 1`] = ` > 1 | import(/* comment */) | ^ 2 | new import(/* comment */) - 3 | " + 3 |" `; exports[`import.js [typescript] format 1`] = ` @@ -29,7 +29,7 @@ exports[`import.js [typescript] format 1`] = ` 1 | import(/* comment */) > 2 | new import(/* comment */) | ^ - 3 | " + 3 |" `; exports[`import.js format 1`] = ` diff --git a/tests/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap b/tests/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap index ac500b314..67fe4bafd 100644 --- a/tests/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/classes-private-fields/__snapshots__/jsfmt.spec.js.snap @@ -3,37 +3,37 @@ exports[`optional-chaining.js [espree] format 1`] = ` "Unexpected character '#' (3:13) 1 | // https://github.com/babel/babel/pull/11669 - 2 | + 2 | > 3 | delete obj?.#x.a | ^ - 4 | " + 4 |" `; exports[`optional-chaining.js [meriyah] format 1`] = ` "[3:13]: Dot property must be an identifier (3:13) 1 | // https://github.com/babel/babel/pull/11669 - 2 | + 2 | > 3 | delete obj?.#x.a | ^ - 4 | " + 4 |" `; exports[`optional-chaining.js - {"semi":false} [espree] format 1`] = ` "Unexpected character '#' (3:13) 1 | // https://github.com/babel/babel/pull/11669 - 2 | + 2 | > 3 | delete obj?.#x.a | ^ - 4 | " + 4 |" `; exports[`optional-chaining.js - {"semi":false} [meriyah] format 1`] = ` "[3:13]: Dot property must be an identifier (3:13) 1 | // https://github.com/babel/babel/pull/11669 - 2 | + 2 | > 3 | delete obj?.#x.a | ^ - 4 | " + 4 |" `; exports[`optional-chaining.js - {"semi":false} format 1`] = ` @@ -78,7 +78,7 @@ exports[`private_fields.js [espree] format 1`] = ` > 1 | class A { #x; #y; } | ^ 2 | class B { #x = 0; #y = 1; } - 3 | + 3 | 4 | class C {" `; @@ -87,7 +87,7 @@ exports[`private_fields.js - {"semi":false} [espree] format 1`] = ` > 1 | class A { #x; #y; } | ^ 2 | class B { #x = 0; #y = 1; } - 3 | + 3 | 4 | class C {" `; diff --git a/tests/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap b/tests/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap index 97ffe2ef4..b0ab6e9d7 100644 --- a/tests/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/classes/top-level-super/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`example.js [espree] format 1`] = ` "'super' keyword outside a method (1:1) > 1 | super(); | ^ - 2 | " + 2 |" `; exports[`example.js [meriyah] format 1`] = ` "[1:6]: Calls to super must be in the \\"constructor\\" method of a class expression or class declaration that has a superclass (1:6) > 1 | super(); | ^ - 2 | " + 2 |" `; exports[`example.js format 1`] = ` diff --git a/tests/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap b/tests/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap index 3df1a940d..ab3787427 100644 --- a/tests/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/comments-pipeline-own-line/__snapshots__/jsfmt.spec.js.snap @@ -7,7 +7,7 @@ exports[`pipeline_own_line.js [espree] format 1`] = ` > 4 | |> x | ^ 5 | } - 6 | + 6 | 7 | bifornCringerMoshedPerplexSawder(" `; @@ -18,7 +18,7 @@ exports[`pipeline_own_line.js [meriyah] format 1`] = ` > 4 | |> x | ^ 5 | } - 6 | + 6 | 7 | bifornCringerMoshedPerplexSawder(" `; diff --git a/tests/js/cursor/__snapshots__/jsfmt.spec.js.snap b/tests/js/cursor/__snapshots__/jsfmt.spec.js.snap index 09262351b..459e006ec 100644 --- a/tests/js/cursor/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/cursor/__snapshots__/jsfmt.spec.js.snap @@ -315,10 +315,10 @@ rangeStart: 31 | | printWidth =====================================input====================================== 1 | thisWontBeFormatted ( 1 ,3) - 2 | + 2 | > 3 | thisWillBeFormatted <|> (2 ,3, ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> 4 | +> 4 | | ^ > 5 | thisWontBeFormatted (2, 90 ,) | ^ @@ -343,10 +343,10 @@ rangeStart: 31 | | printWidth =====================================input====================================== 1 | thisWontBeFormatted ( 1 ,3) - 2 | + 2 | > 3 | thisWillBeFormatted (2 ,3<|>, ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> 4 | +> 4 | | ^ > 5 | thisWontBeFormatted (2, 90 ,) | ^ @@ -371,10 +371,10 @@ rangeStart: 31 | | printWidth =====================================input====================================== 1 | thisWontBeFormatted ( 1 ,3) - 2 | + 2 | > 3 | thisWillBeFormatted (2 ,3, <|> ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> 4 | +> 4 | | ^ > 5 | thisWontBeFormatted (2, 90 ,) | ^ @@ -399,11 +399,11 @@ rangeStart: 30 | | printWidth =====================================input====================================== 1 | thisWontBeFormatted <|> ( 1 ,3) -> 2 | +> 2 | | ^ > 3 | thisWillBeFormatted (2 ,3, ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> 4 | +> 4 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > 5 | thisWontBeFormatted (2, 90 ,) | ^ @@ -428,10 +428,10 @@ rangeStart: 31 | | printWidth =====================================input====================================== 1 | thisWontBeFormatted ( 1 ,3) - 2 | + 2 | > 3 | thisWillBeFormatted (2 ,3, ) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -> 4 | +> 4 | | ^ > 5 | thisWontBeFormatted (2, 9<|>0 ,) | ^^^^ diff --git a/tests/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap b/tests/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap index c1fda3302..d28627f51 100644 --- a/tests/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/decorator-comments/__snapshots__/jsfmt.spec.js.snap @@ -17,7 +17,7 @@ exports[`comments.js [meriyah] format 1`] = ` > 4 | static property: Array; | ^ 5 | } - 6 | " + 6 |" `; exports[`comments.js format 1`] = ` diff --git a/tests/js/decorators-export/__snapshots__/jsfmt.spec.js.snap b/tests/js/decorators-export/__snapshots__/jsfmt.spec.js.snap index 403bcc68d..eabe686e0 100644 --- a/tests/js/decorators-export/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/decorators-export/__snapshots__/jsfmt.spec.js.snap @@ -4,18 +4,18 @@ exports[`after_export.js [espree] format 1`] = ` "Unexpected character '@' (1:8) > 1 | export @decorator class Foo {} | ^ - 2 | + 2 | 3 | export default @decorator class {} - 4 | " + 4 |" `; exports[`after_export.js [meriyah] format 1`] = ` "[1:8]: Unexpected token: '@' (1:8) > 1 | export @decorator class Foo {} | ^ - 2 | + 2 | 3 | export default @decorator class {} - 4 | " + 4 |" `; exports[`after_export.js format 1`] = ` @@ -45,7 +45,7 @@ exports[`before_export.js [espree] format 1`] = ` > 1 | @decorator | ^ 2 | export class Foo {} - 3 | + 3 | 4 | @decorator" `; diff --git a/tests/js/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/js/decorators/__snapshots__/jsfmt.spec.js.snap index 085fb5091..c63ccd585 100644 --- a/tests/js/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/decorators/__snapshots__/jsfmt.spec.js.snap @@ -4,9 +4,9 @@ exports[`classes.js [espree] format 1`] = ` "Unexpected character '@' (1:1) > 1 | @deco class Foo {} | ^ - 2 | + 2 | 3 | @deco export class Bar {} - 4 | " + 4 |" `; exports[`classes.js format 1`] = ` @@ -59,7 +59,7 @@ const bar = exports[`comments.js [espree] format 1`] = ` "Unexpected character '@' (3:1) 1 | var x = 100 - 2 | + 2 | > 3 | @Hello({ | ^ 4 | a: 'a', // Comment is in the wrong place @@ -140,12 +140,12 @@ export class Bar {} exports[`methods.js [espree] format 1`] = ` "Unexpected character '@' (3:3) - 1 | + 1 | 2 | class Yo { > 3 | @foo(\\"hello\\") | ^ 4 | async plop() {} - 5 | + 5 | 6 | @anotherDecoratorWithALongName(\\"and a very long string as a first argument\\")" `; @@ -184,7 +184,7 @@ class Yo { exports[`mixed.js [espree] format 1`] = ` "Unexpected character '@' (3:1) 1 | // https://github.com/prettier/prettier/issues/6747 - 2 | + 2 | > 3 | @foo | ^ 4 | export default class MyComponent { @@ -221,22 +221,22 @@ export default class MyComponent { exports[`mobx.js [espree] format 1`] = ` "Unexpected character '@' (3:1) 1 | import {observable} from \\"mobx\\"; - 2 | + 2 | > 3 | @observer class OrderLine { | ^ 4 | @observable price:number = 0; 5 | @observable amount:number = 1; - 6 | " + 6 |" `; exports[`mobx.js [meriyah] format 1`] = ` "[4:20]: Unexpected token: ':' (4:20) - 2 | + 2 | 3 | @observer class OrderLine { > 4 | @observable price:number = 0; | ^ 5 | @observable amount:number = 1; - 6 | + 6 | 7 | constructor(price) {" `; @@ -438,7 +438,7 @@ exports[`parens.js [espree] format 1`] = ` | ^ 3 | x 4 | } - 5 | " + 5 |" `; exports[`parens.js format 1`] = ` @@ -466,7 +466,7 @@ exports[`redux.js [espree] format 1`] = ` > 1 | @connect(mapStateToProps, mapDispatchToProps) | ^ 2 | export class MyApp extends React.Component {} - 3 | + 3 | 4 | @connect(state => ({ todos: state.todos }))" `; diff --git a/tests/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap b/tests/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap index 66f06ab32..e35226160 100644 --- a/tests/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/dynamic-import/__snapshots__/jsfmt.spec.js.snap @@ -4,28 +4,28 @@ exports[`assertions.js [espree] format 1`] = ` "Unexpected token , (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`assertions.js [flow] format 1`] = ` "Unexpected token \`,\`, expected the token \`)\` (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`assertions.js [meriyah] format 1`] = ` "[1:20]: Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`assertions.js [typescript] format 1`] = ` "Dynamic import must have one specifier as an argument. (1:8) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`assertions.js format 1`] = ` diff --git a/tests/js/eol/__snapshots__/jsfmt.spec.js.snap b/tests/js/eol/__snapshots__/jsfmt.spec.js.snap index 527b3d550..07f517f29 100644 --- a/tests/js/eol/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/eol/__snapshots__/jsfmt.spec.js.snap @@ -82,14 +82,14 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( <|> ) {} | ^^^^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== @@ -112,14 +112,14 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( <|> ) {} | ^^^^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== @@ -142,14 +142,14 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( <|> ) {} | ^^^^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== @@ -172,14 +172,14 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( <|> ) {} | ^^^^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== @@ -201,16 +201,16 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x - 8 | + 8 | =====================================output===================================== @@ -232,16 +232,16 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x - 8 | + 8 | =====================================output===================================== @@ -263,16 +263,16 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x - 8 | + 8 | =====================================output===================================== @@ -294,16 +294,16 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x - 8 | + 8 | =====================================output===================================== @@ -326,17 +326,17 @@ rangeEnd: 27 rangeStart: 11 | | printWidth =====================================input====================================== - 1 | - 2 | - 3 | + 1 | + 2 | + 3 | > 4 | class a { | ^^^^ > 5 | b( <|> ) {} | ^^^^^^^^^^^^^^ 6 | } - 7 | + 7 | 8 | let x - 9 | + 9 | =====================================output===================================== @@ -360,17 +360,17 @@ rangeEnd: 27 rangeStart: 11 | | printWidth =====================================input====================================== - 1 | - 2 | - 3 | + 1 | + 2 | + 3 | > 4 | class a { | ^^^^ > 5 | b( <|> ) {} | ^^^^^^^^^^^^^^ 6 | } - 7 | + 7 | 8 | let x - 9 | + 9 | =====================================output===================================== @@ -394,17 +394,17 @@ rangeEnd: 27 rangeStart: 11 | | printWidth =====================================input====================================== - 1 | - 2 | - 3 | + 1 | + 2 | + 3 | > 4 | class a { | ^^^^ > 5 | b( <|> ) {} | ^^^^^^^^^^^^^^ 6 | } - 7 | + 7 | 8 | let x - 9 | + 9 | =====================================output===================================== @@ -428,17 +428,17 @@ rangeEnd: 27 rangeStart: 11 | | printWidth =====================================input====================================== - 1 | - 2 | - 3 | + 1 | + 2 | + 3 | > 4 | class a { | ^^^^ > 5 | b( <|> ) {} | ^^^^^^^^^^^^^^ 6 | } - 7 | + 7 | 8 | let x - 9 | + 9 | =====================================output===================================== diff --git a/tests/js/exports/__snapshots__/jsfmt.spec.js.snap b/tests/js/exports/__snapshots__/jsfmt.spec.js.snap index 0d9be4fbf..9366302a9 100644 --- a/tests/js/exports/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/exports/__snapshots__/jsfmt.spec.js.snap @@ -3,23 +3,23 @@ exports[`test.js [espree] format 1`] = ` "Unexpected token a (3:8) 1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\"; - 2 | + 2 | > 3 | export a,{b} from \\"./baz\\"; | ^ - 4 | + 4 | 5 | export * as ns from \\"mod\\"; - 6 | " + 6 |" `; exports[`test.js [meriyah] format 1`] = ` "[3:8]: Unexpected token: 'identifier' (3:8) 1 | export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \\"exports\\"; - 2 | + 2 | > 3 | export a,{b} from \\"./baz\\"; | ^ - 4 | + 4 | 5 | export * as ns from \\"mod\\"; - 6 | " + 6 |" `; exports[`test.js format 1`] = ` diff --git a/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap b/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap index 1dfb06751..bd4aa50ec 100644 --- a/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/import-assertions/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`dynamic-import.js [espree] format 1`] = ` "Unexpected token , (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`dynamic-import.js [meriyah] format 1`] = ` "[1:20]: Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`dynamic-import.js format 1`] = ` @@ -34,7 +34,7 @@ exports[`empty.js [espree] format 1`] = ` > 2 | export * as bar from \\"bar.json\\" assert { } | ^ 3 | export * as baz from \\"baz.json\\" assert { /* comment */ } - 4 | + 4 | 5 | import * as foo from \\"foo.json\\"" `; @@ -44,7 +44,7 @@ exports[`empty.js [meriyah] format 1`] = ` > 2 | export * as bar from \\"bar.json\\" assert { } | ^ 3 | export * as baz from \\"baz.json\\" assert { /* comment */ } - 4 | + 4 | 5 | import * as foo from \\"foo.json\\"" `; @@ -77,14 +77,14 @@ exports[`multi-types.js [espree] format 1`] = ` "Unexpected token assert (1:31) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" }; | ^ - 2 | " + 2 |" `; exports[`multi-types.js [meriyah] format 1`] = ` "[1:36]: Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\", type: \\"bar\\" }; | ^ - 2 | " + 2 |" `; exports[`multi-types.js format 1`] = ` @@ -123,7 +123,7 @@ exports[`re-export.js [espree] format 1`] = ` | ^ 2 | export * from \\"foo.json\\" assert { type: \\"json\\" }; 3 | export * as foo3 from \\"foo.json\\" assert { type: \\"json\\" }; - 4 | " + 4 |" `; exports[`re-export.js [meriyah] format 1`] = ` @@ -132,7 +132,7 @@ exports[`re-export.js [meriyah] format 1`] = ` | ^ 2 | export * from \\"foo.json\\" assert { type: \\"json\\" }; 3 | export * as foo3 from \\"foo.json\\" assert { type: \\"json\\" }; - 4 | " + 4 |" `; exports[`re-export.js format 1`] = ` @@ -157,14 +157,14 @@ exports[`static-import.js [espree] format 1`] = ` "Unexpected token assert (1:31) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`static-import.js [meriyah] format 1`] = ` "[1:36]: Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`static-import.js format 1`] = ` @@ -185,14 +185,14 @@ exports[`without-from.js [espree] format 1`] = ` "Unexpected token assert (1:14) > 1 | import \\"foo\\" assert { type: \\"json\\" } | ^ - 2 | " + 2 |" `; exports[`without-from.js [meriyah] format 1`] = ` "[1:19]: Unexpected token: 'identifier' (1:19) > 1 | import \\"foo\\" assert { type: \\"json\\" } | ^ - 2 | " + 2 |" `; exports[`without-from.js format 1`] = ` diff --git a/tests/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap b/tests/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap index 3e06a9d9e..96bf68213 100644 --- a/tests/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/import-assertions/bracket-spacing/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`dynamic-import.js - {"bracketSpacing":false} [espree] format 1`] = ` "Unexpected token , (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`dynamic-import.js - {"bracketSpacing":false} [meriyah] format 1`] = ` "[1:20]: Expected ')' (1:20) > 1 | import(\\"./foo.json\\", { assert: { type: \\"json\\" } }); | ^ - 2 | " + 2 |" `; exports[`dynamic-import.js - {"bracketSpacing":false} format 1`] = ` @@ -59,14 +59,14 @@ exports[`re-export.js - {"bracketSpacing":false} [espree] format 1`] = ` "Unexpected token assert (1:33) > 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`re-export.js - {"bracketSpacing":false} [meriyah] format 1`] = ` "[1:38]: Unexpected token: 'identifier' (1:38) > 1 | export { foo2 } from \\"foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`re-export.js - {"bracketSpacing":false} format 1`] = ` @@ -88,14 +88,14 @@ exports[`static-import.js - {"bracketSpacing":false} [espree] format 1`] = ` "Unexpected token assert (1:31) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`static-import.js - {"bracketSpacing":false} [meriyah] format 1`] = ` "[1:36]: Unexpected token: 'identifier' (1:36) > 1 | import json from \\"./foo.json\\" assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`static-import.js - {"bracketSpacing":false} format 1`] = ` diff --git a/tests/js/invalid-code/__snapshots__/jsfmt.spec.js.snap b/tests/js/invalid-code/__snapshots__/jsfmt.spec.js.snap index 5b5a129e1..dce8de945 100644 --- a/tests/js/invalid-code/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/invalid-code/__snapshots__/jsfmt.spec.js.snap @@ -4,7 +4,7 @@ exports[`duplicate_bindings.js [espree] format 1`] = ` "Identifier 'A' has already been declared (1:19) > 1 | class A{} class A{} | ^ - 2 | " + 2 |" `; exports[`duplicate_bindings.js format 1`] = ` diff --git a/tests/js/literal/__snapshots__/jsfmt.spec.js.snap b/tests/js/literal/__snapshots__/jsfmt.spec.js.snap index c57ee6471..5f5daa18c 100644 --- a/tests/js/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/literal/__snapshots__/jsfmt.spec.js.snap @@ -4,21 +4,21 @@ exports[`invalid-exponent.js [espree] format 1`] = ` "Invalid number (1:1) > 1 | 12.3e | ^ - 2 | " + 2 |" `; exports[`invalid-exponent.js [meriyah] format 1`] = ` "[1:5]: Non-number found after exponent indicator (1:5) > 1 | 12.3e | ^ - 2 | " + 2 |" `; exports[`invalid-exponent.js [typescript] format 1`] = ` "Digit expected. (1:6) > 1 | 12.3e | ^ - 2 | " + 2 |" `; exports[`invalid-exponent.js format 1`] = ` @@ -42,7 +42,7 @@ exports[`number.js [espree] format 1`] = ` | ^ 3 | return (100).toString(); 4 | } - 5 | " + 5 |" `; exports[`number.js [meriyah] format 1`] = ` @@ -52,7 +52,7 @@ exports[`number.js [meriyah] format 1`] = ` | ^ 3 | return (100).toString(); 4 | } - 5 | " + 5 |" `; exports[`number.js format 1`] = ` diff --git a/tests/js/logical-assignment/__snapshots__/jsfmt.spec.js.snap b/tests/js/logical-assignment/__snapshots__/jsfmt.spec.js.snap index 20ffcc223..4ea6b04c8 100644 --- a/tests/js/logical-assignment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/logical-assignment/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`invalid.js [espree] format 1`] = ` "Assigning to rvalue (1:21) > 1 | c.foo.bar().baz ??= result.foo.bar().baz(a.baz) &&= result.baz; | ^ - 2 | " + 2 |" `; exports[`invalid.js [meriyah] format 1`] = ` "[1:19]: Unexpected token: '=' (1:19) > 1 | c.foo.bar().baz ??= result.foo.bar().baz(a.baz) &&= result.baz; | ^ - 2 | " + 2 |" `; exports[`invalid.js format 1`] = ` @@ -32,7 +32,7 @@ exports[`logical-assignment.js [meriyah] format 1`] = ` "[1:5]: Unexpected token: '=' (1:5) > 1 | a ||= b; | ^ - 2 | + 2 | 3 | a &&= \\"foo\\"; 4 | b ||= \\"foo\\";" `; diff --git a/tests/js/module-string-names/__snapshots__/jsfmt.spec.js.snap b/tests/js/module-string-names/__snapshots__/jsfmt.spec.js.snap index 2dab89f0b..d1334de2d 100644 --- a/tests/js/module-string-names/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/module-string-names/__snapshots__/jsfmt.spec.js.snap @@ -55,7 +55,7 @@ exports[`module-string-names-import.js [espree] format 1`] = ` | ^ 2 | import { \\"foo\\" as bar, \\"default\\" as qux } from \\"module-a\\"; 3 | import { \\"ε­Έθ€Œζ™‚ηΏ’δΉ‹οΌŒδΈδΊ¦θͺͺ乎?\\" as quotation } from \\"Confucius\\"; - 4 | " + 4 |" `; exports[`module-string-names-import.js [meriyah] format 1`] = ` @@ -64,7 +64,7 @@ exports[`module-string-names-import.js [meriyah] format 1`] = ` | ^ 2 | import { \\"foo\\" as bar, \\"default\\" as qux } from \\"module-a\\"; 3 | import { \\"ε­Έθ€Œζ™‚ηΏ’δΉ‹οΌŒδΈδΊ¦θͺͺ乎?\\" as quotation } from \\"Confucius\\"; - 4 | " + 4 |" `; exports[`module-string-names-import.js format 1`] = ` diff --git a/tests/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap b/tests/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap index c5f782e1e..45c5ec714 100644 --- a/tests/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/multiparser-invalid/__snapshots__/jsfmt.spec.js.snap @@ -7,7 +7,7 @@ exports[`text.js [espree] format 1`] = ` > 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`; | ^ 7 | foo = /* GraphQL */\`\\\\u{prettier}\\\\u{0065}\`; - 8 | + 8 | 9 | foo = foo\`\\\\u{prettier}\${foo}pr\\\\u{0065}ttier\`;" `; @@ -27,7 +27,7 @@ exports[`text.js [meriyah] format 1`] = ` > 6 | foo = /* HTML */\`\\\\u{prettier}\\\\u{0065}\`; | ^ 7 | foo = /* GraphQL */\`\\\\u{prettier}\\\\u{0065}\`; - 8 | + 8 | 9 | foo = foo\`\\\\u{prettier}\${foo}pr\\\\u{0065}ttier\`;" `; diff --git a/tests/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap b/tests/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap index 1419ffdcc..874fb43cd 100644 --- a/tests/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/no-semi-babylon-extensions/__snapshots__/jsfmt.spec.js.snap @@ -5,7 +5,7 @@ exports[`no-semi.js [espree] format 1`] = ` 1 | a > 2 | ;::b.c | ^ - 3 | + 3 | 4 | class A { 5 | a = b;" `; @@ -15,7 +15,7 @@ exports[`no-semi.js [meriyah] format 1`] = ` 1 | a > 2 | ;::b.c | ^ - 3 | + 3 | 4 | class A { 5 | a = b;" `; @@ -25,7 +25,7 @@ exports[`no-semi.js - {"semi":false} [espree] format 1`] = ` 1 | a > 2 | ;::b.c | ^ - 3 | + 3 | 4 | class A { 5 | a = b;" `; @@ -35,7 +35,7 @@ exports[`no-semi.js - {"semi":false} [meriyah] format 1`] = ` 1 | a > 2 | ;::b.c | ^ - 3 | + 3 | 4 | class A { 5 | a = b;" `; diff --git a/tests/js/no-semi/__snapshots__/jsfmt.spec.js.snap b/tests/js/no-semi/__snapshots__/jsfmt.spec.js.snap index ec3792c20..609486589 100644 --- a/tests/js/no-semi/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/no-semi/__snapshots__/jsfmt.spec.js.snap @@ -2,7 +2,7 @@ exports[`class.js [espree] format 1`] = ` "Unexpected token ; (12:6) - 10 | + 10 | 11 | class C1 { > 12 | get; // The semicolon *is* necessary | ^ @@ -13,7 +13,7 @@ exports[`class.js [espree] format 1`] = ` exports[`class.js - {"semi":false} [espree] format 1`] = ` "Unexpected token ; (12:6) - 10 | + 10 | 11 | class C1 { > 12 | get; // The semicolon *is* necessary | ^ diff --git a/tests/js/objects/__snapshots__/jsfmt.spec.js.snap b/tests/js/objects/__snapshots__/jsfmt.spec.js.snap index 83bc1d99c..a1cdce27f 100644 --- a/tests/js/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/objects/__snapshots__/jsfmt.spec.js.snap @@ -153,7 +153,7 @@ exports[`getter-setter.js [espree] format 1`] = ` > 3 | ({ set x() {} }); | ^ 4 | ({ get x(x) {} }); - 5 | " + 5 |" `; exports[`getter-setter.js [meriyah] format 1`] = ` @@ -163,7 +163,7 @@ exports[`getter-setter.js [meriyah] format 1`] = ` > 3 | ({ set x() {} }); | ^ 4 | ({ get x(x) {} }); - 5 | " + 5 |" `; exports[`getter-setter.js format 1`] = ` @@ -192,7 +192,7 @@ printWidth: 80 exports[`invalid-accessor-generator.js [espree] format 1`] = ` "Unexpected token * (5:9) - 3 | + 3 | 4 | ({ > 5 | get *iterator() { }, | ^ @@ -203,7 +203,7 @@ exports[`invalid-accessor-generator.js [espree] format 1`] = ` exports[`invalid-accessor-generator.js [meriyah] format 1`] = ` "[5:9]: A getter cannot be a generator (5:9) - 3 | + 3 | 4 | ({ > 5 | get *iterator() { }, | ^ @@ -214,7 +214,7 @@ exports[`invalid-accessor-generator.js [meriyah] format 1`] = ` exports[`invalid-accessor-generator.js [typescript] format 1`] = ` "Identifier expected. (5:9) - 3 | + 3 | 4 | ({ > 5 | get *iterator() { }, | ^ @@ -257,14 +257,14 @@ exports[`invalid-setter.js [espree] format 1`] = ` "setter should have exactly one param (1:9) > 1 | ({ set x(){} }); | ^ - 2 | " + 2 |" `; exports[`invalid-setter.js [meriyah] format 1`] = ` "[1:10]: Setter functions must have exactly one argument (1:10) > 1 | ({ set x(){} }); | ^ - 2 | " + 2 |" `; exports[`invalid-setter.js format 1`] = ` diff --git a/tests/js/partial-application/__snapshots__/jsfmt.spec.js.snap b/tests/js/partial-application/__snapshots__/jsfmt.spec.js.snap index 4d92092e5..6ce064d39 100644 --- a/tests/js/partial-application/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/partial-application/__snapshots__/jsfmt.spec.js.snap @@ -5,7 +5,7 @@ exports[`test.js [espree] format 1`] = ` > 1 | const addOne = add(1, ?); // apply from the left | ^ 2 | addOne(2); // 3 - 3 | + 3 | 4 | const addTen = add(?, 10); // apply from the right" `; @@ -14,7 +14,7 @@ exports[`test.js [meriyah] format 1`] = ` > 1 | const addOne = add(1, ?); // apply from the left | ^ 2 | addOne(2); // 3 - 3 | + 3 | 4 | const addTen = add(?, 10); // apply from the right" `; diff --git a/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap b/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap index a25032b01..7dcac40c0 100644 --- a/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap @@ -163,18 +163,18 @@ exports[`minimal_pipeline_operator.js [espree] format 1`] = ` "Unexpected token > (1:4) > 1 | a |> b |> c; | ^ - 2 | + 2 | 3 | a |> (b |> c); - 4 | " + 4 |" `; exports[`minimal_pipeline_operator.js [meriyah] format 1`] = ` "[1:4]: Unexpected token: '>' (1:4) > 1 | a |> b |> c; | ^ - 2 | + 2 | 3 | a |> (b |> c); - 4 | " + 4 |" `; exports[`minimal_pipeline_operator.js format 1`] = ` @@ -292,7 +292,7 @@ exports[`smart_pipeline_operator.js [espree] format 1`] = ` "Unexpected token > (1:4) > 1 | a |> await # |> # * 3; | ^ - 2 | + 2 | 3 | foo 4 | |> await #" `; @@ -301,7 +301,7 @@ exports[`smart_pipeline_operator.js [meriyah] format 1`] = ` "[1:4]: Unexpected token: '>' (1:4) > 1 | a |> await # |> # * 3; | ^ - 2 | + 2 | 3 | foo 4 | |> await #" `; diff --git a/tests/js/private-in/__snapshots__/jsfmt.spec.js.snap b/tests/js/private-in/__snapshots__/jsfmt.spec.js.snap index d2d8b4cf8..c4a9c07ae 100644 --- a/tests/js/private-in/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/private-in/__snapshots__/jsfmt.spec.js.snap @@ -5,7 +5,7 @@ exports[`private-in.js [espree] format 1`] = ` > 1 | if (#prop in obj) { | ^ 2 | } - 3 | + 3 | 4 | #prop in obj;" `; diff --git a/tests/js/quote-props/__snapshots__/jsfmt.spec.js.snap b/tests/js/quote-props/__snapshots__/jsfmt.spec.js.snap index 83682b792..23a2343d8 100644 --- a/tests/js/quote-props/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/quote-props/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`classes.js - {"quoteProps":"as-needed"} [espree] format 1`] = ` > 2 | a = \\"a\\" | ^ 3 | }; - 4 | + 4 | 5 | class B {" `; @@ -63,7 +63,7 @@ exports[`classes.js - {"quoteProps":"consistent","singleQuote":true} [espree] fo > 2 | a = \\"a\\" | ^ 3 | }; - 4 | + 4 | 5 | class B {" `; @@ -121,7 +121,7 @@ exports[`classes.js - {"quoteProps":"consistent"} [espree] format 1`] = ` > 2 | a = \\"a\\" | ^ 3 | }; - 4 | + 4 | 5 | class B {" `; @@ -178,7 +178,7 @@ exports[`classes.js - {"quoteProps":"preserve"} [espree] format 1`] = ` > 2 | a = \\"a\\" | ^ 3 | }; - 4 | + 4 | 5 | class B {" `; diff --git a/tests/js/range/__snapshots__/jsfmt.spec.js.snap b/tests/js/range/__snapshots__/jsfmt.spec.js.snap index 4378d8da2..6daa8552c 100644 --- a/tests/js/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/range/__snapshots__/jsfmt.spec.js.snap @@ -12,11 +12,11 @@ rangeStart: 8 2 | , > 3 | ,,,, | ^^^^ -> 4 | +> 4 | | ^ > 5 | , | ^ -> 6 | +> 6 | | ^ 7 | , 8 | a, @@ -39,7 +39,7 @@ rangeStart: 13 2 | // The range will be 13~26 3 | // \`foo\` ends at 13, should not format 4 | // \`bar\` ends at 26, should format - 5 | + 5 | =====================================output===================================== foo = 1.0000;bar = 1.0;baz=1.0000; // The range will be 13~26 @@ -66,9 +66,9 @@ rangeStart: 28 | ^^^^^^^^^^^^^^^^^ 7 | ); d( 8 | ); - 9 | + 9 | 10 | } - 11 | + 11 | =====================================output===================================== function a( ){ @@ -96,7 +96,7 @@ rangeStart: 13 | ^^^^^^^^^^^^^^^^^ 5 | ); d( 6 | ); - 7 | + 7 | =====================================output===================================== a ( ); @@ -116,14 +116,14 @@ rangeEnd: 26 rangeStart: 10 | | printWidth =====================================input====================================== - 1 | - 2 | + 1 | + 2 | > 3 | class a { | ^^^^ > 4 | b( ) {} | ^^^^^^^^^^^ 5 | } - 6 | + 6 | 7 | let x =====================================output===================================== @@ -152,7 +152,7 @@ rangeStart: 19 > 4 | call(1,2,3) | ^^^^^^^^^ 5 | } - 6 | + 6 | =====================================output===================================== call(1,2,3) call(1, 2, 3); @@ -174,7 +174,7 @@ rangeStart: 0 > 1 | 'aaa'; | ^ 2 | 'bbb'; - 3 | + 3 | =====================================output===================================== "aaa"; 'bbb'; @@ -192,7 +192,7 @@ rangeStart: 16 =====================================input====================================== > 1 | function ugly ( {a=1, b = 2 } ) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - 2 | + 2 | =====================================output===================================== function ugly({ a = 1, b = 2 }) {} @@ -216,7 +216,7 @@ rangeStart: 222 6 | } 7 | } 8 | } - 9 | + 9 | =====================================output===================================== function ugly ( {a=1, b = 2 } ) { function ugly ( {a=1, b = 2 } ) { @@ -243,12 +243,12 @@ rangeStart: 17 | ^^^^^^^^^^^^^^ 3 | return 1; 4 | } - 5 | + 5 | 6 | dontTouchThis(){ 7 | return 2 ; 8 | } 9 | } - 10 | + 10 | =====================================output===================================== export class F { reformatThis() { @@ -276,12 +276,12 @@ rangeStart: 17 | ^ 3 | return 1; 4 | } - 5 | + 5 | 6 | dontTouchThis(){ 7 | return 2 ; 8 | } 9 | } - 10 | + 10 | =====================================output===================================== export class F { reformatThis() { @@ -309,7 +309,7 @@ rangeStart: 16 > 2 | /**/ | ^^^^ 3 | } - 4 | + 4 | =====================================output===================================== export default class Foo { /**/ @@ -330,7 +330,7 @@ rangeStart: 16 | ^^^^^^^^^^^^^^ 2 | /**/ 3 | } - 4 | + 4 | =====================================output===================================== export default function Foo() { /**/ @@ -353,7 +353,7 @@ rangeStart: 16 | ^^^^ > 3 | } | ^ - 4 | + 4 | =====================================output===================================== /* */ function Foo() { /**/ @@ -375,7 +375,7 @@ rangeStart: 17 | ^^^^ > 3 | } | ^ - 4 | + 4 | =====================================output===================================== /* */ class Foo { /**/ @@ -397,7 +397,7 @@ rangeStart: 29 > 2 | color: blue; | ^^^^^ 3 | \`; - 4 | + 4 | =====================================output===================================== export const Button = styled.button\` color: blue; @@ -425,7 +425,7 @@ rangeStart: 80 | ^^^^^^^^^^^^^^^^^^^ 7 | }; 8 | } - 9 | + 9 | =====================================output===================================== function ugly() { const dictWithSeveralEntries = { @@ -448,16 +448,16 @@ rangeStart: 45 | | printWidth =====================================input====================================== 1 | import def , {named} from 'x' - 2 | + 2 | > 3 | export * from 'd' | ^^^^^^^^^^^ - 4 | + 4 | 5 | export const x 6 | = 42 - 7 | + 7 | 8 | export default 42 - 9 | - 10 | + 9 | + 10 | =====================================output===================================== import def , {named} from 'x' @@ -481,18 +481,18 @@ rangeStart: 57 | | printWidth =====================================input====================================== 1 | import def , {named} from 'x' - 2 | + 2 | 3 | export * from 'd' -> 4 | +> 4 | | ^ > 5 | export const x | ^^^^^^^^^^^^^^^^^^ > 6 | = 42 | ^^ - 7 | + 7 | 8 | export default 42 - 9 | - 10 | + 9 | + 10 | =====================================output===================================== import def , {named} from 'x' @@ -515,16 +515,16 @@ rangeStart: 104 | | printWidth =====================================input====================================== 1 | import def , {named} from 'x' - 2 | + 2 | 3 | export * from 'd' - 4 | + 4 | 5 | export const x 6 | = 42 - 7 | + 7 | > 8 | export default 42 | ^^^^ - 9 | - 10 | + 9 | + 10 | =====================================output===================================== import def , {named} from 'x' @@ -549,15 +549,15 @@ rangeStart: 7 =====================================input====================================== > 1 | import def , {named} from 'x' | ^^^^^^^^^^^^^^^ - 2 | + 2 | 3 | export * from 'd' - 4 | + 4 | 5 | export const x 6 | = 42 - 7 | + 7 | 8 | export default 42 - 9 | - 10 | + 9 | + 10 | =====================================output===================================== import def, { named } from "x"; @@ -583,24 +583,24 @@ rangeStart: 30 1 | call( 2 | 1, 2,3 3 | ); - 4 | + 4 | 5 | call( > 6 | 1, 2,3 | ^^^ > 7 | ); | ^^ -> 8 | +> 8 | | ^^ > 9 | call( | ^^ > 10 | 1, 2,3 | ^^^^^ 11 | ); - 12 | + 12 | 13 | call( 14 | 1, 2,3 15 | ); - 16 | + 16 | =====================================output===================================== call( 1, 2,3 @@ -628,7 +628,7 @@ rangeStart: 18 1 | call( 2 | 1, 2,3 3 | ); -> 4 | +> 4 | | ^ > 5 | call( | ^^^^^ @@ -636,7 +636,7 @@ rangeStart: 18 | ^^^^^ > 7 | ); | ^^^^^ -> 8 | +> 8 | | ^^^^^ > 9 | call( | ^^^^^ @@ -644,12 +644,12 @@ rangeStart: 18 | ^^^^^ > 11 | ); | ^^^^^ -> 12 | +> 12 | | ^ 13 | call( 14 | 1, 2,3 15 | ); - 16 | + 16 | =====================================output===================================== call( 1, 2,3 @@ -684,7 +684,7 @@ rangeStart: 0 | ^^^ 5 | } 6 | catch (err) {} - 7 | + 7 | =====================================output===================================== try { if (condition) { @@ -711,7 +711,7 @@ rangeStart: 28 > 4 | } | ^^ 5 | } - 6 | + 6 | =====================================output===================================== function f() { if (true) { @@ -739,7 +739,7 @@ rangeStart: 9 | ^^^ 5 | } 6 | catch (err) {} - 7 | + 7 | =====================================output===================================== try { if (condition) { @@ -768,7 +768,7 @@ rangeStart: 9 | ^^^ 5 | } 6 | catch (err) {} - 7 | + 7 | =====================================output===================================== try { 1;if (condition) { @@ -790,7 +790,7 @@ rangeStart: 11 =====================================input====================================== > 1 | const y = {a:1, b:2} | ^^^ - 2 | + 2 | =====================================output===================================== const y = { a: 1, b: 2 }; @@ -805,7 +805,7 @@ rangeEnd: 104 rangeStart: 53 | | printWidth =====================================input====================================== - 1 | + 1 | 2 | const y = [ 3 | { 4 | a: 1, @@ -820,7 +820,7 @@ rangeStart: 53 > 9 | }, | ^^^^^^ 10 | ] - 11 | + 11 | =====================================output===================================== const y = [ @@ -853,7 +853,7 @@ rangeStart: 224 6 | } 7 | } 8 | } - 9 | + 9 | =====================================output===================================== function ugly ( {a=1, b = 2 } ) { function ugly ( {a=1, b = 2 } ) { @@ -879,8 +879,8 @@ rangeStart: 32 2 | call( 3 | 1, 2,3 4 | ); - 5 | -> 6 | + 5 | +> 6 | | ^ > 7 | call( | ^^^^^ @@ -913,14 +913,14 @@ rangeStart: 0 | ^^^^^^^^ > 3 | ); | ^^^^^^^^ -> 4 | +> 4 | | ^ - 5 | + 5 | 6 | // Unchanged 7 | call( 8 | 1, 2,3 9 | ); - 10 | + 10 | =====================================output===================================== call(1, 2, 3); @@ -944,7 +944,7 @@ rangeStart: 26 > 1 | foo = 1.0000;bar = 1.0000;baz=1.0000; | ^^^^^^^^^^^^^ [Reversed range] 2 | // The range will be 26~13, should not format anything - 3 | + 3 | =====================================output===================================== foo = 1.0000;bar = 1.0000;baz=1.0000; // The range will be 26~13, should not format anything @@ -963,7 +963,7 @@ rangeStart: 13 > 1 | foo = 1.0000;bar = 1.0000;baz=1.0000; | ^ 2 | // The range will be 13~13, should not format anything - 3 | + 3 | =====================================output===================================== foo = 1.0000;bar = 1.0000;baz=1.0000; // The range will be 13~13, should not format anything @@ -982,7 +982,7 @@ rangeStart: 7 1 | try {} > 2 | catch (err) {} | ^ - 3 | + 3 | =====================================output===================================== try { } catch (err) {} @@ -1000,7 +1000,7 @@ rangeStart: 0 =====================================input====================================== > 1 | | ^ - 2 | + 2 | =====================================output===================================== diff --git a/tests/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/js/record/__snapshots__/jsfmt.spec.js.snap index 71e89b736..76ae79cde 100644 --- a/tests/js/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/record/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`computed.js [espree] format 1`] = ` > 2 | assert(#{ [key]: 1 } === #{ a: 1 }) | ^ 3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 }) - 4 | + 4 | 5 | assert(#{ [true]: 1 } === #{ true: 1 })" `; @@ -16,7 +16,7 @@ exports[`computed.js [meriyah] format 1`] = ` > 2 | assert(#{ [key]: 1 } === #{ a: 1 }) | ^ 3 | assert(#{ [key.toUpperCase()]: 1 } === #{ A: 1 }) - 4 | + 4 | 5 | assert(#{ [true]: 1 } === #{ true: 1 })" `; @@ -56,7 +56,7 @@ exports[`destructuring.js [espree] format 1`] = ` | ^ 2 | assert(a === 1); 3 | assert(b === 2); - 4 | " + 4 |" `; exports[`destructuring.js [meriyah] format 1`] = ` @@ -65,7 +65,7 @@ exports[`destructuring.js [meriyah] format 1`] = ` | ^ 2 | assert(a === 1); 3 | assert(b === 2); - 4 | " + 4 |" `; exports[`destructuring.js format 1`] = ` @@ -101,7 +101,7 @@ assert(rest.c === 3); exports[`invalid-record-method.js [espree] format 1`] = ` "Unexpected character '#' (3:1) 1 | // Invalid, https://github.com/babel/babel/pull/11652/ - 2 | + 2 | > 3 | #{ | ^ 4 | a() {}, @@ -112,7 +112,7 @@ exports[`invalid-record-method.js [espree] format 1`] = ` exports[`invalid-record-method.js [meriyah] format 1`] = ` "[3:1]: '#' not followed by identifier (3:1) 1 | // Invalid, https://github.com/babel/babel/pull/11652/ - 2 | + 2 | > 3 | #{ | ^ 4 | a() {}, @@ -218,7 +218,7 @@ exports[`shorthand.js [espree] format 1`] = ` > 2 | const record = #{ url } | ^ 3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple - 4 | " + 4 |" `; exports[`shorthand.js [meriyah] format 1`] = ` @@ -227,7 +227,7 @@ exports[`shorthand.js [meriyah] format 1`] = ` > 2 | const record = #{ url } | ^ 3 | console.log(record.url) // https://github.com/tc39/proposal-record-tuple - 4 | " + 4 |" `; exports[`shorthand.js format 1`] = ` @@ -254,7 +254,7 @@ exports[`spread.js [espree] format 1`] = ` | ^ 2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData } 3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" } - 4 | " + 4 |" `; exports[`spread.js [meriyah] format 1`] = ` @@ -263,7 +263,7 @@ exports[`spread.js [meriyah] format 1`] = ` | ^ 2 | const taskNow = #{ id: 42, status: \\"WIP\\", ...formData } 3 | const taskLater = #{ ...taskNow, status: \\"DONE\\" } - 4 | " + 4 |" `; exports[`spread.js format 1`] = ` @@ -296,7 +296,7 @@ exports[`syntax.js [espree] format 1`] = ` | ^ 2 | #{ a: 1, b: 2 } 3 | #{ a: 1, b: #[2, 3, #{ c: 4 }] } - 4 | " + 4 |" `; exports[`syntax.js [meriyah] format 1`] = ` @@ -305,7 +305,7 @@ exports[`syntax.js [meriyah] format 1`] = ` | ^ 2 | #{ a: 1, b: 2 } 3 | #{ a: 1, b: #[2, 3, #{ c: 4 }] } - 4 | " + 4 |" `; exports[`syntax.js format 1`] = ` diff --git a/tests/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap b/tests/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap index 4d2513a7d..755a9af74 100644 --- a/tests/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/throw_expressions/__snapshots__/jsfmt.spec.js.snap @@ -4,7 +4,7 @@ exports[`throw_expression.js [espree] format 1`] = ` "Unexpected token throw (1:26) > 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {} | ^ - 2 | + 2 | 3 | lint(ast, { 4 | with: () => throw new Error(\\"avoid using 'with' statements.\\")" `; @@ -13,7 +13,7 @@ exports[`throw_expression.js [meriyah] format 1`] = ` "[1:30]: Unexpected token: 'throw' (1:30) > 1 | function save(filename = throw new TypeError(\\"Argument required\\")) {} | ^ - 2 | + 2 | 3 | lint(ast, { 4 | with: () => throw new Error(\\"avoid using 'with' statements.\\")" `; diff --git a/tests/js/top-level-await/__snapshots__/jsfmt.spec.js.snap b/tests/js/top-level-await/__snapshots__/jsfmt.spec.js.snap index 937de6b84..1ab9ae795 100644 --- a/tests/js/top-level-await/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/top-level-await/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`example.js [espree] format 1`] = ` "Cannot use keyword 'await' outside an async function (1:1) > 1 | await something(); | ^ - 2 | " + 2 |" `; exports[`example.js [meriyah] format 1`] = ` "[1:5]: 'Await' may not be used as an identifier in this context (1:5) > 1 | await something(); | ^ - 2 | " + 2 |" `; exports[`example.js format 1`] = ` diff --git a/tests/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap index f4f990be5..4f337ad8f 100644 --- a/tests/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/trailing-whitespace/__snapshots__/jsfmt.spec.js.snap @@ -4,7 +4,7 @@ exports[`trailing.js [espree] format 1`] = ` "Unexpected token type (1:8) > 1 | export type Result = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; | ^ - 2 | + 2 | 3 | // Note: there are trailing whitespace in this file 4 | \`" `; @@ -13,7 +13,7 @@ exports[`trailing.js [meriyah] format 1`] = ` "[1:11]: Unexpected token: 'identifier' (1:11) > 1 | export type Result = | { kind: \\"not-test-editor1\\" } | { kind: \\"not-test-editor2\\" }; | ^ - 2 | + 2 | 3 | // Note: there are trailing whitespace in this file 4 | \`" `; diff --git a/tests/js/tuple/__snapshots__/jsfmt.spec.js.snap b/tests/js/tuple/__snapshots__/jsfmt.spec.js.snap index 0f922022f..8edda8574 100644 --- a/tests/js/tuple/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/tuple/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`destructuring.js [espree] format 1`] = ` | ^ 2 | assert(a === 1); 3 | assert(b === 2); - 4 | " + 4 |" `; exports[`destructuring.js [meriyah] format 1`] = ` @@ -15,7 +15,7 @@ exports[`destructuring.js [meriyah] format 1`] = ` | ^ 2 | assert(a === 1); 3 | assert(b === 2); - 4 | " + 4 |" `; exports[`destructuring.js format 1`] = ` @@ -52,21 +52,21 @@ exports[`invalid-tuple-holes.js [babel] format 1`] = ` "Unexpected token ',' (1:4) > 1 | #[,] | ^ - 2 | " + 2 |" `; exports[`invalid-tuple-holes.js [espree] format 1`] = ` "Unexpected character '#' (1:1) > 1 | #[,] | ^ - 2 | " + 2 |" `; exports[`invalid-tuple-holes.js [meriyah] format 1`] = ` "[1:1]: '#' not followed by identifier (1:1) > 1 | #[,] | ^ - 2 | " + 2 |" `; exports[`syntax.js [espree] format 1`] = ` @@ -75,7 +75,7 @@ exports[`syntax.js [espree] format 1`] = ` | ^ 2 | #[1, 2] 3 | #[1, 2, #{ a: 3 }] - 4 | " + 4 |" `; exports[`syntax.js [meriyah] format 1`] = ` @@ -84,7 +84,7 @@ exports[`syntax.js [meriyah] format 1`] = ` | ^ 2 | #[1, 2] 3 | #[1, 2, #{ a: 3 }] - 4 | " + 4 |" `; exports[`syntax.js format 1`] = ` @@ -109,18 +109,18 @@ exports[`tuple.js [espree] format 1`] = ` "Unexpected character '#' (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ - 2 | + 2 | 3 | assert(tuple1[0] === 1); - 4 | " + 4 |" `; exports[`tuple.js [meriyah] format 1`] = ` "[1:16]: '#' not followed by identifier (1:16) > 1 | const tuple1 = #[1, 2, 3]; | ^ - 2 | + 2 | 3 | assert(tuple1[0] === 1); - 4 | " + 4 |" `; exports[`tuple.js format 1`] = ` @@ -173,14 +173,14 @@ exports[`tuple-trailing-comma.js [espree] format 1`] = ` "Unexpected character '#' (1:1) > 1 | #[1,] | ^ - 2 | " + 2 |" `; exports[`tuple-trailing-comma.js [meriyah] format 1`] = ` "[1:1]: '#' not followed by identifier (1:1) > 1 | #[1,] | ^ - 2 | " + 2 |" `; exports[`tuple-trailing-comma.js format 1`] = ` diff --git a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap index 12ff04f0f..cdac36197 100644 --- a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap @@ -4,21 +4,21 @@ exports[`invalid-const.js [espree] format 1`] = ` "Unexpected token ; (1:10) > 1 | const foo; | ^ - 2 | " + 2 |" `; exports[`invalid-const.js [flow] format 1`] = ` "Const must be initialized (1:7) > 1 | const foo; | ^^^ - 2 | " + 2 |" `; exports[`invalid-const.js [meriyah] format 1`] = ` "[1:10]: Missing initializer in const declaration (1:10) > 1 | const foo; | ^ - 2 | " + 2 |" `; exports[`invalid-const.js format 1`] = ` diff --git a/tests/json/range/__snapshots__/jsfmt.spec.js.snap b/tests/json/range/__snapshots__/jsfmt.spec.js.snap index 53f26719a..dcdef5f99 100644 --- a/tests/json/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/json/range/__snapshots__/jsfmt.spec.js.snap @@ -10,7 +10,7 @@ rangeStart: 1 =====================================input====================================== > 1 | {"a":1, "b":2} | ^^^ - 2 | + 2 | =====================================output===================================== {"a":1, "b":2} @@ -27,7 +27,7 @@ rangeStart: 5 =====================================input====================================== > 1 | {"a":1, "b":2} | ^ - 2 | + 2 | =====================================output===================================== {"a":1, "b":2} diff --git a/tests/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap index dbf1f0a6c..770a98581 100644 --- a/tests/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap @@ -3,17 +3,17 @@ exports[`async-arrow-invalid.js [babel] format 1`] = ` "Type parameters must come after the async keyword, e.g. instead of \` async (3:1) 1 | // https://github.com/babel/babel/pull/11979 - 2 | + 2 | > 3 | async () => {} | ^ - 4 | " + 4 |" `; exports[`async-arrow-invalid.js [babel-flow] format 1`] = ` "Type parameters must come after the async keyword, e.g. instead of \` async (3:1) 1 | // https://github.com/babel/babel/pull/11979 - 2 | + 2 | > 3 | async () => {} | ^ - 4 | " + 4 |" `; diff --git a/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap index f700fa83d..1c74c1a0d 100644 --- a/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap @@ -4,14 +4,14 @@ exports[`type-annotation-expr-statement.ts [babel-ts] format 1`] = ` "Did not expect a type annotation here. (1:3) > 1 | (a: T); | ^ - 2 | " + 2 |" `; exports[`type-annotation-func.ts [babel-ts] format 1`] = ` "Did not expect a type annotation here. (1:10) > 1 | func(a: T); | ^ - 2 | " + 2 |" `; exports[`type-annotation-in-jsx.tsx [babel-ts] format 1`] = ` @@ -22,5 +22,5 @@ exports[`type-annotation-in-jsx.tsx [babel-ts] format 1`] = ` | ^ 4 | ); 5 | } - 6 | " + 6 |" `; diff --git a/tests/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap index dc8b03d92..c781f4850 100644 --- a/tests/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap @@ -2,9 +2,9 @@ exports[`async-arrow-invalid.js [flow] format 1`] = ` "Unexpected token ILLEGAL (4:1) - 2 | + 2 | 3 | async () => {} -> 4 | +> 4 | | ^" `; @@ -12,14 +12,14 @@ exports[`default-escaped.js [flow] format 1`] = ` "Unexpected identifier, expected the token \`{\` (1:8) > 1 | export asyn\\\\u{63} from \\"async\\"; | ^^^^^^^^^^ - 2 | " + 2 |" `; exports[`dynamic-import.js [flow] format 1`] = ` "Unexpected token \`,\`, expected the token \`)\` (1:24) > 1 | import('./prettier.mjs', {}) | ^ - 2 | " + 2 |" `; exports[`function-async.js [flow] format 1`] = ` @@ -33,14 +33,14 @@ exports[`module-attributes-dynamic.js [flow] format 1`] = ` "Unexpected token \`,\`, expected the token \`)\` (1:18) > 1 | import(\\"foo.json\\", { with: { type: \\"json\\" } }) | ^ - 2 | " + 2 |" `; exports[`module-attributes-static.js [flow] format 1`] = ` "Unexpected token \`with\`, expected the token \`;\` (1:28) > 1 | import foo from \\"foo.json\\" with type: \\"json\\"; | ^^^^ - 2 | " + 2 |" `; exports[`newline-before-arrow.js [flow] format 1`] = ` @@ -48,14 +48,14 @@ exports[`newline-before-arrow.js [flow] format 1`] = ` 1 | async x > 2 | => x | ^^ - 3 | " + 3 |" `; exports[`number.js [flow] format 1`] = ` "Unexpected token ILLEGAL (3:5) 1 | // https://github.com/babel/babel/pull/11854 - 2 | + 2 | > 3 | a = 09e1_1; | ^^^^ - 4 | " + 4 |" `; diff --git a/tests/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap index 0db971b0a..0e7fd398c 100644 --- a/tests/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/graphql/__snapshots__/jsfmt.spec.js.snap @@ -3,10 +3,10 @@ exports[`type-interfaces.graphql [graphql] format 1`] = ` "Syntax Error: Unexpected \\"|\\". (5:21) 3 | # which will break seperator detection added in #7305 - 4 | + 4 | > 5 | type A implements A | B { | ^ 6 | a: a 7 | } - 8 | " + 8 |" `; diff --git a/tests/misc/errors/handlebars/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/handlebars/__snapshots__/jsfmt.spec.js.snap index 5327f3acb..7d7866680 100644 --- a/tests/misc/errors/handlebars/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/handlebars/__snapshots__/jsfmt.spec.js.snap @@ -8,7 +8,7 @@ Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR', 'CLOSE_SE 1 | > 2 | x, {{@name} | ^ - 3 | " + 3 |" `; exports[`invalid-2.hbs [glimmer] format 1`] = ` @@ -20,10 +20,10 @@ exports[`invalid-2.hbs [glimmer] format 1`] = ` (error occurred in 'an unknown module' @ line 3 : column 0) (3:0) 1 | - 2 | + 2 | > 3 | <{@name> | ^^^^^^^^ - 4 | " + 4 |" `; exports[`invalid-3.hbs [glimmer] format 1`] = ` @@ -32,10 +32,10 @@ exports[`invalid-3.hbs [glimmer] format 1`] = ` -----^ Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'CLOSE' (3:3) 1 | - 2 | + 2 | > 3 | {{}} | ^ - 4 | " + 4 |" `; exports[`tilde-comments-1.hbs [glimmer] format 1`] = ` @@ -45,7 +45,7 @@ exports[`tilde-comments-1.hbs [glimmer] format 1`] = ` Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'CLOSE' (1:4) > 1 | {{~}} | ^ - 2 | " + 2 |" `; exports[`tilde-comments-2.hbs [glimmer] format 1`] = ` @@ -55,5 +55,5 @@ exports[`tilde-comments-2.hbs [glimmer] format 1`] = ` Expecting 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'CLOSE' (1:4) > 1 | {{~~}} | ^ - 2 | " + 2 |" `; diff --git a/tests/misc/errors/invalid-typescript-decorators/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/invalid-typescript-decorators/__snapshots__/jsfmt.spec.js.snap index 7a3f227b9..bc249a442 100644 --- a/tests/misc/errors/invalid-typescript-decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/invalid-typescript-decorators/__snapshots__/jsfmt.spec.js.snap @@ -2,27 +2,27 @@ exports[`decorator.ts [babel-ts] format 1`] = ` "Leading decorators must be attached to a class declaration (4:1) - 2 | + 2 | 3 | @dec > 4 | enum E {} | ^ - 5 | " + 5 |" `; exports[`decorator.ts [typescript] format 1`] = ` "Leading decorators must be attached to a class declaration (3:1) 1 | declare function dec(target: T): T; - 2 | + 2 | > 3 | @dec | ^^^^ > 4 | enum E {} | ^^^^^^^^^^ - 5 | " + 5 |" `; exports[`enums.ts [babel-ts] format 1`] = ` "Leading decorators must be attached to a class declaration (4:1) - 2 | + 2 | 3 | @decorator() > 4 | enum Direction { | ^ @@ -34,7 +34,7 @@ exports[`enums.ts [babel-ts] format 1`] = ` exports[`enums.ts [typescript] format 1`] = ` "Leading decorators must be attached to a class declaration (3:1) 1 | // https://github.com/typescript-eslint/typescript-eslint/pull/2375 - 2 | + 2 | > 3 | @decorator() | ^^^^^^^^^^^^ > 4 | enum Direction { @@ -49,50 +49,50 @@ exports[`enums.ts [typescript] format 1`] = ` | ^^^^^^^^^^^^^^^^ > 9 | } | ^^ - 10 | " + 10 |" `; exports[`function.ts [babel-ts] format 1`] = ` "Leading decorators must be attached to a class declaration (4:1) - 2 | + 2 | 3 | @decorator() > 4 | function foo( ){} | ^ - 5 | " + 5 |" `; exports[`function.ts [typescript] format 1`] = ` "Leading decorators must be attached to a class declaration (3:1) 1 | // https://github.com/typescript-eslint/typescript-eslint/pull/2375 - 2 | + 2 | > 3 | @decorator() | ^^^^^^^^^^^^ > 4 | function foo( ){} | ^^^^^^^^^^^^^^^^^^^^^^^ - 5 | " + 5 |" `; exports[`interface.ts [babel-ts] format 1`] = ` "Leading decorators must be attached to a class declaration (5:1) - 3 | + 3 | 4 | @hello() > 5 | interface MyInterface {id: string; | ^ 6 | } - 7 | " + 7 |" `; exports[`interface.ts [typescript] format 1`] = ` "Leading decorators must be attached to a class declaration (4:1) 2 | // #4632 - 3 | + 3 | > 4 | @hello() | ^^^^^^^^ > 5 | interface MyInterface {id: string; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > 6 | } | ^^ - 7 | " + 7 |" `; exports[`issue-9102.ts [babel-ts] format 1`] = ` @@ -101,7 +101,7 @@ exports[`issue-9102.ts [babel-ts] format 1`] = ` > 2 | type T = 1; | ^ 3 | class C {} - 4 | " + 4 |" `; exports[`issue-9102.ts [typescript] format 1`] = ` @@ -111,5 +111,5 @@ exports[`issue-9102.ts [typescript] format 1`] = ` > 2 | type T = 1; | ^^^^^^^^^^^^ 3 | class C {} - 4 | " + 4 |" `; diff --git a/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap index 783e27cbf..55a3db305 100644 --- a/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap @@ -8,42 +8,42 @@ exports[`html-like-comments.js [babel] format 1`] = ` | ^ 4 | 'hello world' 5 | ) - 6 | " + 6 |" `; exports[`import-assertions-for-export-without-from.js [babel] format 1`] = ` "Unexpected token, expected \\";\\" (1:16) > 1 | export { foo } assert { type: \\"json\\" }; | ^ - 2 | " + 2 |" `; exports[`import-assertions-with-parens.js [babel] format 1`] = ` "Unexpected token (1:19) > 1 | import \\"x\\" assert ({type: 'json'}); | ^ - 2 | " + 2 |" `; exports[`module-attributes.js [babel] format 1`] = ` "Unexpected token, expected \\";\\" (1:28) > 1 | import foo from \\"foo.json\\" with type: \\"json\\"; | ^ - 2 | " + 2 |" `; exports[`no-for-in-init-concise-binary-in.js [babel] format 1`] = ` "Unexpected token, expected \\")\\" (3:18) 1 | // https://github.com/babel/babel/pull/11931 - 2 | + 2 | > 3 | for (() => x in y;;); | ^ - 4 | " + 4 |" `; exports[`partial-template-strings.js [babel] format 1`] = ` "Unexpected token (6:42) - 4 | + 4 | 5 | const Diagnostics = { > 6 | unexpected_token: \`Unexpected token: \${?}\`, | ^ @@ -90,7 +90,7 @@ exports[`snippet: #5 [babel] format 1`] = ` exports[`snippet: #6 [babel] format 1`] = ` "Unexpected token (5:12) - 3 | + 3 | 4 | static isC(obj) { > 5 | return try obj.#brand; | ^ @@ -137,8 +137,8 @@ exports[`snippet: #12 [babel] format 1`] = ` exports[`static-import-source-should-not-has-extra-token.js [babel] format 1`] = ` "Unexpected token (4:16) 2 | // be parenthesized, that accidentally break #8016 - 3 | + 3 | > 4 | import {} from (('a')); | ^ - 5 | " + 5 |" `; diff --git a/tests/misc/errors/less/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/less/__snapshots__/jsfmt.spec.js.snap index 1d010b2d6..20833d225 100644 --- a/tests/misc/errors/less/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/less/__snapshots__/jsfmt.spec.js.snap @@ -17,7 +17,7 @@ exports[`open-double-quote.less [less] format 1`] = ` > 2 | background: url(\\" | ^ 3 | } - 4 | " + 4 |" `; exports[`open-sigle-quote.less [less] format 1`] = ` @@ -26,5 +26,5 @@ exports[`open-sigle-quote.less [less] format 1`] = ` > 2 | background: url(' | ^ 3 | } - 4 | " + 4 |" `; diff --git a/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap index a5ea5bf94..8c9016456 100644 --- a/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/typescript/__snapshots__/jsfmt.spec.js.snap @@ -4,23 +4,23 @@ exports[`default-escaped.ts [typescript] format 1`] = ` "Declaration or statement expected. (1:1) > 1 | export asyn\\\\u{63} from \\"async\\"; | ^ - 2 | " + 2 |" `; exports[`dynamic-import.ts [typescript] format 1`] = ` "Dynamic import must have one specifier as an argument. (1:8) > 1 | import('./prettier.mjs', {}) | ^ - 2 | " + 2 |" `; exports[`invalid-jsx-1.ts [typescript] format 1`] = ` "Unexpected token. Did you mean \`{'>'}\` or \`>\`? (3:45) 1 | // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#-and--are-now-invalid-jsx-text-characters - 2 | + 2 | > 3 | let directions =
    Navigate to: Menu Bar > Tools > Options
    | ^ - 4 | " + 4 |" `; exports[`issue-8773.ts [typescript] format 1`] = `"Comment \\"comment\\" was not printed. Please report this error!"`; @@ -29,14 +29,14 @@ exports[`module-attributes-dynamic.ts [typescript] format 1`] = ` "Dynamic import must have one specifier as an argument. (1:8) > 1 | import(\\"foo.json\\", { with: { type: \\"json\\" } }) | ^ - 2 | " + 2 |" `; exports[`module-attributes-static.ts [typescript] format 1`] = ` "';' expected. (1:28) > 1 | import foo from \\"foo.json\\" with type: \\"json\\"; | ^ - 2 | " + 2 |" `; exports[`newline-before-arrow.ts [typescript] format 1`] = ` @@ -44,7 +44,7 @@ exports[`newline-before-arrow.ts [typescript] format 1`] = ` > 1 | async x | ^ 2 | => x - 3 | " + 3 |" `; exports[`snippet: #0 [typescript] format 1`] = ` diff --git a/tests/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap index b78064eac..6c157b5db 100644 --- a/tests/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/vue/__snapshots__/jsfmt.spec.js.snap @@ -3,7 +3,7 @@ exports[`unclosed_tag.vue [vue] format 1`] = ` "Unexpected character \\"EOF\\" (2:1) 1 |
    2 | +> 2 | | ^" `; @@ -13,7 +13,7 @@ exports[`unclosed_tag_in_template.vue [vue] format 1`] = ` 3 | 4 | | ^ - 5 | " + 5 |" `; exports[`upper-case.html [vue] format 1`] = ` diff --git a/tests/misc/errors/yaml/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/yaml/__snapshots__/jsfmt.spec.js.snap index f33b25c05..12fcb7cae 100644 --- a/tests/misc/errors/yaml/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/yaml/__snapshots__/jsfmt.spec.js.snap @@ -12,6 +12,6 @@ exports[`block-scalar-with-spaces-only.yml [yaml] format 1`] = ` | ^ > 5 | # comment | ^ -> 6 | +> 6 | | ^" `; diff --git a/tests/misc/require-pragma/js/__snapshots__/jsfmt.spec.js.snap b/tests/misc/require-pragma/js/__snapshots__/jsfmt.spec.js.snap index db7833334..abc995656 100644 --- a/tests/misc/require-pragma/js/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/require-pragma/js/__snapshots__/jsfmt.spec.js.snap @@ -88,7 +88,7 @@ requirePragma: true 3 | */ > 4 | var test = true | ^^^^^^^^^^^^^^^ - 5 | + 5 | =====================================output===================================== /** * @prettier @@ -109,7 +109,7 @@ requirePragma: true =====================================input====================================== > 1 | var test = true | ^^^^^^^^^^^^^^^ - 2 | + 2 | =====================================output===================================== var test = true diff --git a/tests/typescript/class/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/class/__snapshots__/jsfmt.spec.js.snap index 4b4f2a713..8179d2653 100644 --- a/tests/typescript/class/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/class/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`constructor.ts [babel-ts] format 1`] = ` > 2 | constructor(static a: number) {} | ^ 3 | } - 4 | + 4 | 5 | class foo {" `; @@ -263,7 +263,7 @@ exports[`generics.ts [babel-ts] format 1`] = ` "A class name is required (1:6) > 1 | class implements Map {} | ^ - 2 | + 2 | 3 | interface AudioBufferList { 4 | mBuffers: interop.Reference;" `; @@ -292,12 +292,12 @@ interface AudioBufferList { exports[`methods.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\";\\" (6:10) - 4 | + 4 | 5 | interface Iterable { > 6 | export [Symbol.iterator](): Iterator; | ^ 7 | } - 8 | + 8 | 9 | export class Check {" `; diff --git a/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap index 21aa5587e..12029569c 100644 --- a/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap @@ -433,7 +433,7 @@ exports[`errorOnInitializerInInterfaceProperty.ts [babel-ts] format 1`] = ` > 2 | bar: number = 5; | ^ 3 | } - 4 | " + 4 |" `; exports[`errorOnInitializerInInterfaceProperty.ts format 1`] = ` diff --git a/tests/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/jsfmt.spec.js.snap index 055cf0afb..823cf5106 100644 --- a/tests/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/conformance/classes/constructorDeclarations/constructorParameters/__snapshots__/jsfmt.spec.js.snap @@ -442,12 +442,12 @@ class E extends D { exports[`readonlyInConstructorParameters.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\",\\" (7:33) - 5 | + 5 | 6 | class E { > 7 | constructor(readonly public x: number) {} | ^ 8 | } - 9 | + 9 | 10 | class F {" `; diff --git a/tests/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap index c6c038802..87fd2d2c9 100644 --- a/tests/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/conformance/parser/ecmascript5/Statements/__snapshots__/jsfmt.spec.js.snap @@ -6,7 +6,7 @@ exports[`parserES5ForOfStatement2.ts [babel-ts] format 1`] = ` > 2 | for (var of X) { | ^ 3 | } - 4 | " + 4 |" `; exports[`parserES5ForOfStatement2.ts format 1`] = ` @@ -32,7 +32,7 @@ exports[`parserES5ForOfStatement21.ts [babel-ts] format 1`] = ` 1 | //@target: ES5 > 2 | for (var of of) { } | ^ - 3 | " + 3 |" `; exports[`parserES5ForOfStatement21.ts format 1`] = ` @@ -57,7 +57,7 @@ exports[`parserForInStatement2.ts [babel-ts] format 1`] = ` > 1 | for (var in X) { | ^ 2 | } - 3 | " + 3 |" `; exports[`parserForInStatement2.ts format 1`] = ` diff --git a/tests/typescript/conformance/types/abstractKeyword/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/conformance/types/abstractKeyword/__snapshots__/jsfmt.spec.js.snap index 1d1ce60da..1d1d6d225 100644 --- a/tests/typescript/conformance/types/abstractKeyword/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/conformance/types/abstractKeyword/__snapshots__/jsfmt.spec.js.snap @@ -4,7 +4,7 @@ exports[`abstractKeyword.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\";\\" (1:10) > 1 | abstract interface I {} | ^ - 2 | " + 2 |" `; exports[`abstractKeyword.ts format 1`] = ` diff --git a/tests/typescript/conformance/types/functions/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/conformance/types/functions/__snapshots__/jsfmt.spec.js.snap index 098a018bd..71b7e0264 100644 --- a/tests/typescript/conformance/types/functions/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/conformance/types/functions/__snapshots__/jsfmt.spec.js.snap @@ -594,12 +594,12 @@ function f(x: string): void { exports[`functionOverloadErrorsSyntax.ts [babel-ts] format 1`] = ` "Rest element must be last element (9:36) - 7 | + 7 | 8 | //Function overload signature with rest param followed by non-optional parameter > 9 | function fn5(x: string, ...y: any[], z: string); | ^ 10 | function fn5() { } - 11 | " + 11 |" `; exports[`functionOverloadErrorsSyntax.ts format 1`] = ` diff --git a/tests/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap index b8f660e7a..a7946d8cb 100644 --- a/tests/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/custom/abstract/__snapshots__/jsfmt.spec.js.snap @@ -45,7 +45,7 @@ exports[`abstractProperties.ts [babel-ts] format 1`] = ` | ^ 3 | private abstract b: 2; 4 | static abstract c: 3; - 5 | " + 5 |" `; exports[`abstractProperties.ts format 1`] = ` diff --git a/tests/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap index 48ea1c51c..5ff496cbd 100644 --- a/tests/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/error-recovery/__snapshots__/jsfmt.spec.js.snap @@ -154,7 +154,7 @@ class f7<> { exports[`index-signature.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\"]\\" (4:13) - 2 | + 2 | 3 | type TwoParams = { > 4 | [a: string, b: string]: string; | ^ @@ -165,7 +165,7 @@ exports[`index-signature.ts [babel-ts] format 1`] = ` exports[`index-signature.ts - {"trailingComma":"all"} [babel-ts] format 1`] = ` "Unexpected token, expected \\"]\\" (4:13) - 2 | + 2 | 3 | type TwoParams = { > 4 | [a: string, b: string]: string; | ^ @@ -239,7 +239,7 @@ type TooLongSingleParam = { exports[`index-signature.ts - {"trailingComma":"es5"} [babel-ts] format 1`] = ` "Unexpected token, expected \\"]\\" (4:13) - 2 | + 2 | 3 | type TwoParams = { > 4 | [a: string, b: string]: string; | ^ diff --git a/tests/typescript/interface/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/interface/__snapshots__/jsfmt.spec.js.snap index da391f150..ec8b9168f 100644 --- a/tests/typescript/interface/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/interface/__snapshots__/jsfmt.spec.js.snap @@ -4,18 +4,18 @@ exports[`abstract.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\";\\" (1:10) > 1 | abstract interface I { | ^ - 2 | + 2 | 3 | } - 4 | " + 4 |" `; exports[`abstract.ts - {"semi":false} [babel-ts] format 1`] = ` "Unexpected token, expected \\";\\" (1:10) > 1 | abstract interface I { | ^ - 2 | + 2 | 3 | } - 4 | " + 4 |" `; exports[`abstract.ts - {"semi":false} format 1`] = ` diff --git a/tests/typescript/keywords/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/keywords/__snapshots__/jsfmt.spec.js.snap index caf12a3c3..da283768a 100644 --- a/tests/typescript/keywords/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/keywords/__snapshots__/jsfmt.spec.js.snap @@ -2,13 +2,13 @@ exports[`keywords.ts [babel-ts] format 1`] = ` "Unexpected token, expected \\";\\" (4:12) - 2 | + 2 | 3 | module Y3 { > 4 | public module Module { | ^ 5 | class A { s: string } 6 | } - 7 | " + 7 |" `; exports[`keywords.ts format 1`] = ` diff --git a/tests/typescript/range/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/range/__snapshots__/jsfmt.spec.js.snap index e3f995949..25aab4f2d 100644 --- a/tests/typescript/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/range/__snapshots__/jsfmt.spec.js.snap @@ -12,7 +12,7 @@ rangeStart: 15 > 2 | export = f; | ^^^ 3 | g( ) - 4 | + 4 | =====================================output===================================== f ( ); export = f; @@ -45,7 +45,7 @@ rangeStart: 102 > 9 | } | ^^^^^ 10 | } - 11 | + 11 | =====================================output===================================== class Foo { /** Does this key match a given MinimalKey extending object? */ @@ -73,7 +73,7 @@ rangeStart: 29 > 2 | private obj = { isTest: true } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 | } - 4 | + 4 | =====================================output===================================== export default class Test { private obj = { isTest: true }; diff --git a/tests/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap index 7a227a5e0..642315afd 100644 --- a/tests/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/typeparams/consistent/__snapshots__/jsfmt.spec.js.snap @@ -75,21 +75,21 @@ exports[`template-literal-types.ts [babel] format 1`] = ` "Unexpected token (1:84) > 1 | const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<\`Hello, \${keyof World}\`> = a; | ^ - 2 | " + 2 |" `; exports[`template-literal-types.ts [babel-flow] format 1`] = ` "Unexpected token (1:84) > 1 | const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<\`Hello, \${keyof World}\`> = a; | ^ - 2 | " + 2 |" `; exports[`template-literal-types.ts [flow] format 1`] = ` "Unexpected token \`\`\` (1:84) > 1 | const foo1: Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo<\`Hello, \${keyof World}\`> = a; | ^ - 2 | " + 2 |" `; exports[`template-literal-types.ts format 1`] = ` diff --git a/tests/vue/range/__snapshots__/jsfmt.spec.js.snap b/tests/vue/range/__snapshots__/jsfmt.spec.js.snap index 756e01e7b..1606454d4 100644 --- a/tests/vue/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/vue/range/__snapshots__/jsfmt.spec.js.snap @@ -12,18 +12,18 @@ rangeStart: 73 2 |

    Templates are formatted as well... 3 |

    4 | - 5 | + 5 | > 6 | | ^^^^^^^^^ - 9 | + 9 | 10 | - 13 | + 13 | =====================================output=====================================