From 02f803ac8d4163e7ae657483b84d295eee4976ed Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 9 Mar 2021 10:58:31 +0800 Subject: [PATCH 01/89] JSON: Only allow `+/-` number in `UnaryExpression` (#10434) --- changelog_unreleased/json/10346.md | 2 +- src/language-js/parser/json.js | 19 ++- .../json/__snapshots__/jsfmt.spec.js.snap | 121 ++++++++++++++- tests/json/json/json6.json | 3 + .../json/__snapshots__/jsfmt.spec.js.snap | 140 +++++++++++++++++- tests/misc/errors/json/jsfmt.spec.js | 7 + 6 files changed, 275 insertions(+), 17 deletions(-) diff --git a/changelog_unreleased/json/10346.md b/changelog_unreleased/json/10346.md index 8169c1514..cfa51d489 100644 --- a/changelog_unreleased/json/10346.md +++ b/changelog_unreleased/json/10346.md @@ -1,4 +1,4 @@ -#### Stricter JSON parser (#10346, #10443, #10456 by @fisker) +#### Stricter JSON parser (#10346, #10443, #10456, #10434 by @fisker) Prettier internally uses a JavaScript expression parser to parse JSON. That's why the `json` and `json5` parsers used to be very forgiving and allowed all kinds of JavaScript expressions. Now they are much stricter, although some simple non-standard syntax is still allowed (e.g., [JSON6](https://github.com/d3x0r/JSON6) is supported, except for multiple minus signs: `----123`). diff --git a/src/language-js/parser/json.js b/src/language-js/parser/json.js index 7675a3232..fc115da69 100644 --- a/src/language-js/parser/json.js +++ b/src/language-js/parser/json.js @@ -73,14 +73,25 @@ function assertJsonNode(node) { assertJsonNode(node.value); return; - case "UnaryExpression": - if (node.operator !== "+" && node.operator !== "-") { + case "UnaryExpression": { + const { operator, argument } = node; + if (operator !== "+" && operator !== "-") { throw createJsonError(node, `Operator '${node.operator}'`); } - assertJsonNode(node.argument); + if ( + argument.type === "NumericLiteral" || + (argument.type === "Identifier" && + (argument.name === "Infinity" || argument.name === "NaN")) + ) { + return; + } - return; + throw createJsonError( + argument, + `Operator '${operator}' before '${argument.type}'` + ); + } case "Identifier": if ( // JSON5 https://spec.json5.org/#numbers diff --git a/tests/json/json/__snapshots__/jsfmt.spec.js.snap b/tests/json/json/__snapshots__/jsfmt.spec.js.snap index 41f5c6c98..445b92e02 100644 --- a/tests/json/json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/json/json/__snapshots__/jsfmt.spec.js.snap @@ -544,6 +544,9 @@ trailingComma: "all" 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, @@ -581,7 +584,28 @@ trailingComma: "all" { "//": "Numbers", - "data": [0o123, 0b101010, 1e5, 123_456, 0xdeed_beef, 0123, -Infinity, -NaN] + "data": [ + 0o123, + 0b101010, + 1e5, + 123_456, + 0xdeed_beef, + 0123, + -Infinity, + -NaN, + +1, + -1, + +0o123, + +0b101010, + +1e5, + +123_456, + +0xdeed_beef, + -0o123, + -0b101010, + -1e5, + -123_456, + -0xdeed_beef + ] }, { "//": "empty members", "data": [[,], [1, , 2, , , ,], [1, , 2], [1, , 2]] } @@ -629,6 +653,9 @@ trailingComma: "all" 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, @@ -666,7 +693,28 @@ trailingComma: "all" { "//": "Numbers", - data: [0o123, 0b101010, 1e5, 123_456, 0xdeed_beef, 0123, -Infinity, -NaN], + data: [ + 0o123, + 0b101010, + 1e5, + 123_456, + 0xdeed_beef, + 0123, + -Infinity, + -NaN, + +1, + -1, + +0o123, + +0b101010, + +1e5, + +123_456, + +0xdeed_beef, + -0o123, + -0b101010, + -1e5, + -123_456, + -0xdeed_beef, + ], }, { "//": "empty members", data: [[,], [1, , 2, , , ,], [1, , 2], [1, , 2]] }, @@ -713,6 +761,9 @@ printWidth: 80 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, @@ -750,7 +801,28 @@ printWidth: 80 { "//": "Numbers", - "data": [0o123, 0b101010, 1e5, 123_456, 0xdeed_beef, 0123, -Infinity, -NaN] + "data": [ + 0o123, + 0b101010, + 1e5, + 123_456, + 0xdeed_beef, + 0123, + -Infinity, + -NaN, + +1, + -1, + +0o123, + +0b101010, + +1e5, + +123_456, + +0xdeed_beef, + -0o123, + -0b101010, + -1e5, + -123_456, + -0xdeed_beef + ] }, { "//": "empty members", "data": [[,], [1, , 2, , , ,], [1, , 2], [1, , 2]] } @@ -797,6 +869,9 @@ printWidth: 80 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, @@ -834,7 +909,28 @@ printWidth: 80 { "//": "Numbers", - data: [0o123, 0b101010, 1e5, 123_456, 0xdeed_beef, 0123, -Infinity, -NaN], + data: [ + 0o123, + 0b101010, + 1e5, + 123_456, + 0xdeed_beef, + 0123, + -Infinity, + -NaN, + +1, + -1, + +0o123, + +0b101010, + +1e5, + +123_456, + +0xdeed_beef, + -0o123, + -0b101010, + -1e5, + -123_456, + -0xdeed_beef, + ], }, { "//": "empty members", data: [[,], [1, , 2, , , ,], [1, , 2], [1, , 2]] }, @@ -881,6 +977,9 @@ printWidth: 80 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, @@ -939,7 +1038,19 @@ printWidth: 80 3740122863, 83, -Infinity, - -NaN + -NaN, + 1, + -1, + 83, + 42, + 100000, + 123456, + 3740122863, + -83, + -42, + -100000, + -123456, + -3740122863 ] }, { diff --git a/tests/json/json/json6.json b/tests/json/json/json6.json index 9489ff2e9..1689b0e3e 100644 --- a/tests/json/json/json6.json +++ b/tests/json/json/json6.json @@ -30,6 +30,9 @@ 0o123, 0b101010, 1e5, 123_456, 0xDeeD_Beef, 0123, -Infinity, -NaN, + +1, -1, + +0o123, +0b101010, +1e5, +123_456, +0xDeeD_Beef, + -0o123, -0b101010, -1e5, -123_456, -0xDeeD_Beef, ] }, diff --git a/tests/misc/errors/json/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/json/__snapshots__/jsfmt.spec.js.snap index f362f489e..64203754d 100644 --- a/tests/misc/errors/json/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/json/__snapshots__/jsfmt.spec.js.snap @@ -343,19 +343,19 @@ exports[`snippet: #18 [json5] format 1`] = ` `; exports[`snippet: #19 [json] format 1`] = ` -"'CallExpression' is not allowed in JSON. (1:8) +"Operator '+' before 'CallExpression' is not allowed in JSON. (1:8) > 1 | {key: +foo()} | ^^^^^" `; exports[`snippet: #19 [json-stringify] format 1`] = ` -"'CallExpression' is not allowed in JSON. (1:8) +"Operator '+' before 'CallExpression' is not allowed in JSON. (1:8) > 1 | {key: +foo()} | ^^^^^" `; exports[`snippet: #19 [json5] format 1`] = ` -"'CallExpression' is not allowed in JSON. (1:8) +"Operator '+' before 'CallExpression' is not allowed in JSON. (1:8) > 1 | {key: +foo()} | ^^^^^" `; @@ -475,18 +475,144 @@ exports[`snippet: #25 [json5] format 1`] = ` `; exports[`snippet: #26 [json] format 1`] = ` -"Invalid left-hand side in prefix operation (1:5) -> 1 | ----123 - | ^" +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+1 + | ^^" `; exports[`snippet: #26 [json-stringify] format 1`] = ` +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+1 + | ^^" +`; + +exports[`snippet: #26 [json5] format 1`] = ` +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+1 + | ^^" +`; + +exports[`snippet: #27 [json] format 1`] = ` +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+Infinity + | ^^^^^^^^^" +`; + +exports[`snippet: #27 [json-stringify] format 1`] = ` +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+Infinity + | ^^^^^^^^^" +`; + +exports[`snippet: #27 [json5] format 1`] = ` +"Operator '-' before 'UnaryExpression' is not allowed in JSON. (1:2) +> 1 | -+Infinity + | ^^^^^^^^^" +`; + +exports[`snippet: #28 [json] format 1`] = ` +"Operator '-' before 'Identifier' is not allowed in JSON. (1:2) +> 1 | -undefined + | ^^^^^^^^^" +`; + +exports[`snippet: #28 [json-stringify] format 1`] = ` +"Operator '-' before 'Identifier' is not allowed in JSON. (1:2) +> 1 | -undefined + | ^^^^^^^^^" +`; + +exports[`snippet: #28 [json5] format 1`] = ` +"Operator '-' before 'Identifier' is not allowed in JSON. (1:2) +> 1 | -undefined + | ^^^^^^^^^" +`; + +exports[`snippet: #29 [json] format 1`] = ` +"Operator '-' before 'NullLiteral' is not allowed in JSON. (1:2) +> 1 | -null + | ^^^^" +`; + +exports[`snippet: #29 [json-stringify] format 1`] = ` +"Operator '-' before 'NullLiteral' is not allowed in JSON. (1:2) +> 1 | -null + | ^^^^" +`; + +exports[`snippet: #29 [json5] format 1`] = ` +"Operator '-' before 'NullLiteral' is not allowed in JSON. (1:2) +> 1 | -null + | ^^^^" +`; + +exports[`snippet: #30 [json] format 1`] = ` +"Operator '-' before 'BooleanLiteral' is not allowed in JSON. (1:2) +> 1 | -false + | ^^^^^" +`; + +exports[`snippet: #30 [json-stringify] format 1`] = ` +"Operator '-' before 'BooleanLiteral' is not allowed in JSON. (1:2) +> 1 | -false + | ^^^^^" +`; + +exports[`snippet: #30 [json5] format 1`] = ` +"Operator '-' before 'BooleanLiteral' is not allowed in JSON. (1:2) +> 1 | -false + | ^^^^^" +`; + +exports[`snippet: #31 [json] format 1`] = ` +"Operator '+' before 'StringLiteral' is not allowed in JSON. (1:2) +> 1 | +'string' + | ^^^^^^^^" +`; + +exports[`snippet: #31 [json-stringify] format 1`] = ` +"Operator '+' before 'StringLiteral' is not allowed in JSON. (1:2) +> 1 | +'string' + | ^^^^^^^^" +`; + +exports[`snippet: #31 [json5] format 1`] = ` +"Operator '+' before 'StringLiteral' is not allowed in JSON. (1:2) +> 1 | +'string' + | ^^^^^^^^" +`; + +exports[`snippet: #32 [json] format 1`] = ` +"Operator '+' before 'ObjectExpression' is not allowed in JSON. (1:8) +> 1 | {key: +{}} + | ^^" +`; + +exports[`snippet: #32 [json-stringify] format 1`] = ` +"Operator '+' before 'ObjectExpression' is not allowed in JSON. (1:8) +> 1 | {key: +{}} + | ^^" +`; + +exports[`snippet: #32 [json5] format 1`] = ` +"Operator '+' before 'ObjectExpression' is not allowed in JSON. (1:8) +> 1 | {key: +{}} + | ^^" +`; + +exports[`snippet: #33 [json] format 1`] = ` "Invalid left-hand side in prefix operation (1:5) > 1 | ----123 | ^" `; -exports[`snippet: #26 [json5] format 1`] = ` +exports[`snippet: #33 [json-stringify] format 1`] = ` +"Invalid left-hand side in prefix operation (1:5) +> 1 | ----123 + | ^" +`; + +exports[`snippet: #33 [json5] format 1`] = ` "Invalid left-hand side in prefix operation (1:5) > 1 | ----123 | ^" diff --git a/tests/misc/errors/json/jsfmt.spec.js b/tests/misc/errors/json/jsfmt.spec.js index ecc0d5a2c..0b413f082 100644 --- a/tests/misc/errors/json/jsfmt.spec.js +++ b/tests/misc/errors/json/jsfmt.spec.js @@ -28,6 +28,13 @@ run_spec( "/* comment */", "// comment", "`foo${1}bar`", + "-+1", + "-+Infinity", + "-undefined", + "-null", + "-false", + "+'string'", + "{key: +{}}", // JSON6 allow this, but babel can't parse "----123", ], From 109492a497e12c63bdfb18b83c49cb708a5b18ed Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 10 Mar 2021 02:54:50 +0200 Subject: [PATCH 02/89] Clarify prettier.format docs (#10499) --- docs/api.md | 4 ++-- website/versioned_docs/version-stable/api.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index 4ccf6210c..57462399b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -9,9 +9,9 @@ If you want to run Prettier programmatically, check this page out. const prettier = require("prettier"); ``` -## `prettier.format(source [, options])` +## `prettier.format(source, options)` -`format` is used to format text using Prettier. [Options](options.md) may be provided to override the defaults. Set `options.parser` according to the language you are formatting (see the [list of available parsers](options.md#parser)). +`format` is used to format text using Prettier. `options.parser` must be set according to the language you are formatting (see the [list of available parsers](options.md#parser)). Alternatively, `options.filepath` can be specified for Prettier to infer the parser from the file extension. Other [options](options.md) may be provided to override the defaults. ```js prettier.format("foo ( );", { semi: false, parser: "babel" }); diff --git a/website/versioned_docs/version-stable/api.md b/website/versioned_docs/version-stable/api.md index 73f2b3a89..afc1eaf18 100644 --- a/website/versioned_docs/version-stable/api.md +++ b/website/versioned_docs/version-stable/api.md @@ -10,9 +10,9 @@ If you want to run Prettier programmatically, check this page out. const prettier = require("prettier"); ``` -## `prettier.format(source [, options])` +## `prettier.format(source, options)` -`format` is used to format text using Prettier. [Options](options.md) may be provided to override the defaults. Set `options.parser` according to the language you are formatting (see the [list of available parsers](options.md#parser)). +`format` is used to format text using Prettier. `options.parser` must be set according to the language you are formatting (see the [list of available parsers](options.md#parser)). Alternatively, `options.filepath` can be specified for Prettier to infer the parser from the file extension. Other [options](options.md) may be provided to override the defaults. ```js prettier.format("foo ( );", { semi: false, parser: "babel" }); From 6be741d74e822049b4d1f2755cf5d400fe7cc549 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 10 Mar 2021 03:02:43 +0200 Subject: [PATCH 03/89] Fix PR number in changelog --- changelog_unreleased/cli/{8233.md => 10058.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename changelog_unreleased/cli/{8233.md => 10058.md} (84%) diff --git a/changelog_unreleased/cli/8233.md b/changelog_unreleased/cli/10058.md similarity index 84% rename from changelog_unreleased/cli/8233.md rename to changelog_unreleased/cli/10058.md index 6a7fdae12..d84003d87 100644 --- a/changelog_unreleased/cli/8233.md +++ b/changelog_unreleased/cli/10058.md @@ -1,4 +1,4 @@ -#### Add CLI option to prevent errors on unmatched pattern (#8233 by @daronmcintosh) +#### Add CLI option to prevent errors on unmatched pattern (#10058 by @daronmcintosh) The following command will not throw an error when it doesn't find a YAML file. From 33ab1fccc846e9c33b7d769bfb2585b902ba703a Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 10 Mar 2021 03:40:15 +0200 Subject: [PATCH 04/89] Clarify docs about pragma (#10500) --- docs/cli.md | 16 ---------------- docs/options.md | 10 +++++++--- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 86422e854..9a9fb30f4 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -114,22 +114,6 @@ If you don’t have a configuration file, or want to ignore it if it does exist, Path to a file containing patterns that describe files to ignore. By default, Prettier looks for `./.prettierignore`. -## `--require-pragma` - -Require a special comment, called a pragma, to be present in the file’s first docblock comment in order for Prettier to format it. - -```js -/** - * @prettier - */ -``` - -Valid pragmas are `@prettier` and `@format`. - -## `--insert-pragma` - -Insert a `@format` pragma to the top of formatted files when pragma is absent. Works well when used in tandem with `--require-pragma`. - ## `--list-different` Another useful flag is `--list-different` (or `-l`) which prints the filenames of files that are different from Prettier formatting. If there are differences the script errors out, which is useful in a CI scenario. diff --git a/docs/options.md b/docs/options.md index 243c041ff..447bfecce 100644 --- a/docs/options.md +++ b/docs/options.md @@ -267,9 +267,9 @@ This option is only useful in the CLI and API. It doesn’t make sense to use it _First available in v1.7.0_ -Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. This is very useful when gradually transitioning large, unformatted codebases to prettier. +Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. This is very useful when gradually transitioning large, unformatted codebases to Prettier. -For example, a file with the following as its first comment will be formatted when `--require-pragma` is supplied: +A file with the following as its first comment will be formatted when `--require-pragma` is supplied: ```js /** @@ -293,12 +293,16 @@ or _First available in v1.8.0_ -Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with prettier. This works well when used in tandem with the `--require-pragma` option. If there is already a docblock at the top of the file then this option will add a newline to it with the @format marker. +Prettier can insert a special `@format` marker at the top of files specifying that the file has been formatted with Prettier. This works well when used in tandem with the `--require-pragma` option. If there is already a docblock at the top of the file then this option will add a newline to it with the `@format` marker. + +Note that “in tandem” doesn’t mean “at the same time”. When the two options are used simultaneously, `--require-pragma` has priority, so `--insert-pragma` is ignored. The idea is that during an incremental adoption of Prettier in a big codebase, the developers participating in the transition process use `--insert-pragma` whereas `--require-pragma` is used by the rest of the team and automated tooling to process only files already transitioned. The feature has been inspired by Facebook’s [adoption strategy]. | Default | CLI Override | API Override | | ------- | ----------------- | ---------------------- | | `false` | `--insert-pragma` | `insertPragma: ` | +[adoption strategy]: https://prettier.io/blog/2017/05/03/1.3.0.html#facebook-adoption-update + ## Prose Wrap _First available in v1.8.2_ From 4ece300581b12b128959c537d7cd9af2b253ea74 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 10 Mar 2021 15:12:27 +0200 Subject: [PATCH 05/89] Fix Flow range formatting (#10505) * Fix Flow range formatting * Add changelog --- changelog_unreleased/flow/10505.md | 15 ++++ src/main/range-util.js | 26 +++--- .../range/__snapshots__/jsfmt.spec.js.snap | 83 +++++++++++++++++++ .../flow/range/declare-export-declaration.js | 8 ++ tests/flow/range/jsfmt.spec.js | 1 + .../flow/range/type-parameter-declaration.js | 8 ++ 6 files changed, 129 insertions(+), 12 deletions(-) create mode 100644 changelog_unreleased/flow/10505.md create mode 100644 tests/flow/range/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/flow/range/declare-export-declaration.js create mode 100644 tests/flow/range/jsfmt.spec.js create mode 100644 tests/flow/range/type-parameter-declaration.js diff --git a/changelog_unreleased/flow/10505.md b/changelog_unreleased/flow/10505.md new file mode 100644 index 000000000..3e1bd25d6 --- /dev/null +++ b/changelog_unreleased/flow/10505.md @@ -0,0 +1,15 @@ +#### Fix range formatting issues (#10505 by @thorn0) + +Prettier had trouble formatting some ranges in function declarations. `SyntaxError` was thrown. Prettier main formats these cases without errors. Examples of problematic ranges are shown below: + + +```jsx +declare export function graphql> + // ^^^^^ range 1 + (query: GQLDocument, config?: Config>): + (Component: Component) => React$ComponentType<$Diff, { + data: Object|void, + // ^^^^ range 2 + mutate: Function|void + }>> +``` diff --git a/src/main/range-util.js b/src/main/range-util.js index 718026a55..3152e1168 100644 --- a/src/main/range-util.js +++ b/src/main/range-util.js @@ -79,7 +79,7 @@ function findNodeAtOffset( } } - if (!predicate || predicate(node)) { + if (!predicate || predicate(node, parentNodes[0])) { return { node, parentNodes, @@ -88,15 +88,17 @@ function findNodeAtOffset( } // See https://www.ecma-international.org/ecma-262/5.1/#sec-A.5 -function isJsSourceElement(type) { +function isJsSourceElement(type, parentType) { return ( - type === "Directive" || - type === "TypeAlias" || - type === "TSExportAssignment" || - type.startsWith("Declare") || - type.startsWith("TSDeclare") || - type.endsWith("Statement") || - type.endsWith("Declaration") + parentType !== "DeclareExportDeclaration" && + type !== "TypeParameterDeclaration" && + (type === "Directive" || + type === "TypeAlias" || + type === "TSExportAssignment" || + type.startsWith("Declare") || + type.startsWith("TSDeclare") || + type.endsWith("Statement") || + type.endsWith("Declaration")) ); } @@ -126,7 +128,7 @@ const graphqlSourceElements = new Set([ "UnionTypeDefinition", "ScalarTypeDefinition", ]); -function isSourceElement(opts, node) { +function isSourceElement(opts, node, parentNode) { /* istanbul ignore next */ if (!node) { return false; @@ -139,7 +141,7 @@ function isSourceElement(opts, node) { case "typescript": case "espree": case "meriyah": - return isJsSourceElement(node.type); + return isJsSourceElement(node.type, parentNode && parentNode.type); case "json": return jsonSourceElements.has(node.type); case "graphql": @@ -170,7 +172,7 @@ function calculateRange(text, opts, ast) { ast, start, opts, - (node) => isSourceElement(opts, node), + (node, parentNode) => isSourceElement(opts, node, parentNode), [], "rangeStart" ); diff --git a/tests/flow/range/__snapshots__/jsfmt.spec.js.snap b/tests/flow/range/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..fe445368f --- /dev/null +++ b/tests/flow/range/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`declare-export-declaration.js format 1`] = ` +====================================options===================================== +parsers: ["flow"] +printWidth: 80 +rangeEnd: 277 +rangeStart: 273 + | | printWidth +=====================================input====================================== + 1 | declare export function graphql> + 2 | (query: GQLDocument, config?: Config>): + 3 | (Component: Component) => React$ComponentType<$Diff, { +> 4 | data: Object|void, + | ^^^^ + 5 | mutate: Function|void + 6 | }>> + 7 | + 8 | declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" + 9 | +=====================================output===================================== +declare export function graphql< + Props, + Variables, + Component: React$ComponentType +>( + query: GQLDocument, + config?: Config> +): (Component: Component) => React$ComponentType< + $Diff< + React$ElementConfig, + { + data: Object | void, + mutate: Function | void, + } + > +>; + +declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" + +================================================================================ +`; + +exports[`type-parameter-declaration.js format 1`] = ` +====================================options===================================== +parsers: ["flow"] +printWidth: 80 +rangeEnd: 48 +rangeStart: 39 + | | printWidth +=====================================input====================================== +> 1 | declare export function graphql> + | ^^^^^^^^^ + 2 | (query: GQLDocument, config?: Config>): + 3 | (Component: Component) => React$ComponentType<$Diff, { + 4 | data: Object|void, + 5 | mutate: Function|void + 6 | }>> + 7 | + 8 | declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" + 9 | +=====================================output===================================== +declare export function graphql< + Props, + Variables, + Component: React$ComponentType +>( + query: GQLDocument, + config?: Config> +): (Component: Component) => React$ComponentType< + $Diff< + React$ElementConfig, + { + data: Object | void, + mutate: Function | void, + } + > +>; + +declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" + +================================================================================ +`; diff --git a/tests/flow/range/declare-export-declaration.js b/tests/flow/range/declare-export-declaration.js new file mode 100644 index 000000000..aa8811588 --- /dev/null +++ b/tests/flow/range/declare-export-declaration.js @@ -0,0 +1,8 @@ +declare export function graphql> + (query: GQLDocument, config?: Config>): + (Component: Component) => React$ComponentType<$Diff, { + data: Object|<<>>void<<>>, + mutate: Function|void + }>> + +declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" diff --git a/tests/flow/range/jsfmt.spec.js b/tests/flow/range/jsfmt.spec.js new file mode 100644 index 000000000..b9a908981 --- /dev/null +++ b/tests/flow/range/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["flow"]); diff --git a/tests/flow/range/type-parameter-declaration.js b/tests/flow/range/type-parameter-declaration.js new file mode 100644 index 000000000..860d143c4 --- /dev/null +++ b/tests/flow/range/type-parameter-declaration.js @@ -0,0 +1,8 @@ +declare export function graphql>>Variables<<>>, Component: React$ComponentType> + (query: GQLDocument, config?: Config>): + (Component: Component) => React$ComponentType<$Diff, { + data: Object|void, + mutate: Function|void + }>> + +declare type FetchPolicy= "cache-first" | "cache-and-network" | "network-only" | "cache-only" From d3a0699148acd4669d03592797a652655636205b Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 11 Mar 2021 04:14:08 +0800 Subject: [PATCH 06/89] Rename `n` to `node` (#10504) --- .eslintrc.yml | 1 + commands.md | 2 +- .../index.js | 1 + .../no-identifier-n.js | 95 +++++++++ .../test.js | 64 ++++++ src/document/doc-builders.js | 6 +- src/document/doc-printer.js | 15 +- src/language-graphql/printer-graphql.js | 156 ++++++++------- src/language-handlebars/printer-glimmer.js | 70 +++---- src/language-handlebars/utils.js | 2 +- src/language-html/printer-html.js | 2 +- src/language-js/print/angular.js | 29 +-- src/language-js/print/array.js | 18 +- src/language-js/print/assignment.js | 4 +- src/language-js/print/binaryish.js | 22 +- src/language-js/print/call-expression.js | 28 +-- src/language-js/print/class.js | 66 +++--- src/language-js/print/flow.js | 6 +- src/language-js/print/function.js | 80 ++++---- src/language-js/print/interface.js | 24 +-- src/language-js/print/jsx.js | 140 ++++++------- src/language-js/print/member-chain.js | 2 +- src/language-js/print/member.js | 14 +- src/language-js/print/misc.js | 4 +- src/language-js/print/object.js | 43 ++-- src/language-js/print/property.js | 4 +- src/language-js/print/type-annotation.js | 69 ++++--- src/language-js/print/type-parameters.js | 40 ++-- src/language-js/print/typescript.js | 148 +++++++------- src/language-js/printer-estree.js | 188 +++++++++--------- src/language-js/utils.js | 48 ++--- src/language-yaml/print/misc.js | 4 +- src/main/comments.js | 12 +- 33 files changed, 806 insertions(+), 601 deletions(-) create mode 100644 scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js diff --git a/.eslintrc.yml b/.eslintrc.yml index d015ea638..743225ce4 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -58,6 +58,7 @@ rules: prefer-spread: error prettier-internal-rules/jsx-identifier-case: error prettier-internal-rules/require-json-extensions: error + prettier-internal-rules/no-identifier-n: error quotes: - error - double diff --git a/commands.md b/commands.md index 28d32b4b4..e0364a789 100644 --- a/commands.md +++ b/commands.md @@ -213,7 +213,7 @@ Decrease the level of indentation. (Each `align` is considered one level of inde ### `align` ```ts -declare function align(n: number | string, doc: Doc): Doc; +declare function align(widthOrString: number | string, doc: Doc): Doc; ``` Increase the indentation by a fixed number of spaces or a string. A variant of [`indent`](#indent). diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js index 751ac8fa4..37cf78b1e 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js @@ -8,6 +8,7 @@ module.exports = { "jsx-identifier-case": require("./jsx-identifier-case"), "no-doc-builder-concat": require("./no-doc-builder-concat"), "no-empty-flat-contents-for-if-break": require("./no-empty-flat-contents-for-if-break"), + "no-identifier-n": require("./no-identifier-n"), "no-node-comments": require("./no-node-comments"), "prefer-ast-path-each": require("./prefer-ast-path-each"), "prefer-indent-if-break": require("./prefer-indent-if-break"), diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js new file mode 100644 index 000000000..373ab6820 --- /dev/null +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js @@ -0,0 +1,95 @@ +"use strict"; + +// eslint-disable-next-line import/no-extraneous-dependencies +const { findVariable } = require("eslint-utils"); +const ERROR = "error"; +const SUGGESTION = "suggestion"; +const selectors = [ + "Identifier", + '[name="n"]', + `:not(${[ + "MemberExpression[computed=false] > .property", + "Property[shorthand=false][computed=false] > .key", + ].join(", ")})`, +].join(""); + +module.exports = { + meta: { + type: "suggestion", + docs: { + url: + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-identifier-n.js", + }, + messages: { + [ERROR]: "Please rename variable 'n'.", + [SUGGESTION]: "Rename to `node`.", + }, + fixable: "code", + }, + create(context) { + const variables = new Map(); + return { + [selectors](node) { + const scope = context.getScope(); + const variable = findVariable(scope, node); + + /* istanbul ignore next */ + if (!variable) { + throw new Error("Unexpected case."); + } + + if (!variables.has(variable)) { + variables.set(variable, { fixable: true }); + } + + const data = variables.get(variable); + if (!data.fixable) { + return; + } + + const nodeVariable = findVariable(scope, "node"); + if (nodeVariable) { + data.fixable = false; + } + }, + "Program:exit"() { + for (const [variable, { fixable }] of variables.entries()) { + const [node] = variable.identifiers; + + const fix = function* (fixer) { + const identifiers = new Set([ + ...variable.identifiers, + ...variable.references.map((reference) => reference.identifier), + ]); + + for (const identifier of identifiers) { + const { parent } = identifier; + if ( + parent && + parent.type === "Property" && + parent.shorthand && + parent.key === identifier + ) { + yield fixer.replaceText(identifier, "n: node"); + } else { + yield fixer.replaceText(identifier, "node"); + } + } + }; + + const problem = { node, messageId: ERROR }; + if (fixable) { + problem.fix = fix; + } else { + problem.suggest = [{ messageId: SUGGESTION, fix }]; + } + context.report(problem); + } + }, + }; + }, + schema: { + type: "array", + uniqueItems: true, + }, +}; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js index ec8410669..12d778a05 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js @@ -81,6 +81,7 @@ test("flat-ast-path-call", { 'path.call((childPath) => childPath.call(print), "a")', 'path.call((childPath) => notChildPath.call(print), "a")', 'path.call(functionReference, "a")', + 'path.call((childPath) => notChildPath.call(print, "b"), "a")', // Only check `arrow function` 'path.call((childPath) => {return childPath.call(print, "b")}, "a")', 'path.call(function(childPath) {return childPath.call(print, "b")}, "a")', @@ -137,6 +138,69 @@ test("no-doc-builder-concat", { ], }); +test("no-identifier-n", { + valid: ["const a = {n: 1}", "const m = 1", "a.n = 1"], + invalid: [ + { + code: "const n = 1; alet(n)", + output: "const node = 1; alet(node)", + errors: 1, + }, + { + code: "const n = 1; alert({n})", + output: "const node = 1; alert({n: node})", + errors: 1, + }, + { + code: "const {n} = 1; alert(n)", + output: "const {n: node} = 1; alert(node)", + errors: 1, + }, + { + code: outdent` + const n = 1; + function a(node) { + alert(n, node) + } + function b() { + alert(n) + } + `, + output: outdent` + const n = 1; + function a(node) { + alert(n, node) + } + function b() { + alert(n) + } + `, + errors: [ + { + suggestions: [ + { + output: outdent` + const node = 1; + function a(node) { + alert(node, node) + } + function b() { + alert(node) + } + `, + }, + ], + }, + ], + }, + { + code: "const n = 1;const node = 2;", + output: "const n = 1;const node = 2;", + errors: [{ suggestions: [{ output: "const node = 1;const node = 2;" }] }], + }, + ], +}); + test("no-node-comments", { valid: [ "const comments = node.notComments", diff --git a/src/document/doc-builders.js b/src/document/doc-builders.js index 4b0315070..7ed559495 100644 --- a/src/document/doc-builders.js +++ b/src/document/doc-builders.js @@ -69,16 +69,16 @@ function indent(contents) { } /** - * @param {number | string} n + * @param {number | string} widthOrString * @param {Doc} contents * @returns Doc */ -function align(n, contents) { +function align(widthOrString, contents) { if (process.env.NODE_ENV !== "production") { assertDoc(contents); } - return { type: "align", contents, n }; + return { type: "align", contents, n: widthOrString }; } /** diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js index 293f42bec..728cbf01f 100644 --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -19,26 +19,27 @@ function makeIndent(ind, options) { return generateInd(ind, { type: "indent" }, options); } -function makeAlign(indent, n, options) { - if (n === Number.NEGATIVE_INFINITY) { +function makeAlign(indent, widthOrDoc, options) { + if (widthOrDoc === Number.NEGATIVE_INFINITY) { return indent.root || rootIndent(); } - if (n < 0) { + if (widthOrDoc < 0) { return generateInd(indent, { type: "dedent" }, options); } - if (!n) { + if (!widthOrDoc) { return indent; } - if (n.type === "root") { + if (widthOrDoc.type === "root") { return { ...indent, root: indent }; } - const alignType = typeof n === "string" ? "stringAlign" : "numberAlign"; + const alignType = + typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign"; - return generateInd(indent, { type: alignType, n }, options); + return generateInd(indent, { type: alignType, n: widthOrDoc }, options); } function generateInd(ind, newPart, options) { diff --git a/src/language-graphql/printer-graphql.js b/src/language-graphql/printer-graphql.js index c39e67ae4..8ecf9e6e1 100644 --- a/src/language-graphql/printer-graphql.js +++ b/src/language-graphql/printer-graphql.js @@ -8,16 +8,16 @@ const { insertPragma } = require("./pragma"); const { locStart, locEnd } = require("./loc"); function genericPrint(path, options, print) { - const n = path.getValue(); - if (!n) { + const node = path.getValue(); + if (!node) { return ""; } - if (typeof n === "string") { - return n; + if (typeof node === "string") { + return node; } - switch (n.kind) { + switch (node.kind) { case "Document": { const parts = []; path.each((pathChild, index, definitions) => { @@ -34,12 +34,12 @@ function genericPrint(path, options, print) { return [...parts, hardline]; } case "OperationDefinition": { - const hasOperation = options.originalText[locStart(n)] !== "{"; - const hasName = Boolean(n.name); + const hasOperation = options.originalText[locStart(node)] !== "{"; + const hasName = Boolean(node.name); return [ - hasOperation ? n.operation : "", + hasOperation ? node.operation : "", hasOperation && hasName ? [" ", path.call(print, "name")] : "", - isNonEmptyArray(n.variableDefinitions) + isNonEmptyArray(node.variableDefinitions) ? group([ "(", indent([ @@ -53,8 +53,8 @@ function genericPrint(path, options, print) { ")", ]) : "", - printDirectives(path, print, n), - n.selectionSet ? (!hasOperation && !hasName ? "" : " ") : "", + printDirectives(path, print, node), + node.selectionSet ? (!hasOperation && !hasName ? "" : " ") : "", path.call(print, "selectionSet"), ]; } @@ -62,7 +62,7 @@ function genericPrint(path, options, print) { return [ "fragment ", path.call(print, "name"), - isNonEmptyArray(n.variableDefinitions) + isNonEmptyArray(node.variableDefinitions) ? group([ "(", indent([ @@ -78,7 +78,7 @@ function genericPrint(path, options, print) { : "", " on ", path.call(print, "typeCondition"), - printDirectives(path, print, n), + printDirectives(path, print, node), " ", path.call(print, "selectionSet"), ]; @@ -102,9 +102,9 @@ function genericPrint(path, options, print) { } case "Field": { return group([ - n.alias ? [path.call(print, "alias"), ": "] : "", + node.alias ? [path.call(print, "alias"), ": "] : "", path.call(print, "name"), - n.arguments.length > 0 + node.arguments.length > 0 ? group([ "(", indent([ @@ -121,37 +121,37 @@ function genericPrint(path, options, print) { ")", ]) : "", - printDirectives(path, print, n), - n.selectionSet ? " " : "", + printDirectives(path, print, node), + node.selectionSet ? " " : "", path.call(print, "selectionSet"), ]); } case "Name": { - return n.value; + return node.value; } case "StringValue": { - if (n.block) { + if (node.block) { return [ '"""', hardline, - join(hardline, n.value.replace(/"""/g, "\\$&").split("\n")), + join(hardline, node.value.replace(/"""/g, "\\$&").split("\n")), hardline, '"""', ]; } return [ '"', - n.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), + node.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"', ]; } case "IntValue": case "FloatValue": case "EnumValue": { - return n.value; + return node.value; } case "BooleanValue": { - return n.value ? "true" : "false"; + return node.value ? "true" : "false"; } case "NullValue": { return "null"; @@ -173,13 +173,16 @@ function genericPrint(path, options, print) { case "ObjectValue": { return group([ "{", - options.bracketSpacing && n.fields.length > 0 ? " " : "", + options.bracketSpacing && node.fields.length > 0 ? " " : "", indent([ softline, join([ifBreak("", ", "), softline], path.map(print, "fields")), ]), softline, - ifBreak("", options.bracketSpacing && n.fields.length > 0 ? " " : ""), + ifBreak( + "", + options.bracketSpacing && node.fields.length > 0 ? " " : "" + ), "}", ]); } @@ -192,7 +195,7 @@ function genericPrint(path, options, print) { return [ "@", path.call(print, "name"), - n.arguments.length > 0 + node.arguments.length > 0 ? group([ "(", indent([ @@ -221,8 +224,8 @@ function genericPrint(path, options, print) { path.call(print, "variable"), ": ", path.call(print, "type"), - n.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", - printDirectives(path, print, n), + node.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", + printDirectives(path, print, node), ]; } @@ -230,15 +233,15 @@ function genericPrint(path, options, print) { case "ObjectTypeDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", - n.kind === "ObjectTypeExtension" ? "extend " : "", + node.description ? hardline : "", + node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", path.call(print, "name"), - n.interfaces.length > 0 + node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", - printDirectives(path, print, n), - n.fields.length > 0 + printDirectives(path, print, node), + node.fields.length > 0 ? [ " {", indent([ @@ -261,9 +264,9 @@ function genericPrint(path, options, print) { case "FieldDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", + node.description ? hardline : "", path.call(print, "name"), - n.arguments.length > 0 + node.arguments.length > 0 ? group([ "(", indent([ @@ -282,18 +285,18 @@ function genericPrint(path, options, print) { : "", ": ", path.call(print, "type"), - printDirectives(path, print, n), + printDirectives(path, print, node), ]; } case "DirectiveDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", + node.description ? hardline : "", "directive ", "@", path.call(print, "name"), - n.arguments.length > 0 + node.arguments.length > 0 ? group([ "(", indent([ @@ -310,7 +313,7 @@ function genericPrint(path, options, print) { ")", ]) : "", - n.repeatable ? " repeatable" : "", + node.repeatable ? " repeatable" : "", " on ", join(" | ", path.map(print, "locations")), ]; @@ -320,13 +323,13 @@ function genericPrint(path, options, print) { case "EnumTypeDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", - n.kind === "EnumTypeExtension" ? "extend " : "", + node.description ? hardline : "", + node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", path.call(print, "name"), - printDirectives(path, print, n), + printDirectives(path, print, node), - n.values.length > 0 + node.values.length > 0 ? [ " {", indent([ @@ -349,21 +352,21 @@ function genericPrint(path, options, print) { case "EnumValueDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", + node.description ? hardline : "", path.call(print, "name"), - printDirectives(path, print, n), + printDirectives(path, print, node), ]; } case "InputValueDefinition": { return [ path.call(print, "description"), - n.description ? (n.description.block ? hardline : line) : "", + node.description ? (node.description.block ? hardline : line) : "", path.call(print, "name"), ": ", path.call(print, "type"), - n.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", - printDirectives(path, print, n), + node.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", + printDirectives(path, print, node), ]; } @@ -371,12 +374,12 @@ function genericPrint(path, options, print) { case "InputObjectTypeDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", - n.kind === "InputObjectTypeExtension" ? "extend " : "", + node.description ? hardline : "", + node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", path.call(print, "name"), - printDirectives(path, print, n), - n.fields.length > 0 + printDirectives(path, print, node), + node.fields.length > 0 ? [ " {", indent([ @@ -399,9 +402,9 @@ function genericPrint(path, options, print) { case "SchemaDefinition": { return [ "schema", - printDirectives(path, print, n), + printDirectives(path, print, node), " {", - n.operationTypes.length > 0 + node.operationTypes.length > 0 ? indent([ hardline, join( @@ -426,15 +429,15 @@ function genericPrint(path, options, print) { case "InterfaceTypeDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", - n.kind === "InterfaceTypeExtension" ? "extend " : "", + node.description ? hardline : "", + node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", path.call(print, "name"), - n.interfaces.length > 0 + node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", - printDirectives(path, print, n), - n.fields.length > 0 + printDirectives(path, print, node), + node.fields.length > 0 ? [ " {", indent([ @@ -455,14 +458,18 @@ function genericPrint(path, options, print) { } case "FragmentSpread": { - return ["...", path.call(print, "name"), printDirectives(path, print, n)]; + return [ + "...", + path.call(print, "name"), + printDirectives(path, print, node), + ]; } case "InlineFragment": { return [ "...", - n.typeCondition ? [" on ", path.call(print, "typeCondition")] : "", - printDirectives(path, print, n), + node.typeCondition ? [" on ", path.call(print, "typeCondition")] : "", + printDirectives(path, print, node), " ", path.call(print, "selectionSet"), ]; @@ -472,13 +479,13 @@ function genericPrint(path, options, print) { case "UnionTypeDefinition": { return group([ path.call(print, "description"), - n.description ? hardline : "", + node.description ? hardline : "", group([ - n.kind === "UnionTypeExtension" ? "extend " : "", + node.kind === "UnionTypeExtension" ? "extend " : "", "union ", path.call(print, "name"), - printDirectives(path, print, n), - n.types.length > 0 + printDirectives(path, print, node), + node.types.length > 0 ? [ " =", ifBreak("", " "), @@ -496,11 +503,11 @@ function genericPrint(path, options, print) { case "ScalarTypeDefinition": { return [ path.call(print, "description"), - n.description ? hardline : "", - n.kind === "ScalarTypeExtension" ? "extend " : "", + node.description ? hardline : "", + node.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", path.call(print, "name"), - printDirectives(path, print, n), + printDirectives(path, print, node), ]; } @@ -514,18 +521,21 @@ function genericPrint(path, options, print) { default: /* istanbul ignore next */ - throw new Error("unknown graphql type: " + JSON.stringify(n.kind)); + throw new Error("unknown graphql type: " + JSON.stringify(node.kind)); } } -function printDirectives(path, print, n) { - if (n.directives.length === 0) { +function printDirectives(path, print, node) { + if (node.directives.length === 0) { return ""; } const printed = join(line, path.map(print, "directives")); - if (n.kind === "FragmentDefinition" || n.kind === "OperationDefinition") { + if ( + node.kind === "FragmentDefinition" || + node.kind === "OperationDefinition" + ) { return group([line, printed]); } diff --git a/src/language-handlebars/printer-glimmer.js b/src/language-handlebars/printer-glimmer.js index 1eef2f20f..f15a231ba 100644 --- a/src/language-handlebars/printer-glimmer.js +++ b/src/language-handlebars/printer-glimmer.js @@ -37,18 +37,18 @@ const NEWLINES_TO_PRESERVE_MAX = 2; // https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/syntax/lib/generation/print.ts function print(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); /* istanbul ignore if*/ - if (!n) { + if (!node) { return ""; } if (hasPrettierIgnore(path)) { - return options.originalText.slice(locStart(n), locEnd(n)); + return options.originalText.slice(locStart(node), locEnd(node)); } - switch (n.type) { + switch (node.type) { case "Block": case "Program": case "Template": { @@ -64,13 +64,13 @@ function print(path, options, print) { ? softline : ""; - if (isVoid(n)) { + if (isVoid(node)) { return [startingTag, escapeNextElementNode]; } - const endingTag = [""]; + const endingTag = [""]; - if (n.children.length === 0) { + if (node.children.length === 0) { return [startingTag, indent(endingTag), escapeNextElementNode]; } @@ -99,7 +99,7 @@ function print(path, options, print) { pp && pp.inverse && pp.inverse.body.length === 1 && - pp.inverse.body[0] === n && + pp.inverse.body[0] === node && pp.inverse.body[0].path.parts[0] === "if"; if (isElseIf) { @@ -131,18 +131,18 @@ function print(path, options, print) { const isChildOfElementNodeAndDoesNotHaveParams = isParentOfSomeType(path, ["ElementNode"]) && - doesNotHaveHashParams(n) && - doesNotHavePositionalParams(n); + doesNotHaveHashParams(node) && + doesNotHavePositionalParams(node); const shouldBreakOpeningMustache = isParentOfSpecifiedTypes || isChildOfElementNodeAndDoesNotHaveParams; return group([ - printOpeningMustache(n), + printOpeningMustache(node), shouldBreakOpeningMustache ? indent(softline) : "", printPathAndParams(path, print), softline, - printClosingMustache(n), + printClosingMustache(node), ]); } @@ -155,24 +155,24 @@ function print(path, options, print) { ]); } case "AttrNode": { - const isText = n.value.type === "TextNode"; - const isEmptyText = isText && n.value.chars === ""; + const isText = node.value.type === "TextNode"; + const isEmptyText = isText && node.value.chars === ""; // If the text is empty and the value's loc start and end offsets are the // same, there is no value for this AttrNode and it should be printed // without the `=""`. Example: `` -> `` - if (isEmptyText && locStart(n.value) === locEnd(n.value)) { - return n.name; + if (isEmptyText && locStart(node.value) === locEnd(node.value)) { + return node.name; } // 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, node.value.chars).quote + : node.value.type === "ConcatStatement" ? chooseEnclosingQuote( options, - n.value.parts + node.value.parts .filter((part) => part.type === "TextNode") .map((part) => part.chars) .join("") @@ -182,10 +182,10 @@ function print(path, options, print) { const valueDoc = path.call(print, "value"); return [ - n.name, + node.name, "=", quote, - n.name === "class" && quote ? group(indent(valueDoc)) : valueDoc, + node.name === "class" && quote ? group(indent(valueDoc)) : valueDoc, quote, ]; } @@ -198,13 +198,13 @@ function print(path, options, print) { return join(line, path.map(print, "pairs")); } case "HashPair": { - return [n.key, "=", path.call(print, "value")]; + return [node.key, "=", path.call(print, "value")]; } case "TextNode": { /* 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, "\\{{"); + let text = node.chars.replace(/{{/g, "\\{{"); const attrName = getCurrentAttributeName(path); @@ -381,8 +381,8 @@ function print(path, options, print) { ]; } case "MustacheCommentStatement": { - const start = locStart(n); - const end = locEnd(n); + const start = locStart(node); + const end = locEnd(node); // Starts with `{{~` const isLeftWhiteSpaceSensitive = options.originalText.charAt(start + 2) === "~"; @@ -390,32 +390,32 @@ function print(path, options, print) { const isRightWhitespaceSensitive = options.originalText.charAt(end - 3) === "~"; - const dashes = n.value.includes("}}") ? "--" : ""; + const dashes = node.value.includes("}}") ? "--" : ""; return [ "{{", isLeftWhiteSpaceSensitive ? "~" : "", "!", dashes, - n.value, + node.value, dashes, isRightWhitespaceSensitive ? "~" : "", "}}", ]; } case "PathExpression": { - return n.original; + return node.original; } case "BooleanLiteral": { - return String(n.value); + return String(node.value); } case "CommentStatement": { - return [""]; + return [""]; } case "StringLiteral": { - return printStringLiteral(n.value, options); + return printStringLiteral(node.value, options); } case "NumberLiteral": { - return String(n.value); + return String(node.value); } case "UndefinedLiteral": { return "undefined"; @@ -426,7 +426,7 @@ function print(path, options, print) { /* istanbul ignore next */ default: - throw new Error("unknown glimmer type: " + JSON.stringify(n.type)); + throw new Error("unknown glimmer type: " + JSON.stringify(node.type)); } } @@ -454,7 +454,7 @@ function printStartingTag(path, print) { function printChildren(path, options, print) { const node = path.getValue(); - const isEmpty = node.children.every((n) => isWhitespaceNode(n)); + const isEmpty = node.children.every((node) => isWhitespaceNode(node)); if (options.htmlWhitespaceSensitivity === "ignore" && isEmpty) { return ""; } @@ -602,7 +602,7 @@ function printCloseBlock(path, print, options) { function blockStatementHasOnlyWhitespaceInProgram(node) { return ( isNodeOfSomeType(node, ["BlockStatement"]) && - node.program.body.every((n) => isWhitespaceNode(n)) + node.program.body.every((node) => isWhitespaceNode(node)) ); } diff --git a/src/language-handlebars/utils.js b/src/language-handlebars/utils.js index 963f561ca..dc1825b6e 100644 --- a/src/language-handlebars/utils.js +++ b/src/language-handlebars/utils.js @@ -39,7 +39,7 @@ const voidTags = new Set(htmlVoidElements); function isVoid(node) { return ( (isGlimmerComponent(node) && - node.children.every((n) => isWhitespaceNode(n))) || + node.children.every((node) => isWhitespaceNode(node))) || voidTags.has(node.tag) ); } diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index f6efb5b72..fa4930359 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -322,7 +322,7 @@ function genericPrint(path, options, print) { options.tabWidth * countParents( path, - (n) => n.parent && n.parent.type !== "root" + (node) => node.parent && node.parent.type !== "root" ) }}$` ).test(node.lastChild.value) diff --git a/src/language-js/print/angular.js b/src/language-js/print/angular.js index 33bec62c8..f4a8bb754 100644 --- a/src/language-js/print/angular.js +++ b/src/language-js/print/angular.js @@ -9,14 +9,14 @@ const { printBinaryishExpression } = require("./binaryish"); /** @typedef {import("../../common/ast-path")} AstPath */ function printAngular(path, options, print) { - const n = path.getValue(); - switch (n.type) { + const node = path.getValue(); + switch (node.type) { case "NGRoot": return [ path.call(print, "node"), - !hasComment(n.node) + !hasComment(node.node) ? "" - : " //" + getComments(n.node)[0].value.trimEnd(), + : " //" + getComments(node.node)[0].value.trimEnd(), ]; case "NGPipeExpression": return printBinaryishExpression(path, options, print); @@ -36,13 +36,13 @@ function printAngular(path, options, print) { case "NGEmptyExpression": return ""; case "NGQuotedExpression": - return [n.prefix, ": ", n.value.trim()]; + return [node.prefix, ": ", node.value.trim()]; case "NGMicrosyntax": return path.map( (childPath, index) => [ index === 0 ? "" - : isNgForOf(childPath.getValue(), index, n) + : isNgForOf(childPath.getValue(), index, node) ? " " : [";", line], print(childPath), @@ -50,22 +50,23 @@ function printAngular(path, options, print) { "body" ); case "NGMicrosyntaxKey": - return /^[$_a-z][\w$]*(-[$_a-z][\w$])*$/i.test(n.name) - ? n.name - : JSON.stringify(n.name); + return /^[$_a-z][\w$]*(-[$_a-z][\w$])*$/i.test(node.name) + ? node.name + : JSON.stringify(node.name); case "NGMicrosyntaxExpression": return [ path.call(print, "expression"), - n.alias === null ? "" : [" as ", path.call(print, "alias")], + node.alias === null ? "" : [" as ", path.call(print, "alias")], ]; case "NGMicrosyntaxKeyedExpression": { const index = path.getName(); const parentNode = path.getParentNode(); const shouldNotPrintColon = - isNgForOf(n, index, parentNode) || - (((index === 1 && (n.key.name === "then" || n.key.name === "else")) || + isNgForOf(node, index, parentNode) || + (((index === 1 && + (node.key.name === "then" || node.key.name === "else")) || (index === 2 && - n.key.name === "else" && + node.key.name === "else" && parentNode.body[index - 1].type === "NGMicrosyntaxKeyedExpression" && parentNode.body[index - 1].key.name === "then")) && @@ -80,7 +81,7 @@ function printAngular(path, options, print) { return [ "let ", path.call(print, "key"), - n.value === null ? "" : [" = ", path.call(print, "value")], + node.value === null ? "" : [" = ", path.call(print, "value")], ]; case "NGMicrosyntaxAs": return [path.call(print, "key"), " as ", path.call(print, "alias")]; diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js index afa53aafb..aa16d383b 100644 --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -20,14 +20,14 @@ const { printOptionalToken, printTypeAnnotation } = require("./misc"); /** @typedef {import("../../document").Doc} Doc */ function printArray(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); /** @type{Doc[]} */ const parts = []; - const openBracket = n.type === "TupleExpression" ? "#[" : "["; + const openBracket = node.type === "TupleExpression" ? "#[" : "["; const closeBracket = "]"; - if (n.elements.length === 0) { - if (!hasComment(n, CommentCheckFlags.Dangling)) { + if (node.elements.length === 0) { + if (!hasComment(node, CommentCheckFlags.Dangling)) { parts.push(openBracket, closeBracket); } else { parts.push( @@ -40,7 +40,7 @@ function printArray(path, options, print) { ); } } else { - const lastElem = getLast(n.elements); + const lastElem = getLast(node.elements); const canHaveTrailingComma = !(lastElem && lastElem.type === "RestElement"); // JavaScript allows you to have empty elements in an array which @@ -59,8 +59,8 @@ function printArray(path, options, print) { const shouldBreak = !options.__inJestEach && - n.elements.length > 1 && - n.elements.every((element, i, elements) => { + node.elements.length > 1 && + node.elements.every((element, i, elements) => { const elementType = element && element.type; if ( elementType !== "ArrayExpression" && @@ -81,8 +81,8 @@ function printArray(path, options, print) { }); const shouldUseConciseFormatting = - n.elements.length > 1 && - n.elements.every( + node.elements.length > 1 && + node.elements.every( (element) => element && (isNumericLiteral(element) || diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js index 024db2b7e..139a7e3a7 100644 --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -69,13 +69,13 @@ function printAssignment( } function printAssignmentExpression(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); return printAssignment( path, options, print, path.call(print, "left"), - [" ", n.operator], + [" ", node.operator], "right" ); } diff --git a/src/language-js/print/binaryish.js b/src/language-js/print/binaryish.js index 150ddb4c9..2554970dc 100644 --- a/src/language-js/print/binaryish.js +++ b/src/language-js/print/binaryish.js @@ -30,11 +30,11 @@ const { let uid = 0; function printBinaryishExpression(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parent = path.getParentNode(); const parentParent = path.getParentNode(1); const isInsideParenthesis = - n !== parent.body && + node !== parent.body && (parent.type === "IfStatement" || parent.type === "WhileStatement" || parent.type === "SwitchStatement" || @@ -71,7 +71,7 @@ function printBinaryishExpression(path, options, print) { // c // ).call() if ( - (isCallExpression(parent) && parent.callee === n) || + (isCallExpression(parent) && parent.callee === node) || parent.type === "UnaryExpression" || (isMemberExpression(parent) && !parent.computed) ) { @@ -85,14 +85,14 @@ function printBinaryishExpression(path, options, print) { parent.type === "ThrowStatement" || (parent.type === "JSXExpressionContainer" && parentParent.type === "JSXAttribute") || - (n.operator !== "|" && parent.type === "JsExpressionRoot") || - (n.type !== "NGPipeExpression" && + (node.operator !== "|" && parent.type === "JsExpressionRoot") || + (node.type !== "NGPipeExpression" && ((parent.type === "NGRoot" && options.parser === "__ng_binding") || (parent.type === "NGMicrosyntaxExpression" && parentParent.type === "NGMicrosyntax" && parentParent.body.length === 1))) || - (n === parent.body && parent.type === "ArrowFunctionExpression") || - (n !== parent.body && parent.type === "ForStatement") || + (node === parent.body && parent.type === "ArrowFunctionExpression") || + (node !== parent.body && parent.type === "ForStatement") || (parent.type === "ConditionalExpression" && parentParent.type !== "ReturnStatement" && parentParent.type !== "ThrowStatement" && @@ -110,12 +110,12 @@ function printBinaryishExpression(path, options, print) { parent.type === "Property"; const samePrecedenceSubExpression = - isBinaryish(n.left) && shouldFlatten(n.operator, n.left.operator); + isBinaryish(node.left) && shouldFlatten(node.operator, node.left.operator); if ( shouldNotIndent || - (shouldInlineLogicalExpression(n) && !samePrecedenceSubExpression) || - (!shouldInlineLogicalExpression(n) && shouldIndentIfInlining) + (shouldInlineLogicalExpression(node) && !samePrecedenceSubExpression) || + (!shouldInlineLogicalExpression(node) && shouldIndentIfInlining) ) { return group(parts); } @@ -133,7 +133,7 @@ function printBinaryishExpression(path, options, print) { // // ) - const hasJsx = isJsxNode(n.right); + const hasJsx = isJsxNode(node.right); const firstGroupIndex = parts.findIndex( (part) => diff --git a/src/language-js/print/call-expression.js b/src/language-js/print/call-expression.js index 6b33179fc..e8b1ca15b 100644 --- a/src/language-js/print/call-expression.js +++ b/src/language-js/print/call-expression.js @@ -18,12 +18,12 @@ const printCallArguments = require("./call-arguments"); const { printOptionalToken, printFunctionTypeParameters } = require("./misc"); function printCallExpression(path, options, print) { - const n = path.getValue(); - const isNew = n.type === "NewExpression"; - const isDynamicImport = n.type === "ImportExpression"; + const node = path.getValue(); + const isNew = node.type === "NewExpression"; + const isDynamicImport = node.type === "ImportExpression"; const optional = printOptionalToken(path); - const args = getCallArguments(n); + const args = getCallArguments(node); if ( // Dangling comments not handled, all these special cases should has argument #9668 args.length > 0 && @@ -32,14 +32,14 @@ function printCallExpression(path, options, print) { // e.g. `define(["some/lib", (lib) => {` ((!isDynamicImport && !isNew && - n.callee.type === "Identifier" && - (n.callee.name === "require" || n.callee.name === "define")) || + node.callee.type === "Identifier" && + (node.callee.name === "require" || node.callee.name === "define")) || // Template literals as single arguments (args.length === 1 && isTemplateOnItsOwnLine(args[0], options.originalText)) || // Keep test declarations on a single line // e.g. `it('long name', () => {` - (!isNew && isTestCall(n, path.getParentNode()))) + (!isNew && isTestCall(node, path.getParentNode()))) ) { const printed = []; iterateCallArgumentsPath(path, (argPath) => { @@ -64,11 +64,11 @@ function printCallExpression(path, options, print) { // Here, we ensure that such comments stay between the Identifier and the Callee. const isIdentifierWithFlowAnnotation = (options.parser === "babel" || options.parser === "babel-flow") && - n.callee && - n.callee.type === "Identifier" && - hasFlowAnnotationComment(n.callee.trailingComments); + node.callee && + node.callee.type === "Identifier" && + hasFlowAnnotationComment(node.callee.trailingComments); if (isIdentifierWithFlowAnnotation) { - n.callee.trailingComments[0].printed = true; + node.callee.trailingComments[0].printed = true; } // We detect calls on member lookups and possibly print them in a @@ -76,7 +76,7 @@ function printCallExpression(path, options, print) { if ( !isDynamicImport && !isNew && - isMemberish(n.callee) && + isMemberish(node.callee) && !path.call((path) => pathNeedsParens(path, options), "callee") ) { return printMemberChain(path, options, print); @@ -87,7 +87,7 @@ function printCallExpression(path, options, print) { isDynamicImport ? "import" : path.call(print, "callee"), optional, isIdentifierWithFlowAnnotation - ? `/*:: ${n.callee.trailingComments[0].value.slice(2).trim()} */` + ? `/*:: ${node.callee.trailingComments[0].value.slice(2).trim()} */` : "", printFunctionTypeParameters(path, options, print), printCallArguments(path, options, print), @@ -95,7 +95,7 @@ function printCallExpression(path, options, print) { // We group here when the callee is itself a call expression. // See `isLongCurriedCallExpression` for more info. - if (isDynamicImport || isCallExpression(n.callee)) { + if (isDynamicImport || isCallExpression(node.callee)) { return group(contents); } diff --git a/src/language-js/print/class.js b/src/language-js/print/class.js index df375f059..f7f04dce3 100644 --- a/src/language-js/print/class.js +++ b/src/language-js/print/class.js @@ -14,14 +14,14 @@ const { printAssignment } = require("./assignment"); const { printClassMemberDecorators } = require("./decorators"); function printClass(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; - if (n.declare) { + if (node.declare) { parts.push("declare "); } - if (n.abstract) { + if (node.abstract) { parts.push("abstract "); } @@ -30,22 +30,22 @@ function printClass(path, options, print) { // Keep old behaviour of extends in same line // If there is only on extends and there are not comments const groupMode = - (n.id && hasComment(n.id, CommentCheckFlags.Trailing)) || - (n.superClass && hasComment(n.superClass)) || - isNonEmptyArray(n.extends) || // DeclareClass - isNonEmptyArray(n.mixins) || - isNonEmptyArray(n.implements); + (node.id && hasComment(node.id, CommentCheckFlags.Trailing)) || + (node.superClass && hasComment(node.superClass)) || + isNonEmptyArray(node.extends) || // DeclareClass + isNonEmptyArray(node.mixins) || + isNonEmptyArray(node.implements); const partsGroup = []; const extendsParts = []; - if (n.id) { + if (node.id) { partsGroup.push(" ", path.call(print, "id")); } partsGroup.push(path.call(print, "typeParameters")); - if (n.superClass) { + if (node.superClass) { const printed = [ "extends ", printSuperClass(path, options, print), @@ -71,12 +71,12 @@ function printClass(path, options, print) { if (groupMode) { let printedPartsGroup; - if (shouldIndentOnlyHeritageClauses(n)) { + if (shouldIndentOnlyHeritageClauses(node)) { printedPartsGroup = [...partsGroup, indent(extendsParts)]; } else { printedPartsGroup = indent([...partsGroup, extendsParts]); } - parts.push(group(printedPartsGroup, { id: getHeritageGroupId(n) })); + parts.push(group(printedPartsGroup, { id: getHeritageGroupId(node) })); } else { parts.push(...partsGroup, ...extendsParts); } @@ -112,8 +112,8 @@ function shouldIndentOnlyHeritageClauses(node) { } function printList(path, options, print, listName) { - const n = path.getValue(); - if (!isNonEmptyArray(n[listName])) { + const node = path.getValue(); + if (!isNonEmptyArray(node[listName])) { return ""; } @@ -124,9 +124,9 @@ function printList(path, options, print, listName) { ({ marker }) => marker === listName ); return [ - shouldIndentOnlyHeritageClauses(n) + shouldIndentOnlyHeritageClauses(node) ? ifBreak(" ", line, { - groupId: getTypeParametersGroupId(n.typeParameters), + groupId: getTypeParametersGroupId(node.typeParameters), }) : line, printedLeadingComments, @@ -148,28 +148,28 @@ function printSuperClass(path, options, print) { } function printClassMethod(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; - if (isNonEmptyArray(n.decorators)) { + if (isNonEmptyArray(node.decorators)) { parts.push(printClassMemberDecorators(path, options, print)); } - if (n.accessibility) { - parts.push(n.accessibility + " "); + if (node.accessibility) { + parts.push(node.accessibility + " "); } // "readonly" and "declare" are supported by only "babel-ts" // https://github.com/prettier/prettier/issues/9760 - if (n.readonly) { + if (node.readonly) { parts.push("readonly "); } - if (n.declare) { + if (node.declare) { parts.push("declare "); } - if (n.static) { + if (node.static) { parts.push("static "); } - if (n.type === "TSAbstractMethodDefinition" || n.abstract) { + if (node.type === "TSAbstractMethodDefinition" || node.abstract) { parts.push("abstract "); } @@ -179,29 +179,29 @@ function printClassMethod(path, options, print) { } function printClassProperty(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; const semi = options.semi ? ";" : ""; - if (isNonEmptyArray(n.decorators)) { + if (isNonEmptyArray(node.decorators)) { parts.push(printClassMemberDecorators(path, options, print)); } - if (n.accessibility) { - parts.push(n.accessibility + " "); + if (node.accessibility) { + parts.push(node.accessibility + " "); } - if (n.declare) { + if (node.declare) { parts.push("declare "); } - if (n.static) { + if (node.static) { parts.push("static "); } - if (n.type === "TSAbstractClassProperty" || n.abstract) { + if (node.type === "TSAbstractClassProperty" || node.abstract) { parts.push("abstract "); } - if (n.readonly) { + if (node.readonly) { parts.push("readonly "); } - if (n.variance) { + if (node.variance) { parts.push(path.call(print, "variance")); } parts.push( diff --git a/src/language-js/print/flow.js b/src/language-js/print/flow.js index d4eecef9d..ef0cb40be 100644 --- a/src/language-js/print/flow.js +++ b/src/language-js/print/flow.js @@ -19,16 +19,16 @@ const { } = require("./module"); function printFlow(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const semi = options.semi ? ";" : ""; - switch (n.type) { + switch (node.type) { case "DeclareClass": return printFlowDeclaration(path, printClass(path, options, print)); case "DeclareFunction": return printFlowDeclaration(path, [ "function ", path.call(print, "id"), - n.predicate ? " " : "", + node.predicate ? " " : "", path.call(print, "predicate"), semi, ]); diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js index c20906b9b..6240c7e5c 100644 --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -43,26 +43,26 @@ const { printPropertyKey } = require("./property"); const { printFunctionTypeParameters } = require("./misc"); function printFunctionDeclaration(path, print, options, expandArg) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; // For TypeScript the TSDeclareFunction node shares the AST // structure with FunctionDeclaration - if (n.type === "TSDeclareFunction" && n.declare) { + if (node.type === "TSDeclareFunction" && node.declare) { parts.push("declare "); } - if (n.async) { + if (node.async) { parts.push("async "); } - if (n.generator) { + if (node.generator) { parts.push("function* "); } else { parts.push("function "); } - if (n.id) { + if (node.id) { parts.push(path.call(print, "id")); } @@ -73,7 +73,10 @@ function printFunctionDeclaration(path, print, options, expandArg) { expandArg ); const returnTypeDoc = printReturnType(path, print, options); - const shouldGroupParameters = shouldGroupFunctionParameters(n, returnTypeDoc); + const shouldGroupParameters = shouldGroupFunctionParameters( + node, + returnTypeDoc + ); parts.push( printFunctionTypeParameters(path, options, print), @@ -81,11 +84,11 @@ function printFunctionDeclaration(path, print, options, expandArg) { shouldGroupParameters ? group(parametersDoc) : parametersDoc, returnTypeDoc, ]), - n.body ? " " : "", + node.body ? " " : "", path.call(print, "body") ); - if (options.semi && (n.declare || !n.body)) { + if (options.semi && (node.declare || !node.body)) { parts.push(";"); } @@ -157,10 +160,10 @@ function printMethodInternal(path, options, print) { } function printArrowFunctionSignature(path, options, print, args) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; - if (n.async) { + if (node.async) { parts.push("async "); } @@ -242,7 +245,7 @@ function printArrowChain( } function printArrowFunctionExpression(path, options, print, args) { - let n = path.getValue(); + let node = path.getValue(); const signatures = []; let body; let chainShouldBreak = false; @@ -256,23 +259,30 @@ function printArrowFunctionExpression(path, options, print, args) { chainShouldBreak = chainShouldBreak || // Always break the chain if: - (n.returnType && getFunctionParameters(n).length > 0) || - n.typeParameters || - getFunctionParameters(n).some((param) => param.type !== "Identifier"); + (node.returnType && getFunctionParameters(node).length > 0) || + node.typeParameters || + getFunctionParameters(node).some((param) => param.type !== "Identifier"); if ( - n.body.type !== "ArrowFunctionExpression" || + node.body.type !== "ArrowFunctionExpression" || (args && args.expandLastArg) ) { body = path.call((bodyPath) => print(bodyPath, args), "body"); } else { - n = n.body; + node = node.body; path.call(rec, "body"); } }); if (signatures.length > 1) { - return printArrowChain(path, args, signatures, chainShouldBreak, body, n); + return printArrowChain( + path, + args, + signatures, + chainShouldBreak, + body, + node + ); } const parts = signatures; @@ -281,21 +291,21 @@ function printArrowFunctionExpression(path, options, print, args) { // We want to always keep these types of nodes on the same line // as the arrow. if ( - !hasLeadingOwnLineComment(options.originalText, n.body) && - (n.body.type === "ArrayExpression" || - n.body.type === "ObjectExpression" || - n.body.type === "BlockStatement" || - isJsxNode(n.body) || - isTemplateOnItsOwnLine(n.body, options.originalText) || - n.body.type === "ArrowFunctionExpression" || - n.body.type === "DoExpression") + !hasLeadingOwnLineComment(options.originalText, node.body) && + (node.body.type === "ArrayExpression" || + node.body.type === "ObjectExpression" || + node.body.type === "BlockStatement" || + isJsxNode(node.body) || + isTemplateOnItsOwnLine(node.body, options.originalText) || + node.body.type === "ArrowFunctionExpression" || + node.body.type === "DoExpression") ) { return group([...parts, " ", body]); } // We handle sequence expressions as the body of arrows specially, // so that the required parentheses end up on their own lines. - if (n.body.type === "SequenceExpression") { + if (node.body.type === "SequenceExpression") { return group([ ...parts, group([" (", indent([softline, body]), softline, ")"]), @@ -309,7 +319,7 @@ function printArrowFunctionExpression(path, options, print, args) { const shouldAddSoftLine = ((args && args.expandLastArg) || path.getParentNode().type === "JSXExpressionContainer") && - !hasComment(n); + !hasComment(node); const printTrailingComma = args && args.expandLastArg && shouldPrintComma(options, "all"); @@ -318,8 +328,8 @@ function printArrowFunctionExpression(path, options, print, args) { // a => a ? a : a // a <= a ? a : a const shouldAddParens = - n.body.type === "ConditionalExpression" && - !startsWithNoLookaheadToken(n.body, /* forbidFunctionAndClass */ false); + node.body.type === "ConditionalExpression" && + !startsWithNoLookaheadToken(node.body, /* forbidFunctionAndClass */ false); return group([ ...parts, @@ -368,12 +378,12 @@ function shouldPrintParamsWithoutParens(path, options) { } function printReturnType(path, print, options) { - const n = path.getValue(); + const node = path.getValue(); const returnType = path.call(print, "returnType"); if ( - n.returnType && - isFlowAnnotationComment(options.originalText, n.returnType) + node.returnType && + isFlowAnnotationComment(options.originalText, node.returnType) ) { return [" /*: ", returnType, " */"]; } @@ -381,14 +391,14 @@ function printReturnType(path, print, options) { const parts = [returnType]; // prepend colon to TypeScript type annotation - if (n.returnType && n.returnType.typeAnnotation) { + if (node.returnType && node.returnType.typeAnnotation) { parts.unshift(": "); } - if (n.predicate) { + if (node.predicate) { // The return type will already add the colon, but otherwise we // need to do it ourselves - parts.push(n.returnType ? " " : ": ", path.call(print, "predicate")); + parts.push(node.returnType ? " " : ": ", path.call(print, "predicate")); } return parts; diff --git a/src/language-js/print/interface.js b/src/language-js/print/interface.js index 85aca9418..21a887c8b 100644 --- a/src/language-js/print/interface.js +++ b/src/language-js/print/interface.js @@ -9,15 +9,15 @@ const { getTypeParametersGroupId } = require("./type-parameters"); const { printTypeScriptModifiers } = require("./misc"); function printInterface(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; - if (n.declare) { + if (node.declare) { parts.push("declare "); } - if (n.type === "TSInterfaceDeclaration") { + if (node.type === "TSInterfaceDeclaration") { parts.push( - n.abstract ? "abstract " : "", + node.abstract ? "abstract " : "", printTypeScriptModifiers(path, options, print) ); } @@ -27,7 +27,7 @@ function printInterface(path, options, print) { const partsGroup = []; const extendsParts = []; - if (n.type !== "InterfaceTypeAnnotation") { + if (node.type !== "InterfaceTypeAnnotation") { partsGroup.push( " ", path.call(print, "id"), @@ -36,29 +36,29 @@ function printInterface(path, options, print) { } const shouldIndentOnlyHeritageClauses = - n.typeParameters && + node.typeParameters && !hasComment( - n.typeParameters, + node.typeParameters, CommentCheckFlags.Trailing | CommentCheckFlags.Line ); - if (isNonEmptyArray(n.extends)) { + if (isNonEmptyArray(node.extends)) { extendsParts.push( shouldIndentOnlyHeritageClauses ? ifBreak(" ", line, { - groupId: getTypeParametersGroupId(n.typeParameters), + groupId: getTypeParametersGroupId(node.typeParameters), }) : line, "extends ", - (n.extends.length === 1 ? identity : indent)( + (node.extends.length === 1 ? identity : indent)( join([",", line], path.map(print, "extends")) ) ); } if ( - (n.id && hasComment(n.id, CommentCheckFlags.Trailing)) || - isNonEmptyArray(n.extends) + (node.id && hasComment(node.id, CommentCheckFlags.Trailing)) || + isNonEmptyArray(node.extends) ) { if (shouldIndentOnlyHeritageClauses) { parts.push(group([...partsGroup, indent(extendsParts)])); diff --git a/src/language-js/print/jsx.js b/src/language-js/print/jsx.js index 9d2654c25..ec8b2f4bf 100644 --- a/src/language-js/print/jsx.js +++ b/src/language-js/print/jsx.js @@ -57,9 +57,9 @@ const isEmptyStringOrAnyLine = (doc) => // To support that case properly, all leading and trailing spaces // are stripped from the list of children, and replaced with a single hardline. function printJsxElementInternal(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); - if (n.type === "JSXElement" && isEmptyJsxElement(n)) { + if (node.type === "JSXElement" && isEmptyJsxElement(node)) { return [ path.call(print, "openingElement"), path.call(print, "closingElement"), @@ -67,19 +67,19 @@ function printJsxElementInternal(path, options, print) { } const openingLines = - n.type === "JSXElement" + node.type === "JSXElement" ? path.call(print, "openingElement") : path.call(print, "openingFragment"); const closingLines = - n.type === "JSXElement" + node.type === "JSXElement" ? path.call(print, "closingElement") : path.call(print, "closingFragment"); if ( - n.children.length === 1 && - n.children[0].type === "JSXExpressionContainer" && - (n.children[0].expression.type === "TemplateLiteral" || - n.children[0].expression.type === "TaggedTemplateExpression") + node.children.length === 1 && + node.children[0].type === "JSXExpressionContainer" && + (node.children[0].expression.type === "TemplateLiteral" || + node.children[0].expression.type === "TaggedTemplateExpression") ) { return [openingLines, ...path.map(print, "children"), closingLines]; } @@ -87,7 +87,7 @@ function printJsxElementInternal(path, options, print) { // Convert `{" "}` to text nodes containing a space. // This makes it easy to turn them into `jsxWhitespace` which // can then print as either a space or `{" "}` when breaking. - n.children = n.children.map((child) => { + node.children = node.children.map((child) => { if (isJsxWhitespaceExpression(child)) { return { type: "JSXText", @@ -98,12 +98,12 @@ function printJsxElementInternal(path, options, print) { return child; }); - const containsTag = n.children.filter(isJsxNode).length > 0; + const containsTag = node.children.filter(isJsxNode).length > 0; const containsMultipleExpressions = - n.children.filter((child) => child.type === "JSXExpressionContainer") + node.children.filter((child) => child.type === "JSXExpressionContainer") .length > 1; const containsMultipleAttributes = - n.type === "JSXElement" && n.openingElement.attributes.length > 1; + node.type === "JSXElement" && node.openingElement.attributes.length > 1; // Record any breaks. Should never go from true to false, only false to true. let forcedBreak = @@ -120,9 +120,9 @@ function printJsxElementInternal(path, options, print) { : ifBreak([rawJsxWhitespace, softline], " "); const isFacebookTranslationTag = - n.openingElement && - n.openingElement.name && - n.openingElement.name.name === "fbt"; + node.openingElement && + node.openingElement.name && + node.openingElement.name.name === "fbt"; const children = printJsxChildren( path, @@ -132,7 +132,9 @@ function printJsxElementInternal(path, options, print) { isFacebookTranslationTag ); - const containsText = n.children.some((child) => isMeaningfulJsxText(child)); + const containsText = node.children.some((child) => + isMeaningfulJsxText(child) + ); // We can end up we multiple whitespace elements with empty string // content between them. @@ -469,14 +471,14 @@ function maybeWrapJsxElementInParens(path, elem, options) { } function printJsxAttribute(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; parts.push(path.call(print, "name")); - if (n.value) { + if (node.value) { let res; - if (isStringLiteral(n.value)) { - const raw = rawText(n.value); + if (isStringLiteral(node.value)) { + const raw = rawText(node.value); // Unescape all quotes so we get an accurate preferred quote let final = raw.replace(/'/g, "'").replace(/"/g, '"'); const quote = getPreferredQuote( @@ -496,23 +498,23 @@ function printJsxAttribute(path, options, print) { } function printJsxExpressionContainer(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parent = path.getParentNode(0); const shouldInline = - n.expression.type === "JSXEmptyExpression" || - (!hasComment(n.expression) && - (n.expression.type === "ArrayExpression" || - n.expression.type === "ObjectExpression" || - n.expression.type === "ArrowFunctionExpression" || - isCallExpression(n.expression) || - n.expression.type === "FunctionExpression" || - n.expression.type === "TemplateLiteral" || - n.expression.type === "TaggedTemplateExpression" || - n.expression.type === "DoExpression" || + node.expression.type === "JSXEmptyExpression" || + (!hasComment(node.expression) && + (node.expression.type === "ArrayExpression" || + node.expression.type === "ObjectExpression" || + node.expression.type === "ArrowFunctionExpression" || + isCallExpression(node.expression) || + node.expression.type === "FunctionExpression" || + node.expression.type === "TemplateLiteral" || + node.expression.type === "TaggedTemplateExpression" || + node.expression.type === "DoExpression" || (isJsxNode(parent) && - (n.expression.type === "ConditionalExpression" || - isBinaryish(n.expression))))); + (node.expression.type === "ConditionalExpression" || + isBinaryish(node.expression))))); if (shouldInline) { return group([ @@ -533,14 +535,14 @@ function printJsxExpressionContainer(path, options, print) { } function printJsxOpeningElement(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const nameHasComments = - (n.name && hasComment(n.name)) || - (n.typeParameters && hasComment(n.typeParameters)); + (node.name && hasComment(node.name)) || + (node.typeParameters && hasComment(node.typeParameters)); // Don't break self-closing elements with no attributes and no comments - if (n.selfClosing && n.attributes.length === 0 && !nameHasComments) { + if (node.selfClosing && node.attributes.length === 0 && !nameHasComments) { return [ "<", path.call(print, "name"), @@ -551,11 +553,11 @@ function printJsxOpeningElement(path, options, print) { // don't break up opening elements with a single long text attribute if ( - n.attributes && - n.attributes.length === 1 && - n.attributes[0].value && - isStringLiteral(n.attributes[0].value) && - !n.attributes[0].value.value.includes("\n") && + node.attributes && + node.attributes.length === 1 && + node.attributes[0].value && + isStringLiteral(node.attributes[0].value) && + !node.attributes[0].value.value.includes("\n") && // We should break for the following cases: //
!nameHasComments && - !hasComment(n.attributes[0]) + !hasComment(node.attributes[0]) ) { return group([ "<", @@ -574,18 +576,18 @@ function printJsxOpeningElement(path, options, print) { path.call(print, "typeParameters"), " ", ...path.map(print, "attributes"), - n.selfClosing ? " />" : ">", + node.selfClosing ? " />" : ">", ]); } const lastAttrHasTrailingComments = - n.attributes.length > 0 && - hasComment(getLast(n.attributes), CommentCheckFlags.Trailing); + node.attributes.length > 0 && + hasComment(getLast(node.attributes), CommentCheckFlags.Trailing); const bracketSameLine = // Simple tags (no attributes and no comment in tag name) should be // kept unbroken regardless of `jsxBracketSameLine` - (n.attributes.length === 0 && !nameHasComments) || + (node.attributes.length === 0 && !nameHasComments) || (options.jsxBracketSameLine && // We should print the bracket in a new line for the following cases: //
- (!nameHasComments || n.attributes.length > 0) && + (!nameHasComments || node.attributes.length > 0) && !lastAttrHasTrailingComments); // We should print the opening element expanded if any prop value is a // string literal with newlines const shouldBreak = - n.attributes && - n.attributes.some( + node.attributes && + node.attributes.some( (attr) => attr.value && isStringLiteral(attr.value) && @@ -615,24 +617,26 @@ function printJsxOpeningElement(path, options, print) { path.call(print, "typeParameters"), indent(path.map((attr) => [line, print(attr)], "attributes")), - n.selfClosing ? line : bracketSameLine ? ">" : softline, - n.selfClosing ? "/>" : bracketSameLine ? "" : ">", + node.selfClosing ? line : bracketSameLine ? ">" : softline, + node.selfClosing ? "/>" : bracketSameLine ? "" : ">", ], { shouldBreak } ); } function printJsxClosingElement(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; parts.push(" { const printed = ["...", print(p)]; - const n = p.getValue(); - if (!hasComment(n) || !willPrintOwnComments(p)) { + const node = p.getValue(); + if (!hasComment(node) || !willPrintOwnComments(p)) { return printed; } return [ @@ -700,19 +704,19 @@ function printJsxSpreadAttribute(path, options, print) { softline, ]; }, - n.type === "JSXSpreadAttribute" ? "argument" : "expression" + node.type === "JSXSpreadAttribute" ? "argument" : "expression" ), "}", ]; } function printJsx(path, options, print) { - const n = path.getValue(); - switch (n.type) { + const node = path.getValue(); + switch (node.type) { case "JSXAttribute": return printJsxAttribute(path, options, print); case "JSXIdentifier": - return String(n.name); + return String(node.name); case "JSXNamespacedName": return join(":", [ path.call(print, "namespace"), diff --git a/src/language-js/print/member-chain.js b/src/language-js/print/member-chain.js index 7b59095c0..81e9f565a 100644 --- a/src/language-js/print/member-chain.js +++ b/src/language-js/print/member-chain.js @@ -377,7 +377,7 @@ function printMemberChain(path, options, print) { willBreak(lastGroupDoc) && callExpressions .slice(0, -1) - .some((n) => n.arguments.some(isFunctionOrArrowExpression)) + .some((node) => node.arguments.some(isFunctionOrArrowExpression)) ); } diff --git a/src/language-js/print/member.js b/src/language-js/print/member.js index 8b196b592..d87339377 100644 --- a/src/language-js/print/member.js +++ b/src/language-js/print/member.js @@ -7,7 +7,7 @@ const { isNumericLiteral, isMemberExpression } = require("../utils"); const { printOptionalToken } = require("./misc"); function printMemberExpression(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parent = path.getParentNode(); let firstNonMemberParent; @@ -27,9 +27,9 @@ function printMemberExpression(path, options, print) { firstNonMemberParent.type === "BindExpression" || (firstNonMemberParent.type === "AssignmentExpression" && firstNonMemberParent.left.type !== "Identifier"))) || - n.computed || - (n.object.type === "Identifier" && - n.property.type === "Identifier" && + node.computed || + (node.object.type === "Identifier" && + node.property.type === "Identifier" && !isMemberExpression(parent)); return [ @@ -42,14 +42,14 @@ function printMemberExpression(path, options, print) { function printMemberLookup(path, options, print) { const property = path.call(print, "property"); - const n = path.getValue(); + const node = path.getValue(); const optional = printOptionalToken(path); - if (!n.computed) { + if (!node.computed) { return [optional, ".", property]; } - if (!n.property || isNumericLiteral(n.property)) { + if (!node.property || isNumericLiteral(node.property)) { return [optional, "[", property, "]"]; } diff --git a/src/language-js/print/misc.js b/src/language-js/print/misc.js index e50bf21f2..6bfd54cff 100644 --- a/src/language-js/print/misc.js +++ b/src/language-js/print/misc.js @@ -67,8 +67,8 @@ function printBindExpressionCallee(path, options, print) { } function printTypeScriptModifiers(path, options, print) { - const n = path.getValue(); - if (!isNonEmptyArray(n.modifiers)) { + const node = path.getValue(); + if (!isNonEmptyArray(node.modifiers)) { return ""; } return [join(" ", path.map(print, "modifiers")), " "]; diff --git a/src/language-js/print/object.js b/src/language-js/print/object.js index c8ff9dc45..61f73a41d 100644 --- a/src/language-js/print/object.js +++ b/src/language-js/print/object.js @@ -28,19 +28,19 @@ const { printHardlineAfterHeritage } = require("./class"); function printObject(path, options, print) { const semi = options.semi ? ";" : ""; - const n = path.getValue(); + const node = path.getValue(); let propertiesField; - if (n.type === "TSTypeLiteral") { + if (node.type === "TSTypeLiteral") { propertiesField = "members"; - } else if (n.type === "TSInterfaceBody") { + } else if (node.type === "TSInterfaceBody") { propertiesField = "body"; } else { propertiesField = "properties"; } - const isTypeAnnotation = n.type === "ObjectTypeAnnotation"; + const isTypeAnnotation = node.type === "ObjectTypeAnnotation"; const fields = []; if (isTypeAnnotation) { fields.push("indexers", "callProperties", "internalSlots"); @@ -48,7 +48,7 @@ function printObject(path, options, print) { fields.push(propertiesField); const firstProperty = fields - .map((field) => n[field][0]) + .map((field) => node[field][0]) .sort((a, b) => locStart(a) - locStart(b))[0]; const parent = path.getParentNode(0); @@ -60,9 +60,9 @@ function printObject(path, options, print) { parent.type === "DeclareClass") && path.getName() === "body"; const shouldBreak = - n.type === "TSInterfaceBody" || + node.type === "TSInterfaceBody" || isFlowInterfaceLikeBody || - (n.type === "ObjectPattern" && + (node.type === "ObjectPattern" && parent.type !== "FunctionDeclaration" && parent.type !== "FunctionExpression" && parent.type !== "ArrowFunctionExpression" && @@ -71,27 +71,28 @@ function printObject(path, options, print) { parent.type !== "ClassPrivateMethod" && parent.type !== "AssignmentPattern" && parent.type !== "CatchClause" && - n.properties.some( + node.properties.some( (property) => property.value && (property.value.type === "ObjectPattern" || property.value.type === "ArrayPattern") )) || - (n.type !== "ObjectPattern" && + (node.type !== "ObjectPattern" && firstProperty && hasNewlineInRange( options.originalText, - locStart(n), + locStart(node), locStart(firstProperty) )); const separator = isFlowInterfaceLikeBody ? ";" - : n.type === "TSInterfaceBody" || n.type === "TSTypeLiteral" + : node.type === "TSInterfaceBody" || node.type === "TSTypeLiteral" ? ifBreak(semi, ";") : ","; - const leftBrace = n.type === "RecordExpression" ? "#{" : n.exact ? "{|" : "{"; - const rightBrace = n.exact ? "|}" : "}"; + const leftBrace = + node.type === "RecordExpression" ? "#{" : node.exact ? "{|" : "{"; + const rightBrace = node.exact ? "|}" : "}"; // Unfortunately, things are grouped together in the ast can be // interleaved in the source code. So we need to reorder them before @@ -129,10 +130,10 @@ function printObject(path, options, print) { return result; }); - if (n.inexact) { + if (node.inexact) { let printed; - if (hasComment(n, CommentCheckFlags.Dangling)) { - const hasLineComments = hasComment(n, CommentCheckFlags.Line); + if (hasComment(node, CommentCheckFlags.Dangling)) { + const hasLineComments = hasComment(node, CommentCheckFlags.Line); const printedDanglingComments = printDanglingComments( path, options, @@ -141,7 +142,7 @@ function printObject(path, options, print) { printed = [ printedDanglingComments, hasLineComments || - hasNewline(options.originalText, locEnd(getLast(getComments(n)))) + hasNewline(options.originalText, locEnd(getLast(getComments(node)))) ? hardline : line, "...", @@ -152,10 +153,10 @@ function printObject(path, options, print) { props.push([...separatorParts, ...printed]); } - const lastElem = getLast(n[propertiesField]); + const lastElem = getLast(node[propertiesField]); const canHaveTrailingSeparator = !( - n.inexact || + node.inexact || (lastElem && lastElem.type === "RestElement") || (lastElem && (lastElem.type === "TSPropertySignature" || @@ -167,7 +168,7 @@ function printObject(path, options, print) { let content; if (props.length === 0) { - if (!hasComment(n, CommentCheckFlags.Dangling)) { + if (!hasComment(node, CommentCheckFlags.Dangling)) { return [leftBrace, rightBrace, printTypeAnnotation(path, options, print)]; } @@ -181,7 +182,7 @@ function printObject(path, options, print) { ]); } else { content = [ - isFlowInterfaceLikeBody && isNonEmptyArray(n.properties) + isFlowInterfaceLikeBody && isNonEmptyArray(node.properties) ? printHardlineAfterHeritage(parent) : "", leftBrace, diff --git a/src/language-js/print/property.js b/src/language-js/print/property.js index bca524d7b..9601e6eb2 100644 --- a/src/language-js/print/property.js +++ b/src/language-js/print/property.js @@ -90,8 +90,8 @@ function printPropertyKey(path, options, print) { } function printProperty(path, options, print) { - const n = path.getValue(); - if (n.shorthand) { + const node = path.getValue(); + if (node.shorthand) { return path.call(print, "value"); } diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js index 59b9cbd29..5761d9ee8 100644 --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -28,20 +28,20 @@ function shouldHugType(node) { if (node.type === "UnionTypeAnnotation" || node.type === "TSUnionType") { const voidCount = node.types.filter( - (n) => - n.type === "VoidTypeAnnotation" || - n.type === "TSVoidKeyword" || - n.type === "NullLiteralTypeAnnotation" || - n.type === "TSNullKeyword" + (node) => + node.type === "VoidTypeAnnotation" || + node.type === "TSVoidKeyword" || + node.type === "NullLiteralTypeAnnotation" || + node.type === "TSNullKeyword" ).length; const hasObject = node.types.some( - (n) => - n.type === "ObjectTypeAnnotation" || - n.type === "TSTypeLiteral" || + (node) => + node.type === "ObjectTypeAnnotation" || + node.type === "TSTypeLiteral" || // This is a bit aggressive but captures Array<{x}> - n.type === "GenericTypeAnnotation" || - n.type === "TSTypeReference" + node.type === "GenericTypeAnnotation" || + node.type === "TSTypeReference" ); if (node.types.length - 1 === voidCount && hasObject) { @@ -54,7 +54,7 @@ function shouldHugType(node) { function printOpaqueType(path, options, print) { const semi = options.semi ? ";" : ""; - const n = path.getValue(); + const node = path.getValue(); const parts = []; parts.push( "opaque type ", @@ -62,11 +62,11 @@ function printOpaqueType(path, options, print) { path.call(print, "typeParameters") ); - if (n.supertype) { + if (node.supertype) { parts.push(": ", path.call(print, "supertype")); } - if (n.impltype) { + if (node.impltype) { parts.push(" = ", path.call(print, "impltype")); } @@ -77,9 +77,9 @@ function printOpaqueType(path, options, print) { function printTypeAlias(path, options, print) { const semi = options.semi ? ";" : ""; - const n = path.getValue(); + const node = path.getValue(); const parts = []; - if (n.declare) { + if (node.declare) { parts.push("declare "); } parts.push( @@ -88,7 +88,7 @@ function printTypeAlias(path, options, print) { path.call(print, "typeParameters") ); const rightPropertyName = - n.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right"; + node.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right"; return [ printAssignment(path, options, print, parts, " =", rightPropertyName), semi, @@ -97,17 +97,20 @@ function printTypeAlias(path, options, print) { // `TSIntersectionType` and `IntersectionTypeAnnotation` function printIntersectionType(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const types = path.map(print, "types"); const result = []; let wasIndented = false; for (let i = 0; i < types.length; ++i) { if (i === 0) { result.push(types[i]); - } else if (isObjectType(n.types[i - 1]) && isObjectType(n.types[i])) { + } else if (isObjectType(node.types[i - 1]) && isObjectType(node.types[i])) { // If both are objects, don't indent result.push([" & ", wasIndented ? indent(types[i]) : types[i]]); - } else if (!isObjectType(n.types[i - 1]) && !isObjectType(n.types[i])) { + } else if ( + !isObjectType(node.types[i - 1]) && + !isObjectType(node.types[i]) + ) { // If no object is involved, go to the next line if it breaks result.push(indent([" &", line, types[i]])); } else { @@ -123,7 +126,7 @@ function printIntersectionType(path, options, print) { // `TSUnionType` and `UnionTypeAnnotation` function printUnionType(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); // single-line variation // A | B | C @@ -152,14 +155,14 @@ function printUnionType(path, options, print) { (parent.type === "TypeAlias" || parent.type === "VariableDeclarator" || parent.type === "TSTypeAliasDeclaration") && - hasLeadingOwnLineComment(options.originalText, n) + hasLeadingOwnLineComment(options.originalText, node) ); // { // a: string // } | null | void // should be inlined and not be printed in the multi-line variant - const shouldHug = shouldHugType(n); + const shouldHug = shouldHugType(node); // We want to align the children but without its comment, so it looks like // | child1 @@ -178,7 +181,7 @@ function printUnionType(path, options, print) { } const shouldAddStartLine = - shouldIndent && !hasLeadingOwnLineComment(options.originalText, n); + shouldIndent && !hasLeadingOwnLineComment(options.originalText, node); const code = [ ifBreak([shouldAddStartLine ? line : "", "| "]), @@ -205,7 +208,7 @@ function printUnionType(path, options, print) { // `TSFunctionType` and `FunctionTypeAnnotation` function printFunctionType(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; // FunctionTypeAnnotation is ambiguous: // declare function foo(a: B): void; OR @@ -214,13 +217,13 @@ function printFunctionType(path, options, print) { const parentParent = path.getParentNode(1); const parentParentParent = path.getParentNode(2); let isArrowFunctionTypeAnnotation = - n.type === "TSFunctionType" || + node.type === "TSFunctionType" || !( ((parent.type === "ObjectTypeProperty" || parent.type === "ObjectTypeInternalSlot") && !parent.variance && !parent.optional && - locStart(parent) === locStart(n)) || + locStart(parent) === locStart(node)) || parent.type === "ObjectTypeCallProperty" || (parentParentParent && parentParentParent.type === "DeclareFunction") ); @@ -258,7 +261,7 @@ function printFunctionType(path, options, print) { // The returnType is not wrapped in a TypeAnnotation, so the colon // needs to be added separately. const returnTypeDoc = - n.returnType || n.predicate || n.typeAnnotation + node.returnType || node.predicate || node.typeAnnotation ? [ isArrowFunctionTypeAnnotation ? " => " : ": ", path.call(print, "returnType"), @@ -267,7 +270,10 @@ function printFunctionType(path, options, print) { ] : ""; - const shouldGroupParameters = shouldGroupFunctionParameters(n, returnTypeDoc); + const shouldGroupParameters = shouldGroupFunctionParameters( + node, + returnTypeDoc + ); parts.push(shouldGroupParameters ? group(parametersDoc) : parametersDoc); @@ -284,10 +290,11 @@ function printFunctionType(path, options, print) { // `TSTupleType` and `TupleTypeAnnotation` function printTupleType(path, options, print) { - const n = path.getValue(); - const typesField = n.type === "TSTupleType" ? "elementTypes" : "types"; + const node = path.getValue(); + const typesField = node.type === "TSTupleType" ? "elementTypes" : "types"; const hasRest = - n[typesField].length > 0 && getLast(n[typesField]).type === "TSRestType"; + node[typesField].length > 0 && + getLast(node[typesField]).type === "TSRestType"; return group([ "[", indent([softline, printArrayItems(path, options, typesField, print)]), diff --git a/src/language-js/print/type-parameters.js b/src/language-js/print/type-parameters.js index 8b75453ae..343cef382 100644 --- a/src/language-js/print/type-parameters.js +++ b/src/language-js/print/type-parameters.js @@ -18,14 +18,14 @@ const { shouldHugType } = require("./type-annotation"); const getTypeParametersGroupId = createGroupIdMapper("typeParameters"); function printTypeParameters(path, options, print, paramsKey) { - const n = path.getValue(); + const node = path.getValue(); - if (!n[paramsKey]) { + if (!node[paramsKey]) { return ""; } // for TypeParameterDeclaration typeParameters is a single node - if (!Array.isArray(n[paramsKey])) { + if (!Array.isArray(node[paramsKey])) { return path.call(print, paramsKey); } @@ -34,10 +34,10 @@ function printTypeParameters(path, options, print, paramsKey) { const shouldInline = isParameterInTestCall || - n[paramsKey].length === 0 || - (n[paramsKey].length === 1 && - (shouldHugType(n[paramsKey][0]) || - n[paramsKey][0].type === "NullableTypeAnnotation")); + node[paramsKey].length === 0 || + (node[paramsKey].length === 1 && + (shouldHugType(node[paramsKey][0]) || + node[paramsKey][0].type === "NullableTypeAnnotation")); if (shouldInline) { return [ @@ -52,11 +52,11 @@ function printTypeParameters(path, options, print, paramsKey) { // has one type parameter that isn't extend with any types. // Because, otherwise formatted result will be invalid as tsx. const trailingComma = - n.type === "TSTypeParameterInstantiation" // https://github.com/microsoft/TypeScript/issues/21984 + node.type === "TSTypeParameterInstantiation" // https://github.com/microsoft/TypeScript/issues/21984 ? "" - : getFunctionParameters(n).length === 1 && + : getFunctionParameters(node).length === 1 && isTSXFile(options) && - !n[paramsKey][0].constraint && + !node[paramsKey][0].constraint && path.getParentNode().type === "ArrowFunctionExpression" ? "," : shouldPrintComma(options, "all") @@ -71,16 +71,16 @@ function printTypeParameters(path, options, print, paramsKey) { softline, ">", ], - { id: getTypeParametersGroupId(n) } + { id: getTypeParametersGroupId(node) } ); } function printDanglingCommentsForInline(path, options) { - const n = path.getValue(); - if (!hasComment(n, CommentCheckFlags.Dangling)) { + const node = path.getValue(); + if (!hasComment(node, CommentCheckFlags.Dangling)) { return ""; } - const hasOnlyBlockComments = !hasComment(n, CommentCheckFlags.Line); + const hasOnlyBlockComments = !hasComment(node, CommentCheckFlags.Line); const printed = printDanglingComments( path, options, @@ -93,12 +93,12 @@ function printDanglingCommentsForInline(path, options) { } function printTypeParameter(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const parts = []; const parent = path.getParentNode(); if (parent.type === "TSMappedType") { parts.push("[", path.call(print, "name")); - if (n.constraint) { + if (node.constraint) { parts.push(" in ", path.call(print, "constraint")); } if (parent.nameType) { @@ -111,21 +111,21 @@ function printTypeParameter(path, options, print) { return parts; } - if (n.variance) { + if (node.variance) { parts.push(path.call(print, "variance")); } parts.push(path.call(print, "name")); - if (n.bound) { + if (node.bound) { parts.push(": ", path.call(print, "bound")); } - if (n.constraint) { + if (node.constraint) { parts.push(" extends ", path.call(print, "constraint")); } - if (n.default) { + if (node.default) { parts.push(" = ", path.call(print, "default")); } diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index 2e8310200..9a71c934a 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -50,14 +50,14 @@ const { } = require("./type-annotation"); function printTypescript(path, options, print) { - const n = path.getValue(); + const node = path.getValue(); const semi = options.semi ? ";" : ""; const parts = []; - switch (n.type) { + switch (node.type) { case "TSTypeAssertion": { const shouldBreakAfterCast = !( - n.expression.type === "ArrayExpression" || - n.expression.type === "ObjectExpression" + node.expression.type === "ArrayExpression" || + node.expression.type === "ObjectExpression" ); const castGroup = group([ @@ -105,7 +105,7 @@ function printTypescript(path, options, print) { case "TSExpressionWithTypeArguments": // Babel AST parts.push(path.call(print, "expression")); - if (n.typeParameters) { + if (node.typeParameters) { parts.push(path.call(print, "typeParameters")); } @@ -115,7 +115,7 @@ function printTypescript(path, options, print) { case "TSNamedTupleMember": return [ path.call(print, "label"), - n.optional ? "?" : "", + node.optional ? "?" : "", ": ", path.call(print, "elementType"), ]; @@ -175,8 +175,8 @@ function printTypescript(path, options, print) { ); const parent = path.getParentNode(); if ( - (isCallExpression(parent) && parent.callee === n) || - (isMemberExpression(parent) && parent.object === n) + (isCallExpression(parent) && parent.callee === node) || + (isMemberExpression(parent) && parent.object === node) ) { return group([indent([softline, ...parts]), softline]); } @@ -185,16 +185,16 @@ function printTypescript(path, options, print) { case "TSArrayType": return [path.call(print, "elementType"), "[]"]; case "TSPropertySignature": { - if (n.export) { + if (node.export) { parts.push("export "); } - if (n.accessibility) { - parts.push(n.accessibility + " "); + if (node.accessibility) { + parts.push(node.accessibility + " "); } - if (n.static) { + if (node.static) { parts.push("static "); } - if (n.readonly) { + if (node.readonly) { parts.push("readonly "); } @@ -203,28 +203,28 @@ function printTypescript(path, options, print) { printOptionalToken(path) ); - if (n.typeAnnotation) { + if (node.typeAnnotation) { parts.push(": ", path.call(print, "typeAnnotation")); } // This isn't valid semantically, but it's in the AST so we can print it. - if (n.initializer) { + if (node.initializer) { parts.push(" = ", path.call(print, "initializer")); } return parts; } case "TSParameterProperty": - if (n.accessibility) { - parts.push(n.accessibility + " "); + if (node.accessibility) { + parts.push(node.accessibility + " "); } - if (n.export) { + if (node.export) { parts.push("export "); } - if (n.static) { + if (node.static) { parts.push("static "); } - if (n.readonly) { + if (node.readonly) { parts.push("readonly "); } @@ -241,7 +241,7 @@ function printTypescript(path, options, print) { // aren't, this is more like a computed property name than an array. // So we leave off the trailing comma when there's just one parameter. const trailingComma = - n.parameters.length > 1 + node.parameters.length > 1 ? ifBreak(shouldPrintComma(options) ? "," : "") : ""; @@ -255,33 +255,33 @@ function printTypescript(path, options, print) { ]); return [ - n.export ? "export " : "", - n.accessibility ? [n.accessibility, " "] : "", - n.static ? "static " : "", - n.readonly ? "readonly " : "", - n.declare ? "declare " : "", + node.export ? "export " : "", + node.accessibility ? [node.accessibility, " "] : "", + node.static ? "static " : "", + node.readonly ? "readonly " : "", + node.declare ? "declare " : "", "[", - n.parameters ? parametersGroup : "", - n.typeAnnotation ? "]: " : "]", - n.typeAnnotation ? path.call(print, "typeAnnotation") : "", + node.parameters ? parametersGroup : "", + node.typeAnnotation ? "]: " : "]", + node.typeAnnotation ? path.call(print, "typeAnnotation") : "", parent.type === "ClassBody" ? semi : "", ]; } case "TSTypePredicate": return [ - n.asserts ? "asserts " : "", + node.asserts ? "asserts " : "", path.call(print, "parameterName"), - n.typeAnnotation ? [" is ", path.call(print, "typeAnnotation")] : "", + node.typeAnnotation ? [" is ", path.call(print, "typeAnnotation")] : "", ]; case "TSNonNullExpression": return [path.call(print, "expression"), "!"]; case "TSImportType": return [ - !n.isTypeOf ? "" : "typeof ", + !node.isTypeOf ? "" : "typeof ", "import(", - path.call(print, n.parameter ? "parameter" : "argument"), + path.call(print, node.parameter ? "parameter" : "argument"), ")", - !n.qualifier ? "" : [".", path.call(print, "qualifier")], + !node.qualifier ? "" : [".", path.call(print, "qualifier")], printTypeParameters(path, options, print, "typeParameters"), ]; case "TSLiteralType": @@ -296,10 +296,10 @@ function printTypescript(path, options, print) { case "TSConstructSignatureDeclaration": case "TSCallSignatureDeclaration": case "TSConstructorType": { - if (n.type === "TSConstructorType" && n.abstract) { + if (node.type === "TSConstructorType" && node.abstract) { parts.push("abstract "); } - if (n.type !== "TSCallSignatureDeclaration") { + if (node.type !== "TSCallSignatureDeclaration") { parts.push("new "); } @@ -315,8 +315,8 @@ function printTypescript(path, options, print) { ) ); - if (n.returnType || n.typeAnnotation) { - const isType = n.type === "TSConstructorType"; + if (node.returnType || node.typeAnnotation) { + const isType = node.type === "TSConstructorType"; parts.push( isType ? " => " : ": ", path.call(print, "returnType"), @@ -326,25 +326,30 @@ function printTypescript(path, options, print) { return parts; } case "TSTypeOperator": - return [n.operator, " ", path.call(print, "typeAnnotation")]; + return [node.operator, " ", path.call(print, "typeAnnotation")]; case "TSMappedType": { const shouldBreak = hasNewlineInRange( options.originalText, - locStart(n), - locEnd(n) + locStart(node), + locEnd(node) ); return group( [ "{", indent([ options.bracketSpacing ? line : softline, - n.readonly - ? [getTypeScriptMappedTypeModifier(n.readonly, "readonly"), " "] + node.readonly + ? [ + getTypeScriptMappedTypeModifier(node.readonly, "readonly"), + " ", + ] : "", printTypeScriptModifiers(path, options, print), path.call(print, "typeParameter"), - n.optional ? getTypeScriptMappedTypeModifier(n.optional, "?") : "", - n.typeAnnotation ? ": " : "", + node.optional + ? getTypeScriptMappedTypeModifier(node.optional, "?") + : "", + node.typeAnnotation ? ": " : "", path.call(print, "typeAnnotation"), ifBreak(semi), ]), @@ -357,17 +362,17 @@ function printTypescript(path, options, print) { } case "TSMethodSignature": { parts.push( - n.accessibility ? [n.accessibility, " "] : "", - n.export ? "export " : "", - n.static ? "static " : "", - n.readonly ? "readonly " : "", + node.accessibility ? [node.accessibility, " "] : "", + node.export ? "export " : "", + node.static ? "static " : "", + node.readonly ? "readonly " : "", // "abstract" and "declare" are supported by only "babel-ts" // https://github.com/prettier/prettier/issues/9760 - n.abstract ? "abstract " : "", - n.declare ? "declare " : "", - n.computed ? "[" : "", + node.abstract ? "abstract " : "", + node.declare ? "declare " : "", + node.computed ? "[" : "", path.call(print, "key"), - n.computed ? "]" : "", + node.computed ? "]" : "", printOptionalToken(path) ); @@ -379,15 +384,15 @@ function printTypescript(path, options, print) { /* printTypeParams */ true ); - const returnTypePropertyName = n.returnType + const returnTypePropertyName = node.returnType ? "returnType" : "typeAnnotation"; - const returnTypeNode = n[returnTypePropertyName]; + const returnTypeNode = node[returnTypePropertyName]; const returnTypeDoc = returnTypeNode ? path.call(print, returnTypePropertyName) : ""; const shouldGroupParameters = shouldGroupFunctionParameters( - n, + node, returnTypeDoc ); @@ -408,20 +413,20 @@ function printTypescript(path, options, print) { return group(parts); case "TSEnumDeclaration": - if (n.declare) { + if (node.declare) { parts.push("declare "); } - if (n.modifiers) { + if (node.modifiers) { parts.push(printTypeScriptModifiers(path, options, print)); } - if (n.const) { + if (node.const) { parts.push("const "); } parts.push("enum ", path.call(print, "id"), " "); - if (n.members.length === 0) { + if (node.members.length === 0) { parts.push( group(["{", printDanglingComments(path, options), softline, "}"]) ); @@ -444,12 +449,12 @@ function printTypescript(path, options, print) { return parts; case "TSEnumMember": parts.push(path.call(print, "id")); - if (n.initializer) { + if (node.initializer) { parts.push(" = ", path.call(print, "initializer")); } return parts; case "TSImportEqualsDeclaration": - if (n.isExport) { + if (node.isExport) { parts.push("export "); } parts.push( @@ -468,28 +473,29 @@ function printTypescript(path, options, print) { return ["require(", path.call(print, "expression"), ")"]; case "TSModuleDeclaration": { const parent = path.getParentNode(); - const isExternalModule = isLiteral(n.id); + const isExternalModule = isLiteral(node.id); const parentIsDeclaration = parent.type === "TSModuleDeclaration"; - const bodyIsDeclaration = n.body && n.body.type === "TSModuleDeclaration"; + const bodyIsDeclaration = + node.body && node.body.type === "TSModuleDeclaration"; if (parentIsDeclaration) { parts.push("."); } else { - if (n.declare) { + if (node.declare) { parts.push("declare "); } parts.push(printTypeScriptModifiers(path, options, print)); const textBetweenNodeAndItsId = options.originalText.slice( - locStart(n), - locStart(n.id) + locStart(node), + locStart(node.id) ); // Global declaration looks like this: // (declare)? global { ... } const isGlobalDeclaration = - n.id.type === "Identifier" && - n.id.name === "global" && + node.id.type === "Identifier" && + node.id.name === "global" && !/namespace|module/.test(textBetweenNodeAndItsId); if (!isGlobalDeclaration) { @@ -506,7 +512,7 @@ function printTypescript(path, options, print) { if (bodyIsDeclaration) { parts.push(path.call(print, "body")); - } else if (n.body) { + } else if (node.body) { parts.push(" ", group(path.call(print, "body"))); } else { parts.push(semi); @@ -516,7 +522,7 @@ function printTypescript(path, options, print) { } // TODO: Temporary auto-generated node type. To remove when typescript-estree has proper support for private fields. case "TSPrivateIdentifier": - return n.escapedText; + return node.escapedText; case "TSConditionalType": return printTernary(path, options, print); diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index a12301870..7fb5c6905 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -138,15 +138,15 @@ function genericPrint(path, options, print, args) { } function printPathNoParens(path, options, print, args) { - const n = path.getValue(); + const node = path.getValue(); const semi = options.semi ? ";" : ""; - if (!n) { + if (!node) { return ""; } - if (typeof n === "string") { - return n; + if (typeof node === "string") { + return node; } for (const printer of [ @@ -166,7 +166,7 @@ function printPathNoParens(path, options, print, args) { /** @type{Doc[]} */ let parts = []; - switch (n.type) { + switch (node.type) { case "JsExpressionRoot": return path.call(print, "node"); case "JsonRoot": @@ -174,7 +174,7 @@ function printPathNoParens(path, options, print, args) { case "File": // Print @babel/parser's InterpreterDirective here so that // leading comments on the `Program` node get printed after the hashbang. - if (n.program && n.program.interpreter) { + if (node.program && node.program.interpreter) { parts.push(path.call(print, "program", "interpreter")); } @@ -189,8 +189,8 @@ function printPathNoParens(path, options, print, args) { return ""; case "ExpressionStatement": // Detect Flow and TypeScript directives - if (n.directive) { - return [printDirective(n.expression, options), semi]; + if (node.directive) { + return [printDirective(node.expression, options), semi]; } if (options.parser === "__vue_event_binding") { @@ -198,11 +198,11 @@ function printPathNoParens(path, options, print, args) { if ( parent.type === "Program" && parent.body.length === 1 && - parent.body[0] === n + parent.body[0] === node ) { return [ path.call(print, "expression"), - isVueEventBindingExpression(n.expression) ? ";" : "", + isVueEventBindingExpression(node.expression) ? ";" : "", ]; } } @@ -215,9 +215,9 @@ function printPathNoParens(path, options, print, args) { // Babel non-standard node. Used for Closure-style type casts. See postprocess.js. case "ParenthesizedExpression": { const shouldHug = - !hasComment(n.expression) && - (n.expression.type === "ObjectExpression" || - n.expression.type === "ArrayExpression"); + !hasComment(node.expression) && + (node.expression.type === "ObjectExpression" || + node.expression.type === "ArrayExpression"); if (shouldHug) { return ["(", path.call(print, "expression"), ")"]; } @@ -244,7 +244,7 @@ function printPathNoParens(path, options, print, args) { case "MetaProperty": return [path.call(print, "meta"), ".", path.call(print, "property")]; case "BindExpression": - if (n.object) { + if (node.object) { parts.push(path.call(print, "object")); } @@ -257,13 +257,13 @@ function printPathNoParens(path, options, print, args) { return parts; case "Identifier": { return [ - n.name, + node.name, printOptionalToken(path), printTypeAnnotation(path, options, print), ]; } case "V8IntrinsicIdentifier": - return ["%", n.name]; + return ["%", node.name]; case "SpreadElement": case "SpreadElementPattern": case "SpreadProperty": @@ -291,22 +291,22 @@ function printPathNoParens(path, options, print, args) { case "YieldExpression": parts.push("yield"); - if (n.delegate) { + if (node.delegate) { parts.push("*"); } - if (n.argument) { + if (node.argument) { parts.push(" ", path.call(print, "argument")); } return parts; case "AwaitExpression": { parts.push("await"); - if (n.argument) { + if (node.argument) { parts.push(" ", path.call(print, "argument")); const parent = path.getParentNode(); if ( - (isCallExpression(parent) && parent.callee === n) || - (isMemberExpression(parent) && parent.object === n) + (isCallExpression(parent) && parent.callee === node) || + (isMemberExpression(parent) && parent.object === node) ) { parts = [indent([softline, ...parts]), softline]; const parentAwaitOrBlock = path.findAncestor( @@ -356,12 +356,12 @@ function printPathNoParens(path, options, print, args) { return printCallExpression(path, options, print); case "ObjectTypeInternalSlot": return [ - n.static ? "static " : "", + node.static ? "static " : "", "[[", path.call(print, "id"), "]]", printOptionalToken(path), - n.method ? "" : ": ", + node.method ? "" : ": ", path.call(print, "value"), ]; @@ -373,7 +373,7 @@ function printPathNoParens(path, options, print, args) { // Babel 6 case "ObjectProperty": // Non-standard AST node type. case "Property": - if (n.method || n.kind === "get" || n.kind === "set") { + if (node.method || node.kind === "get" || node.kind === "set") { return printMethod(path, options, print); } return printProperty(path, options, print); @@ -413,15 +413,15 @@ function printPathNoParens(path, options, print, args) { case "Directive": return [path.call(print, "value"), semi]; // Babel 6 case "DirectiveLiteral": - return printDirective(n, options); + return printDirective(node, options); case "UnaryExpression": - parts.push(n.operator); + parts.push(node.operator); - if (/[a-z]$/.test(n.operator)) { + if (/[a-z]$/.test(node.operator)) { parts.push(" "); } - if (hasComment(n.argument)) { + if (hasComment(node.argument)) { parts.push( group([ "(", @@ -436,9 +436,9 @@ function printPathNoParens(path, options, print, args) { return parts; case "UpdateExpression": - parts.push(path.call(print, "argument"), n.operator); + parts.push(path.call(print, "argument"), node.operator); - if (n.prefix) { + if (node.prefix) { parts.reverse(); } @@ -457,10 +457,10 @@ function printPathNoParens(path, options, print, args) { parentNode.type === "ForInStatement" || parentNode.type === "ForOfStatement"; - const hasValue = n.declarations.some((decl) => decl.init); + const hasValue = node.declarations.some((decl) => decl.init); let firstVariable; - if (printed.length === 1 && !hasComment(n.declarations[0])) { + if (printed.length === 1 && !hasComment(node.declarations[0])) { firstVariable = printed[0]; } else if (printed.length > 0) { // Indent first var to comply with eslint one-var rule @@ -468,8 +468,8 @@ function printPathNoParens(path, options, print, args) { } parts = [ - n.declare ? "declare " : "", - n.kind, + node.declare ? "declare " : "", + node.kind, firstVariable ? [" ", firstVariable] : "", indent( printed @@ -482,7 +482,7 @@ function printPathNoParens(path, options, print, args) { ), ]; - if (!(isParentForLoop && parentNode.body !== n)) { + if (!(isParentForLoop && parentNode.body !== node)) { parts.push(semi); } @@ -493,10 +493,10 @@ function printPathNoParens(path, options, print, args) { "with (", path.call(print, "object"), ")", - adjustClause(n.body, path.call(print, "body")), + adjustClause(node.body, path.call(print, "body")), ]); case "IfStatement": { - const con = adjustClause(n.consequent, path.call(print, "consequent")); + const con = adjustClause(node.consequent, path.call(print, "consequent")); const opening = group([ "if (", group([indent([softline, path.call(print, "test")]), softline]), @@ -506,17 +506,17 @@ function printPathNoParens(path, options, print, args) { parts.push(opening); - if (n.alternate) { + if (node.alternate) { const commentOnOwnLine = hasComment( - n.consequent, + node.consequent, CommentCheckFlags.Trailing | CommentCheckFlags.Line - ) || needsHardlineAfterDanglingComment(n); + ) || needsHardlineAfterDanglingComment(node); const elseOnSameLine = - n.consequent.type === "BlockStatement" && !commentOnOwnLine; + node.consequent.type === "BlockStatement" && !commentOnOwnLine; parts.push(elseOnSameLine ? " " : hardline); - if (hasComment(n, CommentCheckFlags.Dangling)) { + if (hasComment(node, CommentCheckFlags.Dangling)) { parts.push( printDanglingComments(path, options, true), commentOnOwnLine ? hardline : " " @@ -527,9 +527,9 @@ function printPathNoParens(path, options, print, args) { "else", group( adjustClause( - n.alternate, + node.alternate, path.call(print, "alternate"), - n.alternate.type === "IfStatement" + node.alternate.type === "IfStatement" ) ) ); @@ -538,7 +538,7 @@ function printPathNoParens(path, options, print, args) { return parts; } case "ForStatement": { - const body = adjustClause(n.body, path.call(print, "body")); + const body = adjustClause(node.body, path.call(print, "body")); // We want to keep dangling comments above the loop to stay consistent. // Any comment positioned between the for statement and the parentheses @@ -550,7 +550,7 @@ function printPathNoParens(path, options, print, args) { ); const printedComments = dangling ? [dangling, softline] : ""; - if (!n.init && !n.test && !n.update) { + if (!node.init && !node.test && !node.update) { return [printedComments, group(["for (;;)", body])]; } @@ -581,7 +581,7 @@ function printPathNoParens(path, options, print, args) { "while (", group([indent([softline, path.call(print, "test")]), softline]), ")", - adjustClause(n.body, path.call(print, "body")), + adjustClause(node.body, path.call(print, "body")), ]); case "ForInStatement": return group([ @@ -590,27 +590,27 @@ function printPathNoParens(path, options, print, args) { " in ", path.call(print, "right"), ")", - adjustClause(n.body, path.call(print, "body")), + adjustClause(node.body, path.call(print, "body")), ]); case "ForOfStatement": return group([ "for", - n.await ? " await" : "", + node.await ? " await" : "", " (", path.call(print, "left"), " of ", path.call(print, "right"), ")", - adjustClause(n.body, path.call(print, "body")), + adjustClause(node.body, path.call(print, "body")), ]); case "DoWhileStatement": { - const clause = adjustClause(n.body, path.call(print, "body")); + const clause = adjustClause(node.body, path.call(print, "body")); const doBody = group(["do", clause]); parts = [doBody]; - if (n.body.type === "BlockStatement") { + if (node.body.type === "BlockStatement") { parts.push(" "); } else { parts.push(hardline); @@ -629,7 +629,7 @@ function printPathNoParens(path, options, print, args) { case "BreakStatement": parts.push("break"); - if (n.label) { + if (node.label) { parts.push(" ", path.call(print, "label")); } @@ -639,7 +639,7 @@ function printPathNoParens(path, options, print, args) { case "ContinueStatement": parts.push("continue"); - if (n.label) { + if (node.label) { parts.push(" ", path.call(print, "label")); } @@ -647,7 +647,7 @@ function printPathNoParens(path, options, print, args) { return parts; case "LabeledStatement": - if (n.body.type === "EmptyStatement") { + if (node.body.type === "EmptyStatement") { return [path.call(print, "label"), ":;"]; } @@ -656,13 +656,13 @@ function printPathNoParens(path, options, print, args) { return [ "try ", path.call(print, "block"), - n.handler ? [" ", path.call(print, "handler")] : "", - n.finalizer ? [" finally ", path.call(print, "finalizer")] : "", + node.handler ? [" ", path.call(print, "handler")] : "", + node.finalizer ? [" finally ", path.call(print, "finalizer")] : "", ]; case "CatchClause": - if (n.param) { + if (node.param) { const parameterHasComments = hasComment( - n.param, + node.param, (comment) => !isBlockComment(comment) || (comment.leading && @@ -694,7 +694,7 @@ function printPathNoParens(path, options, print, args) { ")", ]), " {", - n.cases.length > 0 + node.cases.length > 0 ? indent([ hardline, join( @@ -716,13 +716,13 @@ function printPathNoParens(path, options, print, args) { "}", ]; case "SwitchCase": { - if (n.test) { + if (node.test) { parts.push("case ", path.call(print, "test"), ":"); } else { parts.push("default:"); } - const consequent = n.consequent.filter( + const consequent = node.consequent.filter( (node) => node.type !== "EmptyStatement" ); @@ -754,7 +754,7 @@ function printPathNoParens(path, options, print, args) { case "ClassPrivateProperty": return printClassProperty(path, options, print); case "TemplateElement": - return join(literalline, n.value.raw.split(/\r?\n/g)); + return join(literalline, node.value.raw.split(/\r?\n/g)); case "TemplateLiteral": return printTemplateLiteral(path, print, options); case "TaggedTemplateExpression": @@ -780,7 +780,7 @@ function printPathNoParens(path, options, print, args) { case "MemberTypeAnnotation": // Flow case "Type": /* istanbul ignore next */ - throw new Error("unprintable type: " + JSON.stringify(n.type)); + throw new Error("unprintable type: " + JSON.stringify(node.type)); case "ExistsTypeAnnotation": return "*"; case "EmptyTypeAnnotation": @@ -790,7 +790,7 @@ function printPathNoParens(path, options, print, args) { case "ArrayTypeAnnotation": return [path.call(print, "elementType"), "[]"]; case "BooleanLiteralTypeAnnotation": - return String(n.value); + return String(node.value); case "EnumDeclaration": return ["enum ", path.call(print, "id"), " ", path.call(print, "body")]; @@ -798,9 +798,9 @@ function printPathNoParens(path, options, print, args) { case "EnumNumberBody": case "EnumStringBody": case "EnumSymbolBody": { - if (n.type === "EnumSymbolBody" || n.explicitType) { + if (node.type === "EnumSymbolBody" || node.explicitType) { let type = null; - switch (n.type) { + switch (node.type) { case "EnumBooleanBody": type = "boolean"; break; @@ -816,17 +816,17 @@ function printPathNoParens(path, options, print, args) { } parts.push("of ", type, " "); } - if (n.members.length === 0 && !n.hasUnknownMembers) { + if (node.members.length === 0 && !node.hasUnknownMembers) { parts.push( group(["{", printDanglingComments(path, options), softline, "}"]) ); } else { const members = - n.members.length > 0 + node.members.length > 0 ? [ hardline, printArrayItems(path, options, "members", print), - n.hasUnknownMembers || shouldPrintComma(options) ? "," : "", + node.hasUnknownMembers || shouldPrintComma(options) ? "," : "", ] : []; @@ -835,7 +835,7 @@ function printPathNoParens(path, options, print, args) { "{", indent([ ...members, - ...(n.hasUnknownMembers ? [hardline, "..."] : []), + ...(node.hasUnknownMembers ? [hardline, "..."] : []), ]), printDanglingComments(path, options, /* sameIndent */ true), hardline, @@ -851,14 +851,16 @@ function printPathNoParens(path, options, print, args) { return [ path.call(print, "id"), " = ", - typeof n.init === "object" ? path.call(print, "init") : String(n.init), + typeof node.init === "object" + ? path.call(print, "init") + : String(node.init), ]; case "EnumDefaultedMember": return path.call(print, "id"); case "FunctionTypeParam": { - const name = n.name + const name = node.name ? path.call(print, "name") - : path.getParentNode().this === n + : path.getParentNode().this === node ? "this" : ""; return [ @@ -878,12 +880,12 @@ function printPathNoParens(path, options, print, args) { case "NullableTypeAnnotation": return ["?", path.call(print, "typeAnnotation")]; case "Variance": { - const { kind } = n; + const { kind } = node; assert.ok(kind === "plus" || kind === "minus"); return kind === "plus" ? "+" : "-"; } case "ObjectTypeCallProperty": - if (n.static) { + if (node.static) { parts.push("static "); } @@ -892,10 +894,10 @@ function printPathNoParens(path, options, print, args) { return parts; case "ObjectTypeIndexer": { return [ - n.variance ? path.call(print, "variance") : "", + node.variance ? path.call(print, "variance") : "", "[", path.call(print, "id"), - n.id ? ": " : "", + node.id ? ": " : "", path.call(print, "key"), "]: ", path.call(print, "value"), @@ -904,34 +906,34 @@ function printPathNoParens(path, options, print, args) { case "ObjectTypeProperty": { let modifier = ""; - if (n.proto) { + if (node.proto) { modifier = "proto "; - } else if (n.static) { + } else if (node.static) { modifier = "static "; } return [ modifier, - isGetterOrSetter(n) ? n.kind + " " : "", - n.variance ? path.call(print, "variance") : "", + isGetterOrSetter(node) ? node.kind + " " : "", + node.variance ? path.call(print, "variance") : "", printPropertyKey(path, options, print), printOptionalToken(path), - isFunctionNotation(n) ? "" : ": ", + isFunctionNotation(node) ? "" : ": ", path.call(print, "value"), ]; } case "QualifiedTypeIdentifier": return [path.call(print, "qualification"), ".", path.call(print, "id")]; case "StringLiteralTypeAnnotation": - return printString(rawText(n), options); + return printString(rawText(node), options); case "NumberLiteralTypeAnnotation": - assert.strictEqual(typeof n.value, "number"); + assert.strictEqual(typeof node.value, "number"); // fall through case "BigIntLiteralTypeAnnotation": - if (n.extra) { - return printNumber(n.extra.raw); + if (node.extra) { + return printNumber(node.extra.raw); } - return printNumber(n.raw); + return printNumber(node.raw); case "TypeCastExpression": { return [ "(", @@ -946,8 +948,8 @@ function printPathNoParens(path, options, print, args) { const printed = printTypeParameters(path, options, print, "params"); if (options.parser === "flow") { - const start = locStart(n); - const end = locEnd(n); + const start = locStart(node); + const end = locEnd(node); const commentStartIndex = options.originalText.lastIndexOf("/*", start); const commentEndIndex = options.originalText.indexOf("*/", end); if (commentStartIndex !== -1 && commentEndIndex !== -1) { @@ -1010,9 +1012,9 @@ function printPathNoParens(path, options, print, args) { return ["#", path.call(print, "id")]; case "InterpreterDirective": - parts.push("#!", n.value, hardline); + parts.push("#!", node.value, hardline); - if (isNextLineEmpty(n, options)) { + if (isNextLineEmpty(node, options)) { parts.push(hardline); } @@ -1032,7 +1034,7 @@ function printPathNoParens(path, options, print, args) { default: /* istanbul ignore next */ - throw new Error("unknown type: " + JSON.stringify(n.type)); + throw new Error("unknown type: " + JSON.stringify(node.type)); } } diff --git a/src/language-js/utils.js b/src/language-js/utils.js index 8e7cf4d9c..7a9e983f3 100644 --- a/src/language-js/utils.js +++ b/src/language-js/utils.js @@ -506,34 +506,36 @@ function isUnitTestSetUp(node) { } // eg; `describe("some string", (done) => {})` -function isTestCall(n, parent) { - if (n.type !== "CallExpression") { +function isTestCall(node, parent) { + if (node.type !== "CallExpression") { return false; } - if (n.arguments.length === 1) { - if (isAngularTestWrapper(n) && parent && isTestCall(parent)) { - return isFunctionOrArrowExpression(n.arguments[0]); + if (node.arguments.length === 1) { + if (isAngularTestWrapper(node) && parent && isTestCall(parent)) { + return isFunctionOrArrowExpression(node.arguments[0]); } - if (isUnitTestSetUp(n)) { - return isAngularTestWrapper(n.arguments[0]); + if (isUnitTestSetUp(node)) { + return isAngularTestWrapper(node.arguments[0]); } - } else if (n.arguments.length === 2 || n.arguments.length === 3) { + } else if (node.arguments.length === 2 || node.arguments.length === 3) { if ( - ((n.callee.type === "Identifier" && unitTestRe.test(n.callee.name)) || - isSkipOrOnlyBlock(n)) && - (isTemplateLiteral(n.arguments[0]) || isStringLiteral(n.arguments[0])) + ((node.callee.type === "Identifier" && + unitTestRe.test(node.callee.name)) || + isSkipOrOnlyBlock(node)) && + (isTemplateLiteral(node.arguments[0]) || + isStringLiteral(node.arguments[0])) ) { // it("name", () => { ... }, 2500) - if (n.arguments[2] && !isNumericLiteral(n.arguments[2])) { + if (node.arguments[2] && !isNumericLiteral(node.arguments[2])) { return false; } return ( - (n.arguments.length === 2 - ? isFunctionOrArrowExpression(n.arguments[1]) - : isFunctionOrArrowExpressionWithBody(n.arguments[1]) && - getFunctionParameters(n.arguments[1]).length <= 1) || - isAngularTestWrapper(n.arguments[1]) + (node.arguments.length === 2 + ? isFunctionOrArrowExpression(node.arguments[1]) + : isFunctionOrArrowExpressionWithBody(node.arguments[1]) && + getFunctionParameters(node.arguments[1]).length <= 1) || + isAngularTestWrapper(node.arguments[1]) ); } } @@ -783,16 +785,16 @@ function templateLiteralHasNewLines(template) { } /** - * @param {TemplateLiteral | TaggedTemplateExpression} n + * @param {TemplateLiteral | TaggedTemplateExpression} node * @param {string} text * @returns {boolean} */ -function isTemplateOnItsOwnLine(n, text) { +function isTemplateOnItsOwnLine(node, text) { return ( - ((n.type === "TemplateLiteral" && templateLiteralHasNewLines(n)) || - (n.type === "TaggedTemplateExpression" && - templateLiteralHasNewLines(n.quasi))) && - !hasNewline(text, locStart(n), { backwards: true }) + ((node.type === "TemplateLiteral" && templateLiteralHasNewLines(node)) || + (node.type === "TaggedTemplateExpression" && + templateLiteralHasNewLines(node.quasi))) && + !hasNewline(text, locStart(node), { backwards: true }) ); } diff --git a/src/language-yaml/print/misc.js b/src/language-yaml/print/misc.js index 06783d0ed..25d87fe08 100644 --- a/src/language-yaml/print/misc.js +++ b/src/language-yaml/print/misc.js @@ -44,8 +44,8 @@ function shouldPrintEndComments(node) { ); } -function alignWithSpaces(n, doc) { - return align(" ".repeat(n), doc); +function alignWithSpaces(width, doc) { + return align(" ".repeat(width), doc); } module.exports = { diff --git a/src/main/comments.js b/src/main/comments.js index 8fd48b31e..7459ae2e4 100644 --- a/src/main/comments.js +++ b/src/main/comments.js @@ -52,12 +52,12 @@ function getSortedChildNodes(node, options, resultArray) { (typeof node === "object" && Object.entries(node) .filter( - ([n]) => - n !== "enclosingNode" && - n !== "precedingNode" && - n !== "followingNode" && - n !== "tokens" && - n !== "comments" + ([key]) => + key !== "enclosingNode" && + key !== "precedingNode" && + key !== "followingNode" && + key !== "tokens" && + key !== "comments" ) .map(([, value]) => value)); From ff32d6b823eaad777b0d95255d2e78560df63ff8 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 11 Mar 2021 04:20:47 +0800 Subject: [PATCH 07/89] Playground: Order options (#10501) * Playground: Order options * Remove `rangeStart/End` from `ENABLED_OPTIONS` --- website/playground/Playground.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/playground/Playground.js b/website/playground/Playground.js index 9ec84dac7..0892dff1c 100644 --- a/website/playground/Playground.js +++ b/website/playground/Playground.js @@ -137,6 +137,12 @@ class Playground extends React.Component { getMarkdown({ formatted, reformatted, full, doc }) { const { content, options } = this.state; const { availableOptions, version } = this.props; + const orderedOptions = orderOptions(availableOptions, [ + ...ENABLED_OPTIONS, + "rangeStart", + "rangeEnd", + ]); + const cliOptions = util.buildCliArgs(orderedOptions, options); return formatMarkdown({ input: content, @@ -146,7 +152,7 @@ class Playground extends React.Component { version, url: window.location.href, options, - cliOptions: util.buildCliArgs(availableOptions, options), + cliOptions, full, }); } From 1ce6b8dc3d3a21155bd95cb56824fe8e720837b7 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 12 Mar 2021 06:24:45 +0800 Subject: [PATCH 08/89] Fix syntax error on JSON range formatting (#10497) --- changelog_unreleased/json/10497.md | 16 + src/main/range-util.js | 42 ++- .../range/__snapshots__/jsfmt.spec.js.snap | 335 ++++++++++++++++++ tests/json/range/cross-array.json | 10 + tests/json/range/cross-array2.json | 8 + tests/json/range/cross-object-2.json | 5 + tests/json/range/cross-object.json | 6 + tests/json/range/identifier-2.json | 1 + tests/json/range/inside-array.json | 8 + tests/json/range/inside-object.json | 4 + tests/json/range/issue-4009.json | 3 + tests/json/range/issue-7116.json | 1 + .../__snapshots__/jsfmt.spec.js.snap | 32 ++ tests/json/range/json-stringify/jsfmt.spec.js | 1 + .../json-stringify/template-literal.json | 6 + .../json5/__snapshots__/jsfmt.spec.js.snap | 28 ++ tests/json/range/json5/inside-array.json | 8 + tests/json/range/json5/jsfmt.spec.js | 1 + tests/json/range/number.json | 1 + tests/json/range/template-literal-2.json | 6 + tests/json/range/template-literal.json | 6 + tests/json/range/unary-expression-2.json | 2 + tests/json/range/unary-expression.json | 9 + 23 files changed, 534 insertions(+), 5 deletions(-) create mode 100644 changelog_unreleased/json/10497.md create mode 100644 tests/json/range/cross-array.json create mode 100644 tests/json/range/cross-array2.json create mode 100644 tests/json/range/cross-object-2.json create mode 100644 tests/json/range/cross-object.json create mode 100644 tests/json/range/identifier-2.json create mode 100644 tests/json/range/inside-array.json create mode 100644 tests/json/range/inside-object.json create mode 100644 tests/json/range/issue-4009.json create mode 100644 tests/json/range/issue-7116.json create mode 100644 tests/json/range/json-stringify/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/json/range/json-stringify/jsfmt.spec.js create mode 100644 tests/json/range/json-stringify/template-literal.json create mode 100644 tests/json/range/json5/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/json/range/json5/inside-array.json create mode 100644 tests/json/range/json5/jsfmt.spec.js create mode 100644 tests/json/range/number.json create mode 100644 tests/json/range/template-literal-2.json create mode 100644 tests/json/range/template-literal.json create mode 100644 tests/json/range/unary-expression-2.json create mode 100644 tests/json/range/unary-expression.json diff --git a/changelog_unreleased/json/10497.md b/changelog_unreleased/json/10497.md new file mode 100644 index 000000000..10e7b5dc7 --- /dev/null +++ b/changelog_unreleased/json/10497.md @@ -0,0 +1,16 @@ +#### Fix syntax error on JSON range formatting (#10497 by @fisker) + + +```js +// Input +[{ a: 1.0000}, {"b": 2.0000 }] +// ^^^^^^^^^^^ range + +// Prettier stable +SyntaxError: Unexpected token (1:4) +> 1 | "b": 2.0000 + | ^ + +// Prettier main +[{ a: 1.0000}, { "b": 2.0 }] +``` diff --git a/src/main/range-util.js b/src/main/range-util.js index 3152e1168..6e27aff84 100644 --- a/src/main/range-util.js +++ b/src/main/range-util.js @@ -3,6 +3,23 @@ const assert = require("assert"); const comments = require("./comments"); +const isJsonParser = ({ parser }) => + parser === "json" || parser === "json5" || parser === "json-stringify"; + +function findCommonAncestor(startNodeAndParents, endNodeAndParents) { + const startNodeAndAncestors = [ + startNodeAndParents.node, + ...startNodeAndParents.parentNodes, + ]; + const endNodeAndAncestors = new Set([ + endNodeAndParents.node, + ...endNodeAndParents.parentNodes, + ]); + return startNodeAndAncestors.find( + (node) => jsonSourceElements.has(node.type) && endNodeAndAncestors.has(node) + ); +} + function findSiblingAncestors(startNodeAndParents, endNodeAndParents, opts) { let resultStartNode = startNodeAndParents.node; let resultEndNode = endNodeAndParents.node; @@ -109,6 +126,8 @@ const jsonSourceElements = new Set([ "NumericLiteral", "BooleanLiteral", "NullLiteral", + "UnaryExpression", + "TemplateLiteral", ]); const graphqlSourceElements = new Set([ "OperationDefinition", @@ -143,6 +162,8 @@ function isSourceElement(opts, node, parentNode) { case "meriyah": return isJsSourceElement(node.type, parentNode && parentNode.type); case "json": + case "json5": + case "json-stringify": return jsonSourceElements.has(node.type); case "graphql": return graphqlSourceElements.has(node.kind); @@ -195,11 +216,22 @@ function calculateRange(text, opts, ast) { }; } - const { startNode, endNode } = findSiblingAncestors( - startNodeAndParents, - endNodeAndParents, - opts - ); + let startNode; + let endNode; + if (isJsonParser(opts)) { + const commonAncestor = findCommonAncestor( + startNodeAndParents, + endNodeAndParents + ); + startNode = commonAncestor; + endNode = commonAncestor; + } else { + ({ startNode, endNode } = findSiblingAncestors( + startNodeAndParents, + endNodeAndParents, + opts + )); + } return { rangeStart: Math.min(locStart(startNode), locStart(endNode)), diff --git a/tests/json/range/__snapshots__/jsfmt.spec.js.snap b/tests/json/range/__snapshots__/jsfmt.spec.js.snap index dcdef5f99..53213d9c2 100644 --- a/tests/json/range/__snapshots__/jsfmt.spec.js.snap +++ b/tests/json/range/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,115 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`cross-array.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 51 +rangeStart: 12 + | | printWidth +=====================================input====================================== + 1 | [{ + 2 | a: [ + 3 | 1, +> 4 | 2, 3,4,5,6, 7, + | ^^^^^^^^^^^^^^^^^^^^ +> 5 | 8 + | ^ +> 6 | ], + | ^ +> 7 | b: [1, 2, 3, 4], + | ^^^^^^^^^^^^^ + 8 | c: [1, 2] + 9 | } + 10 | ,{a: 2}] + 11 | +=====================================output===================================== +[{ + "a": [1, 2, 3, 4, 5, 6, 7, 8], + "b": [1, 2, 3, 4], + "c": [1, 2] +} +,{a: 2}] + +================================================================================ +`; + +exports[`cross-array2.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 36 +rangeStart: 11 + | | printWidth +=====================================input====================================== + 1 | { + 2 | a: [ + 3 | 1, +> 4 | 2, 3,4,5,6, [1, 2, 3, 4], 7, + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + 5 | 8 + 6 | ], + 7 | c: [1, 2] + 8 | } + 9 | +=====================================output===================================== +{ +a: [1, 2, 3, 4, 5, 6, [1, 2, 3, 4], 7, 8], +c: [1, 2] +} + +================================================================================ +`; + +exports[`cross-object.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 31 +rangeStart: 12 + | | printWidth +=====================================input====================================== + 1 | [{a: +> 2 | { "b": 2, "c": 3 }, + | ^^^^^^^^^^^^ +> 3 | b: {d:4}, + | ^^^^^^ + 4 | c: {d: 6} + 5 | }, + 6 | {a: 1}] + 7 | +=====================================output===================================== +[{ "a": { "b": 2, "c": 3 }, "b": { "d": 4 }, "c": { "d": 6 } }, +{a: 1}] + +================================================================================ +`; + +exports[`cross-object-2.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 28 +rangeStart: 11 + | | printWidth +=====================================input====================================== + 1 | {a: +> 2 | { "b": 2, "c": 3, + | ^^^^^^^^^^ +> 3 | d: {d:4}, }, + | ^^^^^^ + 4 | c: {d: 6} + 5 | } + 6 | +=====================================output===================================== +{a: +{ "b": 2, "c": 3, "d": { "d": 4 } }, +c: {d: 6} +} + +================================================================================ +`; + exports[`identifier.json format 1`] = ` ====================================options===================================== parsers: ["json"] @@ -17,6 +127,113 @@ rangeStart: 1 ================================================================================ `; +exports[`identifier-2.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 3 +rangeStart: 2 + | | printWidth +=====================================input====================================== +> 1 | Infinity + | ^ + 2 | +=====================================output===================================== +Infinity + +================================================================================ +`; + +exports[`inside-array.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 30 +rangeStart: 11 + | | printWidth +=====================================input====================================== + 1 | { + 2 | a: [ + 3 | 1, +> 4 | 2, 3,4,5,6, 7, + | ^^^^^^^^^^^^^^^^^^^ + 5 | 8 + 6 | ], + 7 | b: [1, 2, 3, 4] + 8 | } + 9 | +=====================================output===================================== +{ +a: [1, 2, 3, 4, 5, 6, 7, 8], +b: [1, 2, 3, 4] +} + +================================================================================ +`; + +exports[`inside-object.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 20 +rangeStart: 11 + | | printWidth +=====================================input====================================== + 1 | {a: +> 2 | { "b": 2, "c": 3 }, + | ^^^^^^^^^ + 3 | b: {d:4} + 4 | } + 5 | +=====================================output===================================== +{a: +{ "b": 2, "c": 3 }, +b: {d:4} +} + +================================================================================ +`; + +exports[`issue-4009.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 19 +rangeStart: 1 + | | printWidth +=====================================input====================================== +> 1 | { + | ^ +> 2 | "foo": "bar" + | ^^^^^^^^^^^^^^^^ +> 3 | } + | ^ + 4 | +=====================================output===================================== +{ + "foo": "bar" +} + +================================================================================ +`; + +exports[`issue-7116.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 7 +rangeStart: 4 + | | printWidth +=====================================input====================================== +> 1 | {"b": 2} + | ^^^ + 2 | +=====================================output===================================== +{ "b": 2 } + +================================================================================ +`; + exports[`issue2297.json format 1`] = ` ====================================options===================================== parsers: ["json"] @@ -33,3 +250,121 @@ rangeStart: 5 ================================================================================ `; + +exports[`number.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 16 +rangeStart: 7 + | | printWidth +=====================================input====================================== +> 1 | { "b": 2, "c": 3 } + | ^^^^^^^^^ + 2 | +=====================================output===================================== +{ "b": 2, "c": 3 } + +================================================================================ +`; + +exports[`template-literal.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 7 +rangeStart: 6 + | | printWidth +=====================================input====================================== + 1 | [ +> 2 | {a:\`a\`,n: + | ^ + 3 | ''}, + 4 | {a:\`a\`,n: + 5 | ''} + 6 | ] + 7 | +=====================================output===================================== +[ +{a:\`a\`,n: +''}, +{a:\`a\`,n: +''} +] + +================================================================================ +`; + +exports[`template-literal-2.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 7 +rangeStart: 4 + | | printWidth +=====================================input====================================== + 1 | [ +> 2 | {a:\`a\`,n: + | ^^^ + 3 | ''}, + 4 | {a:\`a\`,n: + 5 | ''} + 6 | ] + 7 | +=====================================output===================================== +[ +{ "a": \`a\`, "n": "" }, +{a:\`a\`,n: +''} +] + +================================================================================ +`; + +exports[`unary-expression.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 15 +rangeStart: 9 + | | printWidth +=====================================input====================================== + 1 | {a: + 2 | [ + 3 | 1, +> 4 | -2, + | ^^^ +> 5 | -3 + | ^^ + 6 | + 7 | ], + 8 | b: [1, 2] + 9 | } + 10 | +=====================================output===================================== +{a: +[1, -2, -3], +b: [1, 2] +} + +================================================================================ +`; + +exports[`unary-expression-2.json format 1`] = ` +====================================options===================================== +parsers: ["json"] +printWidth: 80 +rangeEnd: 9 +rangeStart: 2 + | | printWidth +=====================================input====================================== + 1 | - +> 2 | 2.00000 + | ^^^^^^^ + 3 | +=====================================output===================================== +- +2.0 + +================================================================================ +`; diff --git a/tests/json/range/cross-array.json b/tests/json/range/cross-array.json new file mode 100644 index 000000000..702f3c890 --- /dev/null +++ b/tests/json/range/cross-array.json @@ -0,0 +1,10 @@ +[{ +a: [ +1, + <<>>2, 3,4,5,6, 7, +8 +], +b: [1, 2, <<>> 3, 4], +c: [1, 2] +} +,{a: 2}] diff --git a/tests/json/range/cross-array2.json b/tests/json/range/cross-array2.json new file mode 100644 index 000000000..6c1585ce2 --- /dev/null +++ b/tests/json/range/cross-array2.json @@ -0,0 +1,8 @@ +{ +a: [ +1, + <<>>2, 3,4,5,6, [1, 2, <<>> 3, 4], 7, +8 +], +c: [1, 2] +} diff --git a/tests/json/range/cross-object-2.json b/tests/json/range/cross-object-2.json new file mode 100644 index 000000000..05c3314fb --- /dev/null +++ b/tests/json/range/cross-object-2.json @@ -0,0 +1,5 @@ +{a: +{ "b": <<>>2, "c": 3, +d: {d:<<>>4}, }, +c: {d: 6} +} diff --git a/tests/json/range/cross-object.json b/tests/json/range/cross-object.json new file mode 100644 index 000000000..891c742a0 --- /dev/null +++ b/tests/json/range/cross-object.json @@ -0,0 +1,6 @@ +[{a: +{ "b": <<>>2, "c": 3 }, +b: {d:<<>>4}, +c: {d: 6} +}, +{a: 1}] diff --git a/tests/json/range/identifier-2.json b/tests/json/range/identifier-2.json new file mode 100644 index 000000000..6dff4c257 --- /dev/null +++ b/tests/json/range/identifier-2.json @@ -0,0 +1 @@ +In<<>>f<<>>inity diff --git a/tests/json/range/inside-array.json b/tests/json/range/inside-array.json new file mode 100644 index 000000000..2f740ea15 --- /dev/null +++ b/tests/json/range/inside-array.json @@ -0,0 +1,8 @@ +{ +a: [ +1, + <<>>2, 3,4,5,6, 7<<>>, +8 +], +b: [1, 2, 3, 4] +} diff --git a/tests/json/range/inside-object.json b/tests/json/range/inside-object.json new file mode 100644 index 000000000..13bbf7a98 --- /dev/null +++ b/tests/json/range/inside-object.json @@ -0,0 +1,4 @@ +{a: +{ "b": <<>>2, "c": 3<<>> }, +b: {d:4} +} diff --git a/tests/json/range/issue-4009.json b/tests/json/range/issue-4009.json new file mode 100644 index 000000000..fd21f6a78 --- /dev/null +++ b/tests/json/range/issue-4009.json @@ -0,0 +1,3 @@ +{<<>> + "foo": "bar" +<<>>} diff --git a/tests/json/range/issue-7116.json b/tests/json/range/issue-7116.json new file mode 100644 index 000000000..c55c0f83b --- /dev/null +++ b/tests/json/range/issue-7116.json @@ -0,0 +1 @@ +{"b"<<>>: 2<<>>} diff --git a/tests/json/range/json-stringify/__snapshots__/jsfmt.spec.js.snap b/tests/json/range/json-stringify/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..7e343effc --- /dev/null +++ b/tests/json/range/json-stringify/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`template-literal.json format 1`] = ` +====================================options===================================== +parsers: ["json-stringify"] +printWidth: 80 +rangeEnd: 8 +rangeStart: 7 + | | printWidth +=====================================input====================================== + 1 | [ +> 2 | {a:\`aaa\`,n: + | ^ + 3 | ''}, + 4 | {a:\`a\`,n: + 5 | ''} + 6 | ] + 7 | +=====================================output===================================== +[ + { + "a": "aaa", + "n": "" + }, + { + "a": "a", + "n": "" + } +] + +================================================================================ +`; diff --git a/tests/json/range/json-stringify/jsfmt.spec.js b/tests/json/range/json-stringify/jsfmt.spec.js new file mode 100644 index 000000000..22498fda3 --- /dev/null +++ b/tests/json/range/json-stringify/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["json-stringify"]); diff --git a/tests/json/range/json-stringify/template-literal.json b/tests/json/range/json-stringify/template-literal.json new file mode 100644 index 000000000..cde30cef7 --- /dev/null +++ b/tests/json/range/json-stringify/template-literal.json @@ -0,0 +1,6 @@ +[ +{a:`a<<>>a<<>>a`,n: +''}, +{a:`a`,n: +''} +] diff --git a/tests/json/range/json5/__snapshots__/jsfmt.spec.js.snap b/tests/json/range/json5/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..b2da96a49 --- /dev/null +++ b/tests/json/range/json5/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,28 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`inside-array.json format 1`] = ` +====================================options===================================== +parsers: ["json5"] +printWidth: 80 +rangeEnd: 30 +rangeStart: 11 + | | printWidth +=====================================input====================================== + 1 | { + 2 | a: [ + 3 | 1, +> 4 | 2, 3,4,5,6, 7, + | ^^^^^^^^^^^^^^^^^^^ + 5 | 8 + 6 | ], + 7 | b: [1, 2, 3, 4] + 8 | } + 9 | +=====================================output===================================== +{ +a: [1, 2, 3, 4, 5, 6, 7, 8], +b: [1, 2, 3, 4] +} + +================================================================================ +`; diff --git a/tests/json/range/json5/inside-array.json b/tests/json/range/json5/inside-array.json new file mode 100644 index 000000000..2f740ea15 --- /dev/null +++ b/tests/json/range/json5/inside-array.json @@ -0,0 +1,8 @@ +{ +a: [ +1, + <<>>2, 3,4,5,6, 7<<>>, +8 +], +b: [1, 2, 3, 4] +} diff --git a/tests/json/range/json5/jsfmt.spec.js b/tests/json/range/json5/jsfmt.spec.js new file mode 100644 index 000000000..a4031df29 --- /dev/null +++ b/tests/json/range/json5/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["json5"]); diff --git a/tests/json/range/number.json b/tests/json/range/number.json new file mode 100644 index 000000000..29bea7dc1 --- /dev/null +++ b/tests/json/range/number.json @@ -0,0 +1 @@ +{ "b": <<>>2, "c": 3<<>> } diff --git a/tests/json/range/template-literal-2.json b/tests/json/range/template-literal-2.json new file mode 100644 index 000000000..2c923a87a --- /dev/null +++ b/tests/json/range/template-literal-2.json @@ -0,0 +1,6 @@ +[ +{a<<>>:`a<<>>`,n: +''}, +{a:`a`,n: +''} +] diff --git a/tests/json/range/template-literal.json b/tests/json/range/template-literal.json new file mode 100644 index 000000000..2119b7925 --- /dev/null +++ b/tests/json/range/template-literal.json @@ -0,0 +1,6 @@ +[ +{a:`<<>>a<<>>`,n: +''}, +{a:`a`,n: +''} +] diff --git a/tests/json/range/unary-expression-2.json b/tests/json/range/unary-expression-2.json new file mode 100644 index 000000000..e3f21808f --- /dev/null +++ b/tests/json/range/unary-expression-2.json @@ -0,0 +1,2 @@ +- +<<>>2.00000<<>> diff --git a/tests/json/range/unary-expression.json b/tests/json/range/unary-expression.json new file mode 100644 index 000000000..d9e9c931b --- /dev/null +++ b/tests/json/range/unary-expression.json @@ -0,0 +1,9 @@ +{a: +[ +1, +<<>>-2, +-3<<>> + +], +b: [1, 2] +} From 3995c2a1a1839753e08f0576c4161876bc5ad62e Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 14 Mar 2021 04:07:22 +0800 Subject: [PATCH 09/89] Whitelist recovered babel parse errors (#10495) --- src/language-js/parser-babel.js | 92 +++-- .../js/async/__snapshots__/jsfmt.spec.js.snap | 64 ---- tests/js/async/await-keyword.js | 11 - tests/js/async/jsfmt.spec.js | 8 +- .../__snapshots__/jsfmt.spec.js.snap | 70 ---- .../js/await-with-parens/await-with-parens.js | 18 - tests/js/await-with-parens/jsfmt.spec.js | 6 - .../js/await/__snapshots__/jsfmt.spec.js.snap | 119 ------- tests/js/await/in-sync-function.js | 12 - tests/js/await/jsfmt.spec.js | 3 - tests/js/await/out-of-function.js | 5 - .../__snapshots__/jsfmt.spec.js.snap | 53 +-- tests/js/babel-plugins/jsfmt.spec.js | 2 - tests/js/babel-plugins/optional-chaining.js | 16 +- .../__snapshots__/jsfmt.spec.js.snap | 70 ---- tests/js/class-static-block/await.js | 9 - .../literal/__snapshots__/jsfmt.spec.js.snap | 59 +--- tests/js/literal/jsfmt.spec.js | 4 +- tests/js/literal/number.js | 2 +- .../objects/__snapshots__/jsfmt.spec.js.snap | 119 +------ tests/js/objects/getter-setter.js | 4 +- .../js/objects/invalid-accessor-generator.js | 9 - tests/js/objects/jsfmt.spec.js | 16 +- .../record/__snapshots__/jsfmt.spec.js.snap | 52 --- tests/js/record/invalid-record-method.js | 9 - .../__snapshots__/jsfmt.spec.js.snap | 38 +- tests/js/reserved-word/interfaces.js | 7 - tests/js/reserved-word/jsfmt.spec.js | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 35 -- tests/js/variable_declarator/jsfmt.spec.js | 8 +- .../jsx/jsx/__snapshots__/jsfmt.spec.js.snap | 32 +- tests/jsx/jsx/conditional-expression.js | 4 +- .../__snapshots__/jsfmt.spec.js.snap | 325 ++++++++++++++++++ .../misc/errors/js/async-await/jsfmt.spec.js | 90 +++++ .../literal/__snapshots__/jsfmt.spec.js.snap | 22 ++ .../errors}/js/literal/invalid-exponent.js | 0 tests/misc/errors/js/literal/jsfmt.spec.js | 1 + .../object/__snapshots__/jsfmt.spec.js.snap | 97 ++++++ .../misc/errors/js/object/getter-generator.js | 3 + .../errors/js/object/getter-with-parameter.js | 1 + tests/misc/errors/js/object/jsfmt.spec.js | 1 + .../misc/errors/js/object/setter-generator.js | 3 + .../js/object/setter-without-parameter.js} | 0 .../__snapshots__/jsfmt.spec.js.snap | 115 +++++++ .../errors/js/optional-chaining/jsfmt.spec.js | 21 ++ .../record/__snapshots__/jsfmt.spec.js.snap | 91 +++++ tests/misc/errors/js/record/jsfmt.spec.js | 13 + .../__snapshots__/jsfmt.spec.js.snap | 97 ++++++ .../errors/js/reserved-word/jsfmt.spec.js | 28 ++ .../__snapshots__/jsfmt.spec.js.snap | 22 ++ .../js/variable-declarator}/invalid-const.js | 0 .../js/variable-declarator/jsfmt.spec.js | 1 + tests_config/run_spec.js | 4 +- 53 files changed, 1051 insertions(+), 844 deletions(-) delete mode 100644 tests/js/async/await-keyword.js delete mode 100644 tests/js/await-with-parens/__snapshots__/jsfmt.spec.js.snap delete mode 100644 tests/js/await-with-parens/await-with-parens.js delete mode 100644 tests/js/await-with-parens/jsfmt.spec.js delete mode 100644 tests/js/await/__snapshots__/jsfmt.spec.js.snap delete mode 100644 tests/js/await/in-sync-function.js delete mode 100644 tests/js/await/jsfmt.spec.js delete mode 100644 tests/js/await/out-of-function.js delete mode 100644 tests/js/class-static-block/await.js delete mode 100644 tests/js/objects/invalid-accessor-generator.js delete mode 100644 tests/js/record/invalid-record-method.js create mode 100644 tests/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/async-await/jsfmt.spec.js create mode 100644 tests/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap rename tests/{ => misc/errors}/js/literal/invalid-exponent.js (100%) create mode 100644 tests/misc/errors/js/literal/jsfmt.spec.js create mode 100644 tests/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/object/getter-generator.js create mode 100644 tests/misc/errors/js/object/getter-with-parameter.js create mode 100644 tests/misc/errors/js/object/jsfmt.spec.js create mode 100644 tests/misc/errors/js/object/setter-generator.js rename tests/{js/objects/invalid-setter.js => misc/errors/js/object/setter-without-parameter.js} (100%) create mode 100644 tests/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/optional-chaining/jsfmt.spec.js create mode 100644 tests/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/record/jsfmt.spec.js create mode 100644 tests/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/reserved-word/jsfmt.spec.js create mode 100644 tests/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap rename tests/{js/variable_declarator => misc/errors/js/variable-declarator}/invalid-const.js (100%) create mode 100644 tests/misc/errors/js/variable-declarator/jsfmt.spec.js diff --git a/src/language-js/parser-babel.js b/src/language-js/parser-babel.js index 3e4bad413..40164d728 100644 --- a/src/language-js/parser-babel.js +++ b/src/language-js/parser-babel.js @@ -144,31 +144,79 @@ const parseTypeScript = createParse( ); const parseExpression = createParse("parseExpression", appendPlugins(["jsx"])); -const messagesShouldThrow = new Set([ - // TSErrors.UnexpectedTypeAnnotation - // https://github.com/babel/babel/blob/008fe25ae22e78288fbc637d41069bb4a1040987/packages/babel-parser/src/plugins/typescript/index.js#L95 - "Did not expect a type annotation here.", - // ErrorMessages.ModuleAttributeDifferentFromType - // https://github.com/babel/babel/blob/a023b6456cac4505096028f91c5b78829955bfc2/packages/babel-parser/src/parser/error-message.js#L92 - "The only accepted module attribute is `type`", - // FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction - // https://github.com/babel/babel/blob/a023b6456cac4505096028f91c5b78829955bfc2/packages/babel-parser/src/plugins/flow.js#L118 - "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`", - // Rethrow on omitted call arguments: foo("a", , "b"); - // ErrorMessages.UnexpectedToken - "Unexpected token ','", - // ErrorMessages.EscapedCharNotAnIdentifier - "Invalid Unicode escape", - // ErrorMessages.MissingUnicodeEscape - "Expecting Unicode escape sequence \\uXXXX", - // ErrorMessages.MissingSemicolon - "Missing semicolon", -]); +const allowedMessages = new Set([ + "The only valid numeric escape in strict mode is '\\0'", + "'with' in strict mode", + "Legacy octal literals are not allowed in strict mode", + "Invalid left-hand side in parenthesized expression", + "Invalid left-hand side in assignment expression", + "Invalid left-hand side in postfix operation", + "Invalid left-hand side in prefix operation", + + "Type argument list cannot be empty.", + "Type parameter list cannot be empty.", + "Type parameters cannot appear on a constructor declaration.", + + "A parameter property may not be declared using a binding pattern.", + "A parameter property is only allowed in a constructor implementation.", + + "Tuple members must all have names or all not have names.", + "Tuple members must be labeled with a simple identifier.", + + "'abstract' modifier can only appear on a class, method, or property declaration.", + "'readonly' modifier can only appear on a property declaration or index signature.", + "Class methods cannot have the 'declare' modifier", + "Class methods cannot have the 'readonly' modifier", + "'public' modifier cannot appear on a type member.", + "'private' modifier cannot appear on a type member.", + "'protected' modifier cannot appear on a type member.", + "'static' modifier cannot appear on a type member.", + "'declare' modifier cannot appear on a type member.", + "'abstract' modifier cannot appear on a type member.", + "'readonly' modifier cannot appear on a type member.", + "Accessibility modifier already seen.", + "Index signatures cannot have the 'declare' modifier", + + "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", + "Argument name clash", + "import() requires exactly one or two arguments", + "Invalid decimal", + "Unexpected trailing comma after rest element", + "Decorators cannot be used to decorate parameters", + "Unterminated JSX contents", + "Invalid parenthesized assignment pattern", + 'Unexpected token, expected "}"', + "Unexpected token :", + "Unexpected reserved word 'package'", + 'Duplicate key "type" is not allowed in module attributes', + "Cannot use new with import(...)", + "No line break is allowed before '=>'", + "Invalid escape sequence in template", + "Abstract methods can only appear within an abstract class.", + "Decorators cannot be used to decorate object literal properties", + "A required element cannot follow an optional element.", + "A binding pattern parameter cannot be optional in an implementation signature.", + "Initializers are not allowed in ambient contexts.", + "A type-only import can specify a default import or named bindings, but not both.", + "An implementation cannot be declared in ambient contexts.", + "Classes may not have a field named 'constructor'", +]); function shouldRethrowRecoveredError(error) { const [, message] = error.message.match(/(.*?)\s*\(\d+:\d+\)/); - // Only works for literal message - return messagesShouldThrow.has(message); + + if ( + allowedMessages.has(message) || + /^Identifier '.*?' has already been declared$/.test(message) || + /^Private name #.*? is not defined$/.test(message) || + /^`.*?` has already been exported\. Exported identifiers must be unique\.$/.test( + message + ) + ) { + return false; + } + + return true; } const babel = createParser(parse); diff --git a/tests/js/async/__snapshots__/jsfmt.spec.js.snap b/tests/js/async/__snapshots__/jsfmt.spec.js.snap index 068620767..ce5478bba 100644 --- a/tests/js/async/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/async/__snapshots__/jsfmt.spec.js.snap @@ -51,70 +51,6 @@ printWidth: 80 ================================================================================ `; -exports[`await-keyword.js [espree] format 1`] = ` -"Cannot use keyword 'await' outside an async function (2:20) - 1 | async function foo() { -> 2 | function bar(x = await 2) {} - | ^ - 3 | } - 4 | - 5 | async (x = await 2) => {};" -`; - -exports[`await-keyword.js [flow] format 1`] = ` -"Unexpected number, expected the token \`,\` (2:26) - 1 | async function foo() { -> 2 | function bar(x = await 2) {} - | ^ - 3 | } - 4 | - 5 | async (x = await 2) => {};" -`; - -exports[`await-keyword.js [meriyah] format 1`] = ` -"[2:24]: 'Await' may not be used as an identifier in this context (2:24) - 1 | async function foo() { -> 2 | function bar(x = await 2) {} - | ^ - 3 | } - 4 | - 5 | async (x = await 2) => {};" -`; - -exports[`await-keyword.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "flow", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -async function foo() { - function bar(x = await 2) {} -} - -async (x = await 2) => {}; - -async function foo() { - function bar(x = await (2)) {} -} - -async (x = await (2)) => {}; - -=====================================output===================================== -async function foo() { - function bar(x = await 2) {} -} - -async (x = await 2) => {}; - -async function foo() { - function bar(x = await(2)) {} -} - -async (x = await 2) => {}; - -================================================================================ -`; - exports[`await-parse.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/async/await-keyword.js b/tests/js/async/await-keyword.js deleted file mode 100644 index a6c62e5df..000000000 --- a/tests/js/async/await-keyword.js +++ /dev/null @@ -1,11 +0,0 @@ -async function foo() { - function bar(x = await 2) {} -} - -async (x = await 2) => {}; - -async function foo() { - function bar(x = await (2)) {} -} - -async (x = await (2)) => {}; diff --git a/tests/js/async/jsfmt.spec.js b/tests/js/async/jsfmt.spec.js index 87d77473a..eb85eda6b 100644 --- a/tests/js/async/jsfmt.spec.js +++ b/tests/js/async/jsfmt.spec.js @@ -1,7 +1 @@ -run_spec(__dirname, ["babel", "flow", "typescript"], { - errors: { - flow: ["await-keyword.js"], - espree: ["await-keyword.js"], - meriyah: ["await-keyword.js"], - }, -}); +run_spec(__dirname, ["babel", "flow", "typescript"]); diff --git a/tests/js/await-with-parens/__snapshots__/jsfmt.spec.js.snap b/tests/js/await-with-parens/__snapshots__/jsfmt.spec.js.snap deleted file mode 100644 index 77bb2b58b..000000000 --- a/tests/js/await-with-parens/__snapshots__/jsfmt.spec.js.snap +++ /dev/null @@ -1,70 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`await-with-parens.js [espree] format 1`] = ` -"Cannot use keyword 'await' outside an async function (1:25) -> 1 | function foo(promise) { await (promise); } - | ^ - 2 | - 3 | function a() { - 4 | return await (1)" -`; - -exports[`await-with-parens.js [meriyah] format 1`] = ` -"[1:29]: 'Await' may not be used as an identifier in this context (1:29) -> 1 | function foo(promise) { await (promise); } - | ^ - 2 | - 3 | function a() { - 4 | return await (1)" -`; - -exports[`await-with-parens.js format 1`] = ` -====================================options===================================== -parsers: ["babel"] -printWidth: 80 - | printWidth -=====================================input====================================== -function foo(promise) { await (promise); } - -function a() { - return await (1) -} - -() => { await (x) }; - -function foo() { - await - (foo); -} - -export class C { - p = await (0); -} - -await (0); - -=====================================output===================================== -function foo(promise) { - await(promise); -} - -function a() { - return await(1); -} - -() => { - await(x); -}; - -function foo() { - await(foo); -} - -export class C { - p = await 0; -} - -await 0; - -================================================================================ -`; diff --git a/tests/js/await-with-parens/await-with-parens.js b/tests/js/await-with-parens/await-with-parens.js deleted file mode 100644 index a13cfda42..000000000 --- a/tests/js/await-with-parens/await-with-parens.js +++ /dev/null @@ -1,18 +0,0 @@ -function foo(promise) { await (promise); } - -function a() { - return await (1) -} - -() => { await (x) }; - -function foo() { - await - (foo); -} - -export class C { - p = await (0); -} - -await (0); diff --git a/tests/js/await-with-parens/jsfmt.spec.js b/tests/js/await-with-parens/jsfmt.spec.js deleted file mode 100644 index c57dff579..000000000 --- a/tests/js/await-with-parens/jsfmt.spec.js +++ /dev/null @@ -1,6 +0,0 @@ -run_spec(__dirname, ["babel"], { - errors: { - espree: true, - meriyah: true, - }, -}); diff --git a/tests/js/await/__snapshots__/jsfmt.spec.js.snap b/tests/js/await/__snapshots__/jsfmt.spec.js.snap deleted file mode 100644 index 1e145b8ce..000000000 --- a/tests/js/await/__snapshots__/jsfmt.spec.js.snap +++ /dev/null @@ -1,119 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`in-sync-function.js [espree] format 1`] = ` -"Cannot use keyword 'await' outside an async function (1:25) -> 1 | function foo(promise) { await promise; } - | ^ - 2 | - 3 | function a() { - 4 | return await 1" -`; - -exports[`in-sync-function.js [flow] format 1`] = ` -"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:31) -> 1 | function foo(promise) { await promise; } - | ^^^^^^^ - 2 | - 3 | function a() { - 4 | return await 1" -`; - -exports[`in-sync-function.js [meriyah] format 1`] = ` -"[1:29]: 'Await' may not be used as an identifier in this context (1:29) -> 1 | function foo(promise) { await promise; } - | ^ - 2 | - 3 | function a() { - 4 | return await 1" -`; - -exports[`in-sync-function.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "flow", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -function foo(promise) { await promise; } - -function a() { - return await 1 -} - -() => { await x }; - -function foo() { - await - foo; -} - -=====================================output===================================== -function foo(promise) { - await promise; -} - -function a() { - return await 1; -} - -() => { - await x; -}; - -function foo() { - await; - foo; -} - -================================================================================ -`; - -exports[`out-of-function.js [espree] format 1`] = ` -"Unexpected token = (2:5) - 1 | export class C { -> 2 | p = await 0; - | ^ - 3 | } - 4 | - 5 | await 0;" -`; - -exports[`out-of-function.js [flow] format 1`] = ` -"Unexpected number, expected the end of an expression statement (\`;\`) (5:7) - 3 | } - 4 | -> 5 | await 0; - | ^ - 6 |" -`; - -exports[`out-of-function.js [meriyah] format 1`] = ` -"[2:11]: 'Await' may not be used as an identifier in this context (2:11) - 1 | export class C { -> 2 | p = await 0; - | ^ - 3 | } - 4 | - 5 | await 0;" -`; - -exports[`out-of-function.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "flow", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -export class C { - p = await 0; -} - -await 0; - -=====================================output===================================== -export class C { - p = await 0; -} - -await 0; - -================================================================================ -`; diff --git a/tests/js/await/in-sync-function.js b/tests/js/await/in-sync-function.js deleted file mode 100644 index 8bc6fd89f..000000000 --- a/tests/js/await/in-sync-function.js +++ /dev/null @@ -1,12 +0,0 @@ -function foo(promise) { await promise; } - -function a() { - return await 1 -} - -() => { await x }; - -function foo() { - await - foo; -} diff --git a/tests/js/await/jsfmt.spec.js b/tests/js/await/jsfmt.spec.js deleted file mode 100644 index 45e4c1230..000000000 --- a/tests/js/await/jsfmt.spec.js +++ /dev/null @@ -1,3 +0,0 @@ -run_spec(__dirname, ["babel", "flow", "typescript"], { - errors: { espree: true, meriyah: true, flow: true }, -}); diff --git a/tests/js/await/out-of-function.js b/tests/js/await/out-of-function.js deleted file mode 100644 index 5d75cff21..000000000 --- a/tests/js/await/out-of-function.js +++ /dev/null @@ -1,5 +0,0 @@ -export class C { - p = await 0; -} - -await 0; diff --git a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index 18b08ab76..ad289cce9 100644 --- a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -1246,28 +1246,6 @@ try { ================================================================================ `; -exports[`optional-chaining.js [espree] format 1`] = ` -"Optional chaining cannot appear in the callee of new expressions (56:21) - 54 | }; - 55 | -> 56 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance - | ^ - 57 | - 58 | const safe5 = new obj?.qux?.baz(); // undefined - 59 | const safe6 = new obj?.foo.bar.qux?.(); // undefined" -`; - -exports[`optional-chaining.js [meriyah] format 1`] = ` -"[56:22]: Invalid optional chain from new expression (56:22) - 54 | }; - 55 | -> 56 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance - | ^ - 57 | - 58 | const safe5 = new obj?.qux?.baz(); // undefined - 59 | const safe6 = new obj?.foo.bar.qux?.(); // undefined" -`; - exports[`optional-chaining.js format 1`] = ` ====================================options===================================== parsers: ["babel", "babel-ts", "babel-flow"] @@ -1329,21 +1307,7 @@ const obj3 = { }, }; -const baz3 = new obj?.foo?.bar?.baz(); // baz instance - -const safe5 = new obj?.qux?.baz(); // undefined -const safe6 = new obj?.foo.bar.qux?.(); // undefined - -const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor - -// Top classes can be called directly, too. -class Test { -} -new Test?.(); // test instance - -new exists?.(); // undefined - -const obj = { +const obj4 = { foo: { bar: {} }, @@ -1406,20 +1370,7 @@ const obj3 = { }, }; -const baz3 = new (obj?.foo?.bar?.baz)(); // baz instance - -const safe5 = new (obj?.qux?.baz)(); // undefined -const safe6 = new (obj?.foo.bar.qux)()?.(); // undefined - -const willThrow = new (obj?.foo.bar.qux)(); // Error: not a constructor - -// Top classes can be called directly, too. -class Test {} -new Test(); // test instance - -new exists(); // undefined - -const obj = { +const obj4 = { foo: { bar: {}, }, diff --git a/tests/js/babel-plugins/jsfmt.spec.js b/tests/js/babel-plugins/jsfmt.spec.js index ff2862524..230016e7d 100644 --- a/tests/js/babel-plugins/jsfmt.spec.js +++ b/tests/js/babel-plugins/jsfmt.spec.js @@ -25,7 +25,6 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "throw-expressions.js", "typescript.js", "v8intrinsic.js", - "optional-chaining.js", "module-string-names.js", "class-static-block.js", ], @@ -47,7 +46,6 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "throw-expressions.js", "typescript.js", "v8intrinsic.js", - "optional-chaining.js", "class-static-block.js", "import-assertions-dynamic.js", "import-assertions-static.js", diff --git a/tests/js/babel-plugins/optional-chaining.js b/tests/js/babel-plugins/optional-chaining.js index ba5b994d8..d0d584205 100644 --- a/tests/js/babel-plugins/optional-chaining.js +++ b/tests/js/babel-plugins/optional-chaining.js @@ -53,21 +53,7 @@ const obj3 = { }, }; -const baz3 = new obj?.foo?.bar?.baz(); // baz instance - -const safe5 = new obj?.qux?.baz(); // undefined -const safe6 = new obj?.foo.bar.qux?.(); // undefined - -const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor - -// Top classes can be called directly, too. -class Test { -} -new Test?.(); // test instance - -new exists?.(); // undefined - -const obj = { +const obj4 = { foo: { bar: {} }, diff --git a/tests/js/class-static-block/__snapshots__/jsfmt.spec.js.snap b/tests/js/class-static-block/__snapshots__/jsfmt.spec.js.snap index bbad601be..70b25ea88 100644 --- a/tests/js/class-static-block/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/class-static-block/__snapshots__/jsfmt.spec.js.snap @@ -1,75 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`await.js [espree] format 1`] = ` -"Unexpected token { (3:20) - 1 | var C; - 2 | -> 3 | C = class { static { function f() { await } } }; - | ^ - 4 | - 5 | C = class { static { function f(await) {} } }; - 6 |" -`; - -exports[`await.js [meriyah] format 1`] = ` -"[3:20]: Unexpected token: '{' (3:20) - 1 | var C; - 2 | -> 3 | C = class { static { function f() { await } } }; - | ^ - 4 | - 5 | C = class { static { function f(await) {} } }; - 6 |" -`; - -exports[`await.js format 1`] = ` -====================================options===================================== -parsers: ["babel"] -printWidth: 80 - | printWidth -=====================================input====================================== -var C; - -C = class { static { function f() { await } } }; - -C = class { static { function f(await) {} } }; - -C = class { static { function f(x = await) {} } }; - -C = class { static { function f({ [await]: x }) {} } }; - -=====================================output===================================== -var C; - -C = class { - static { - function f() { - await; - } - } -}; - -C = class { - static { - function f(await) {} - } -}; - -C = class { - static { - function f(x = await) {} - } -}; - -C = class { - static { - function f({ [await]: x }) {} - } -}; - -================================================================================ -`; - exports[`class-static-block.js [espree] format 1`] = ` "Unexpected character '#' (2:10) 1 | class C { diff --git a/tests/js/class-static-block/await.js b/tests/js/class-static-block/await.js deleted file mode 100644 index d35f8544e..000000000 --- a/tests/js/class-static-block/await.js +++ /dev/null @@ -1,9 +0,0 @@ -var C; - -C = class { static { function f() { await } } }; - -C = class { static { function f(await) {} } }; - -C = class { static { function f(x = await) {} } }; - -C = class { static { function f({ [await]: x }) {} } }; diff --git a/tests/js/literal/__snapshots__/jsfmt.spec.js.snap b/tests/js/literal/__snapshots__/jsfmt.spec.js.snap index 5f5daa18c..b4d120560 100644 --- a/tests/js/literal/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/literal/__snapshots__/jsfmt.spec.js.snap @@ -1,60 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`invalid-exponent.js [espree] format 1`] = ` -"Invalid number (1:1) -> 1 | 12.3e - | ^ - 2 |" -`; - -exports[`invalid-exponent.js [meriyah] format 1`] = ` -"[1:5]: Non-number found after exponent indicator (1:5) -> 1 | 12.3e - | ^ - 2 |" -`; - -exports[`invalid-exponent.js [typescript] format 1`] = ` -"Digit expected. (1:6) -> 1 | 12.3e - | ^ - 2 |" -`; - -exports[`invalid-exponent.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -12.3e - -=====================================output===================================== -12.3e; - -================================================================================ -`; - -exports[`number.js [espree] format 1`] = ` -"Unexpected token : (2:17) - 1 | // parentheses around numeric literal should be preserved -> 2 | function test5(): string { - | ^ - 3 | return (100).toString(); - 4 | } - 5 |" -`; - -exports[`number.js [meriyah] format 1`] = ` -"[2:17]: Expected '{' (2:17) - 1 | // parentheses around numeric literal should be preserved -> 2 | function test5(): string { - | ^ - 3 | return (100).toString(); - 4 | } - 5 |" -`; - exports[`number.js format 1`] = ` ====================================options===================================== parsers: ["babel", "typescript"] @@ -62,7 +7,7 @@ printWidth: 80 | printWidth =====================================input====================================== // parentheses around numeric literal should be preserved -function test5(): string { +function test5() { return (100).toString(); } @@ -152,7 +97,7 @@ function test5(): string { =====================================output===================================== // parentheses around numeric literal should be preserved -function test5(): string { +function test5() { return (100).toString(); } diff --git a/tests/js/literal/jsfmt.spec.js b/tests/js/literal/jsfmt.spec.js index fc211ea90..d1f25e544 100644 --- a/tests/js/literal/jsfmt.spec.js +++ b/tests/js/literal/jsfmt.spec.js @@ -1,4 +1,2 @@ // flow-parser@0.38.0 fails to parse `1.e1`, so use babel here. -run_spec(__dirname, ["babel", "typescript"], { - errors: { espree: true, meriyah: true, typescript: ["invalid-exponent.js"] }, -}); +run_spec(__dirname, ["babel", "typescript"]); diff --git a/tests/js/literal/number.js b/tests/js/literal/number.js index c2b7ac2c3..6f61252c2 100644 --- a/tests/js/literal/number.js +++ b/tests/js/literal/number.js @@ -1,5 +1,5 @@ // parentheses around numeric literal should be preserved -function test5(): string { +function test5() { return (100).toString(); } diff --git a/tests/js/objects/__snapshots__/jsfmt.spec.js.snap b/tests/js/objects/__snapshots__/jsfmt.spec.js.snap index a1cdce27f..5a983b7a0 100644 --- a/tests/js/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/objects/__snapshots__/jsfmt.spec.js.snap @@ -146,26 +146,6 @@ const a3 = { ================================================================================ `; -exports[`getter-setter.js [espree] format 1`] = ` -"setter should have exactly one param (3:9) - 1 | ({ set x(foo) {} }); - 2 | ({ get x() { return 1 } }); -> 3 | ({ set x() {} }); - | ^ - 4 | ({ get x(x) {} }); - 5 |" -`; - -exports[`getter-setter.js [meriyah] format 1`] = ` -"[3:10]: Setter functions must have exactly one argument (3:10) - 1 | ({ set x(foo) {} }); - 2 | ({ get x() { return 1 } }); -> 3 | ({ set x() {} }); - | ^ - 4 | ({ get x(x) {} }); - 5 |" -`; - exports[`getter-setter.js format 1`] = ` ====================================options===================================== parsers: ["babel", "typescript"] @@ -174,8 +154,8 @@ printWidth: 80 =====================================input====================================== ({ set x(foo) {} }); ({ get x() { return 1 } }); -({ set x() {} }); -({ get x(x) {} }); +({ set x(a) {} }); +({ get x() {} }); =====================================output===================================== ({ set x(foo) {} }); @@ -184,99 +164,8 @@ printWidth: 80 return 1; }, }); -({ set x() {} }); -({ get x(x) {} }); - -================================================================================ -`; - -exports[`invalid-accessor-generator.js [espree] format 1`] = ` -"Unexpected token * (5:9) - 3 | - 4 | ({ -> 5 | get *iterator() { }, - | ^ - 6 | set *iterator(iter) { }, - 7 | get iterator2() { }, - 8 | set iterator2(iter) { }," -`; - -exports[`invalid-accessor-generator.js [meriyah] format 1`] = ` -"[5:9]: A getter cannot be a generator (5:9) - 3 | - 4 | ({ -> 5 | get *iterator() { }, - | ^ - 6 | set *iterator(iter) { }, - 7 | get iterator2() { }, - 8 | set iterator2(iter) { }," -`; - -exports[`invalid-accessor-generator.js [typescript] format 1`] = ` -"Identifier expected. (5:9) - 3 | - 4 | ({ -> 5 | get *iterator() { }, - | ^ - 6 | set *iterator(iter) { }, - 7 | get iterator2() { }, - 8 | set iterator2(iter) { }," -`; - -exports[`invalid-accessor-generator.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -// Invalid, but recoverable -// https://github.com/babel/babel/pull/11921/ - -({ - get *iterator() { }, - set *iterator(iter) { }, - get iterator2() { }, - set iterator2(iter) { }, -}); - -=====================================output===================================== -// Invalid, but recoverable -// https://github.com/babel/babel/pull/11921/ - -({ - get *iterator() {}, - set *iterator(iter) {}, - get iterator2() {}, - set iterator2(iter) {}, -}); - -================================================================================ -`; - -exports[`invalid-setter.js [espree] format 1`] = ` -"setter should have exactly one param (1:9) -> 1 | ({ set x(){} }); - | ^ - 2 |" -`; - -exports[`invalid-setter.js [meriyah] format 1`] = ` -"[1:10]: Setter functions must have exactly one argument (1:10) -> 1 | ({ set x(){} }); - | ^ - 2 |" -`; - -exports[`invalid-setter.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -({ set x(){} }); - -=====================================output===================================== -({ set x() {} }); +({ set x(a) {} }); +({ get x() {} }); ================================================================================ `; diff --git a/tests/js/objects/getter-setter.js b/tests/js/objects/getter-setter.js index 3a8931bb5..7853fb6b6 100644 --- a/tests/js/objects/getter-setter.js +++ b/tests/js/objects/getter-setter.js @@ -1,4 +1,4 @@ ({ set x(foo) {} }); ({ get x() { return 1 } }); -({ set x() {} }); -({ get x(x) {} }); +({ set x(a) {} }); +({ get x() {} }); diff --git a/tests/js/objects/invalid-accessor-generator.js b/tests/js/objects/invalid-accessor-generator.js deleted file mode 100644 index 80f40624b..000000000 --- a/tests/js/objects/invalid-accessor-generator.js +++ /dev/null @@ -1,9 +0,0 @@ -// Invalid, but recoverable -// https://github.com/babel/babel/pull/11921/ - -({ - get *iterator() { }, - set *iterator(iter) { }, - get iterator2() { }, - set iterator2(iter) { }, -}); diff --git a/tests/js/objects/jsfmt.spec.js b/tests/js/objects/jsfmt.spec.js index 315aaf07e..321c26fd4 100644 --- a/tests/js/objects/jsfmt.spec.js +++ b/tests/js/objects/jsfmt.spec.js @@ -1,17 +1,7 @@ run_spec(__dirname, ["babel", "typescript"], { errors: { - espree: [ - "expression.js", - "invalid-accessor-generator.js", - "invalid-setter.js", - "getter-setter.js", - ], - typescript: ["expression.js", "invalid-accessor-generator.js"], - meriyah: [ - "expression.js", - "invalid-accessor-generator.js", - "invalid-setter.js", - "getter-setter.js", - ], + espree: ["expression.js"], + typescript: ["expression.js"], + meriyah: ["expression.js"], }, }); diff --git a/tests/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/js/record/__snapshots__/jsfmt.spec.js.snap index 76ae79cde..a4651e52d 100644 --- a/tests/js/record/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/record/__snapshots__/jsfmt.spec.js.snap @@ -98,58 +98,6 @@ 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 | -> 3 | #{ - | ^ - 4 | a() {}, - 5 | async b() {}, - 6 | get c() {}," -`; - -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 | -> 3 | #{ - | ^ - 4 | a() {}, - 5 | async b() {}, - 6 | get c() {}," -`; - -exports[`invalid-record-method.js format 1`] = ` -====================================options===================================== -parsers: ["babel"] -printWidth: 80 - | printWidth -=====================================input====================================== -// Invalid, https://github.com/babel/babel/pull/11652/ - -#{ - a() {}, - async b() {}, - get c() {}, - set d(_) {}, - *e() {} -} - -=====================================output===================================== -// Invalid, https://github.com/babel/babel/pull/11652/ - -#{ - a() {}, - async b() {}, - get c() {}, - set d(_) {}, - *e() {}, -}; - -================================================================================ -`; - exports[`record.js [espree] format 1`] = ` "Unexpected character '#' (1:17) > 1 | const record1 = #{ diff --git a/tests/js/record/invalid-record-method.js b/tests/js/record/invalid-record-method.js deleted file mode 100644 index 4c3b8187e..000000000 --- a/tests/js/record/invalid-record-method.js +++ /dev/null @@ -1,9 +0,0 @@ -// Invalid, https://github.com/babel/babel/pull/11652/ - -#{ - a() {}, - async b() {}, - get c() {}, - set d(_) {}, - *e() {} -} diff --git a/tests/js/reserved-word/__snapshots__/jsfmt.spec.js.snap b/tests/js/reserved-word/__snapshots__/jsfmt.spec.js.snap index 797ffc7d4..aebfef5b7 100644 --- a/tests/js/reserved-word/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/reserved-word/__snapshots__/jsfmt.spec.js.snap @@ -1,36 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`interfaces.js [espree] format 1`] = ` -"The keyword 'interface' is reserved (1:1) -> 1 | interface = \\"foo\\"; +exports[`interfaces.js [babel] format 1`] = ` +"Unexpected reserved word 'interface' (2:1) + 1 | foo.interface; +> 2 | interface.foo; | ^ - 2 | interface + 3; - 3 | interface(); - 4 | class interface {}" -`; - -exports[`interfaces.js [meriyah] format 1`] = ` -"[1:9]: Unexpected token: 'interface' (1:9) -> 1 | interface = \\"foo\\"; - | ^ - 2 | interface + 3; - 3 | interface(); - 4 | class interface {}" + 3 | new interface(); + 4 | ({ interface: \\"foo\\" }); + 5 | (interface, \\"foo\\");" `; exports[`interfaces.js format 1`] = ` ====================================options===================================== -parsers: ["babel"] +parsers: ["espree", "meriyah", "babel"] printWidth: 80 | printWidth =====================================input====================================== -interface = "foo"; -interface + 3; -interface(); -class interface {} -interface ? true : false; -function interface() {} -import interface from "foo"; foo.interface; interface.foo; new interface(); @@ -40,13 +25,6 @@ void interface; const interface = "foo"; =====================================output===================================== -interface = "foo"; -interface + 3; -interface(); -class interface {} -interface ? true : false; -function interface() {} -import interface from "foo"; foo.interface; interface.foo; new interface(); diff --git a/tests/js/reserved-word/interfaces.js b/tests/js/reserved-word/interfaces.js index 2ce057e27..afe651659 100644 --- a/tests/js/reserved-word/interfaces.js +++ b/tests/js/reserved-word/interfaces.js @@ -1,10 +1,3 @@ -interface = "foo"; -interface + 3; -interface(); -class interface {} -interface ? true : false; -function interface() {} -import interface from "foo"; foo.interface; interface.foo; new interface(); diff --git a/tests/js/reserved-word/jsfmt.spec.js b/tests/js/reserved-word/jsfmt.spec.js index 0fab4456d..d86dffcdf 100644 --- a/tests/js/reserved-word/jsfmt.spec.js +++ b/tests/js/reserved-word/jsfmt.spec.js @@ -1 +1,3 @@ -run_spec(__dirname, ["babel"], { errors: { espree: true, meriyah: true } }); +run_spec(__dirname, ["espree", "meriyah", "babel"], { + errors: { babel: true }, +}); diff --git a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap index cdac36197..8176ccad8 100644 --- a/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/variable_declarator/__snapshots__/jsfmt.spec.js.snap @@ -1,40 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`invalid-const.js [espree] format 1`] = ` -"Unexpected token ; (1:10) -> 1 | const foo; - | ^ - 2 |" -`; - -exports[`invalid-const.js [flow] format 1`] = ` -"Const must be initialized (1:7) -> 1 | const foo; - | ^^^ - 2 |" -`; - -exports[`invalid-const.js [meriyah] format 1`] = ` -"[1:10]: Missing initializer in const declaration (1:10) -> 1 | const foo; - | ^ - 2 |" -`; - -exports[`invalid-const.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "flow", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -const foo; - -=====================================output===================================== -const foo; - -================================================================================ -`; - exports[`multiple.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/variable_declarator/jsfmt.spec.js b/tests/js/variable_declarator/jsfmt.spec.js index 4bc05ead0..eb85eda6b 100644 --- a/tests/js/variable_declarator/jsfmt.spec.js +++ b/tests/js/variable_declarator/jsfmt.spec.js @@ -1,7 +1 @@ -run_spec(__dirname, ["babel", "flow", "typescript"], { - errors: { - espree: ["invalid-const.js"], - flow: ["invalid-const.js"], - meriyah: ["invalid-const.js"], - }, -}); +run_spec(__dirname, ["babel", "flow", "typescript"]); diff --git a/tests/jsx/jsx/__snapshots__/jsfmt.spec.js.snap b/tests/jsx/jsx/__snapshots__/jsfmt.spec.js.snap index ceb48f0d2..acb3d774c 100644 --- a/tests/jsx/jsx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/jsx/jsx/__snapshots__/jsfmt.spec.js.snap @@ -712,7 +712,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -720,7 +720,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -853,7 +853,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -861,7 +861,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -1011,7 +1011,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1019,7 +1019,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -1152,7 +1152,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1160,7 +1160,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -1310,7 +1310,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1318,7 +1318,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -1451,7 +1451,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? 'satellite' : public ? 'affairs' : network ? : 'dunno'; +cable ? 'satellite' : isPublic ? 'affairs' : network ? : 'dun'; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1459,7 +1459,7 @@ cable ? 'satellite' : public ? 'affairs' : network ? : 'dunno'; // wrapped in parens. cable ? ( 'satellite' -) : public ? ( +) : isPublic ? ( 'affairs' ) : network ? (
@@ -1609,7 +1609,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1617,7 +1617,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
@@ -1750,7 +1750,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? 'satellite' : public ? 'affairs' : network ? : 'dunno'; +cable ? 'satellite' : isPublic ? 'affairs' : network ? : 'dun'; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -1758,7 +1758,7 @@ cable ? 'satellite' : public ? 'affairs' : network ? : 'dunno'; // wrapped in parens. cable ? ( 'satellite' -) : public ? ( +) : isPublic ? ( 'affairs' ) : network ? (
diff --git a/tests/jsx/jsx/conditional-expression.js b/tests/jsx/jsx/conditional-expression.js index 59a5e5b71..3283d9c6a 100644 --- a/tests/jsx/jsx/conditional-expression.js +++ b/tests/jsx/jsx/conditional-expression.js @@ -86,7 +86,7 @@ jsxModeFromElementBreaking ? ( // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain. It is non-breaking. -cable ? "satellite" : public ? "affairs" : network ? : "dunno"; +cable ? "satellite" : isPublic ? "affairs" : network ? : "dun"; // This chain of ConditionalExpressions prints in JSX mode because there is a // JSX element somewhere in the chain (in this case, at the end). It is @@ -94,7 +94,7 @@ cable ? "satellite" : public ? "affairs" : network ? : "dunno"; // wrapped in parens. cable ? ( "satellite" -) : public ? ( +) : isPublic ? ( "affairs" ) : network ? (
diff --git a/tests/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..fe42d6ef0 --- /dev/null +++ b/tests/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,325 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"'await' is only allowed within async functions (2:20) + 1 | async function foo() { +> 2 | function bar(x = await 2) {} + | ^ + 3 | }" +`; + +exports[`snippet: #0 [babel] format 2`] = ` +"Unexpected reserved word 'await' (2:20) + 1 | async function foo() { +> 2 | function bar(x = await (2)) {} + | ^ + 3 | }" +`; + +exports[`snippet: #0 [babel] format 3`] = ` +"await is not allowed in async function parameters (1:12) +> 1 | async (x = await (2)) => {}; + | ^" +`; + +exports[`snippet: #0 [espree] format 1`] = ` +"Cannot use keyword 'await' outside an async function (2:20) + 1 | async function foo() { +> 2 | function bar(x = await 2) {} + | ^ + 3 | }" +`; + +exports[`snippet: #0 [espree] format 2`] = ` +"Cannot use keyword 'await' outside an async function (1:12) +> 1 | async (x = await (2)) => {}; + | ^" +`; + +exports[`snippet: #0 [espree] format 3`] = ` +"Unexpected token = (2:5) + 1 | export class C { +> 2 | p = await 0; + | ^ + 3 | }" +`; + +exports[`snippet: #0 [flow] format 1`] = ` +"Unexpected number, expected the token \`,\` (2:26) + 1 | async function foo() { +> 2 | function bar(x = await 2) {} + | ^ + 3 | }" +`; + +exports[`snippet: #0 [meriyah] format 1`] = ` +"[2:24]: 'Await' may not be used as an identifier in this context (2:24) + 1 | async function foo() { +> 2 | function bar(x = await 2) {} + | ^ + 3 | }" +`; + +exports[`snippet: #0 [meriyah] format 2`] = ` +"[1:16]: 'Await' may not be used as an identifier in this context (1:16) +> 1 | async (x = await (2)) => {}; + | ^" +`; + +exports[`snippet: #0 [meriyah] format 3`] = ` +"[2:11]: 'Await' may not be used as an identifier in this context (2:11) + 1 | export class C { +> 2 | p = await 0; + | ^ + 3 | }" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"await is not allowed in async function parameters (1:12) +> 1 | async (x = await 2) => {}; + | ^" +`; + +exports[`snippet: #1 [babel] format 2`] = ` +"Unexpected reserved word 'await' (2:3) + 1 | function foo() { +> 2 | await + | ^ + 3 | foo; + 4 | }" +`; + +exports[`snippet: #1 [espree] format 1`] = ` +"Cannot use keyword 'await' outside an async function (1:12) +> 1 | async (x = await 2) => {}; + | ^" +`; + +exports[`snippet: #1 [espree] format 2`] = ` +"Cannot use keyword 'await' outside an async function (1:1) +> 1 | await 0; + | ^" +`; + +exports[`snippet: #1 [flow] format 1`] = ` +"Unexpected number, expected the token \`,\` (1:18) +> 1 | async (x = await 2) => {}; + | ^" +`; + +exports[`snippet: #1 [meriyah] format 1`] = ` +"[1:16]: 'Await' may not be used as an identifier in this context (1:16) +> 1 | async (x = await 2) => {}; + | ^" +`; + +exports[`snippet: #1 [meriyah] format 2`] = ` +"[1:5]: 'Await' may not be used as an identifier in this context (1:5) +> 1 | await 0; + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"'await' is only allowed within async functions (1:25) +> 1 | function foo(promise) { await promise; } + | ^" +`; + +exports[`snippet: #2 [babel] format 2`] = ` +"Unexpected reserved word 'await' (1:25) +> 1 | function foo(promise) { await (promise); } + | ^" +`; + +exports[`snippet: #2 [espree] format 1`] = ` +"Cannot use keyword 'await' outside an async function (1:25) +> 1 | function foo(promise) { await promise; } + | ^" +`; + +exports[`snippet: #2 [flow] format 1`] = ` +"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:31) +> 1 | function foo(promise) { await promise; } + | ^^^^^^^" +`; + +exports[`snippet: #2 [meriyah] format 1`] = ` +"[1:29]: 'Await' may not be used as an identifier in this context (1:29) +> 1 | function foo(promise) { await promise; } + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"'await' is only allowed within async functions (2:10) + 1 | function a() { +> 2 | return await 1 + | ^ + 3 | }" +`; + +exports[`snippet: #3 [babel] format 2`] = ` +"Unexpected reserved word 'await' (2:10) + 1 | function a() { +> 2 | return await (1) + | ^ + 3 | }" +`; + +exports[`snippet: #3 [espree] format 1`] = ` +"Cannot use keyword 'await' outside an async function (2:10) + 1 | function a() { +> 2 | return await 1 + | ^ + 3 | }" +`; + +exports[`snippet: #3 [flow] format 1`] = ` +"Unexpected number, expected the token \`;\` (2:16) + 1 | function a() { +> 2 | return await 1 + | ^ + 3 | }" +`; + +exports[`snippet: #3 [meriyah] format 1`] = ` +"[2:14]: 'Await' may not be used as an identifier in this context (2:14) + 1 | function a() { +> 2 | return await 1 + | ^ + 3 | }" +`; + +exports[`snippet: #4 [babel] format 1`] = ` +"'await' is only allowed within async functions (1:9) +> 1 | () => { await x }; + | ^" +`; + +exports[`snippet: #4 [babel] format 2`] = ` +"Unexpected reserved word 'await' (1:9) +> 1 | () => { await (x) }; + | ^" +`; + +exports[`snippet: #4 [espree] format 1`] = ` +"Cannot use keyword 'await' outside an async function (1:9) +> 1 | () => { await x }; + | ^" +`; + +exports[`snippet: #4 [flow] format 1`] = ` +"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:15) +> 1 | () => { await x }; + | ^" +`; + +exports[`snippet: #4 [meriyah] format 1`] = ` +"[1:13]: 'Await' may not be used as an identifier in this context (1:13) +> 1 | () => { await x }; + | ^" +`; + +exports[`snippet: #5 [babel] format 1`] = ` +"Unexpected reserved word 'await' (1:37) +> 1 | C = class { static { function f() { await } } }; + | ^" +`; + +exports[`snippet: #5 [babel] format 2`] = ` +"Unexpected reserved word 'await' (2:3) + 1 | function foo() { +> 2 | await + | ^ + 3 | (foo); + 4 | }" +`; + +exports[`snippet: #5 [espree] format 1`] = ` +"Unexpected token { (1:20) +> 1 | C = class { static { function f() { await } } }; + | ^" +`; + +exports[`snippet: #5 [flow] format 1`] = ` +"Unexpected token \`{\`, expected an identifier (1:20) +> 1 | C = class { static { function f() { await } } }; + | ^" +`; + +exports[`snippet: #5 [meriyah] format 1`] = ` +"[1:20]: Unexpected token: '{' (1:20) +> 1 | C = class { static { function f() { await } } }; + | ^" +`; + +exports[`snippet: #6 [babel] format 1`] = ` +"Unexpected reserved word 'await' (1:33) +> 1 | C = class { static { function f(await) {} } }; + | ^" +`; + +exports[`snippet: #6 [espree] format 1`] = ` +"Unexpected token { (1:20) +> 1 | C = class { static { function f(await) {} } }; + | ^" +`; + +exports[`snippet: #6 [flow] format 1`] = ` +"Unexpected token \`{\`, expected an identifier (1:20) +> 1 | C = class { static { function f(await) {} } }; + | ^" +`; + +exports[`snippet: #6 [meriyah] format 1`] = ` +"[1:20]: Unexpected token: '{' (1:20) +> 1 | C = class { static { function f(await) {} } }; + | ^" +`; + +exports[`snippet: #7 [babel] format 1`] = ` +"Unexpected reserved word 'await' (1:37) +> 1 | C = class { static { function f(x = await) {} } }; + | ^" +`; + +exports[`snippet: #7 [espree] format 1`] = ` +"Unexpected token { (1:20) +> 1 | C = class { static { function f(x = await) {} } }; + | ^" +`; + +exports[`snippet: #7 [flow] format 1`] = ` +"Unexpected token \`{\`, expected an identifier (1:20) +> 1 | C = class { static { function f(x = await) {} } }; + | ^" +`; + +exports[`snippet: #7 [meriyah] format 1`] = ` +"[1:20]: Unexpected token: '{' (1:20) +> 1 | C = class { static { function f(x = await) {} } }; + | ^" +`; + +exports[`snippet: #8 [babel] format 1`] = ` +"Unexpected reserved word 'await' (1:36) +> 1 | C = class { static { function f({ [await]: x }) {} } }; + | ^" +`; + +exports[`snippet: #8 [espree] format 1`] = ` +"Unexpected token { (1:20) +> 1 | C = class { static { function f({ [await]: x }) {} } }; + | ^" +`; + +exports[`snippet: #8 [flow] format 1`] = ` +"Unexpected token \`{\`, expected an identifier (1:20) +> 1 | C = class { static { function f({ [await]: x }) {} } }; + | ^" +`; + +exports[`snippet: #8 [meriyah] format 1`] = ` +"[1:20]: Unexpected token: '{' (1:20) +> 1 | C = class { static { function f({ [await]: x }) {} } }; + | ^" +`; diff --git a/tests/misc/errors/js/async-await/jsfmt.spec.js b/tests/misc/errors/js/async-await/jsfmt.spec.js new file mode 100644 index 000000000..7f51a7d4c --- /dev/null +++ b/tests/misc/errors/js/async-await/jsfmt.spec.js @@ -0,0 +1,90 @@ +const { outdent } = require("outdent"); + +run_spec( + { + dirname: __dirname, + snippets: [ + outdent` + async function foo() { + function bar(x = await 2) {} + } + `, + "async (x = await 2) => {};", + "function foo(promise) { await promise; }", + outdent` + function a() { + return await 1 + } + `, + "() => { await x };", + "C = class { static { function f() { await } } };", + "C = class { static { function f(await) {} } };", + "C = class { static { function f(x = await) {} } };", + "C = class { static { function f({ [await]: x }) {} } };", + // TODO: Test these two edge case + // outdent` + // export class C { + // p = await (0); + // } + // `, + // "await (0);" + ], + }, + ["babel", "espree", "meriyah", "flow"] +); + +run_spec( + { + dirname: __dirname, + snippets: [ + outdent` + async function foo() { + function bar(x = await (2)) {} + } + `, + outdent` + function foo() { + await + foo; + } + `, + "function foo(promise) { await (promise); }", + outdent` + function a() { + return await (1) + } + `, + "() => { await (x) };", + outdent` + function foo() { + await + (foo); + } + `, + ], + }, + ["babel"] +); + +run_spec( + { + dirname: __dirname, + snippets: ["async (x = await (2)) => {};"], + }, + ["babel", "espree", "meriyah"] +); + +run_spec( + { + dirname: __dirname, + snippets: [ + outdent` + export class C { + p = await 0; + } + `, + "await 0;", + ], + }, + ["espree", "meriyah"] +); diff --git a/tests/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..405915a8b --- /dev/null +++ b/tests/misc/errors/js/literal/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`invalid-exponent.js [babel] format 1`] = ` +"Floating-point numbers require a valid exponent after the 'e' (1:1) +> 1 | 12.3e + | ^ + 2 |" +`; + +exports[`invalid-exponent.js [espree] format 1`] = ` +"Invalid number (1:1) +> 1 | 12.3e + | ^ + 2 |" +`; + +exports[`invalid-exponent.js [meriyah] format 1`] = ` +"[1:5]: Non-number found after exponent indicator (1:5) +> 1 | 12.3e + | ^ + 2 |" +`; diff --git a/tests/js/literal/invalid-exponent.js b/tests/misc/errors/js/literal/invalid-exponent.js similarity index 100% rename from tests/js/literal/invalid-exponent.js rename to tests/misc/errors/js/literal/invalid-exponent.js diff --git a/tests/misc/errors/js/literal/jsfmt.spec.js b/tests/misc/errors/js/literal/jsfmt.spec.js new file mode 100644 index 000000000..38525665a --- /dev/null +++ b/tests/misc/errors/js/literal/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["babel", "espree", "meriyah"]); diff --git a/tests/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..4d3ab9670 --- /dev/null +++ b/tests/misc/errors/js/object/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`getter-generator.js [babel] format 1`] = ` +"A getter cannot be a generator (2:10) + 1 | ({ +> 2 | get *iterator() { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`getter-generator.js [espree] format 1`] = ` +"Unexpected token * (2:9) + 1 | ({ +> 2 | get *iterator() { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`getter-generator.js [meriyah] format 1`] = ` +"[2:9]: A getter cannot be a generator (2:9) + 1 | ({ +> 2 | get *iterator() { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`getter-with-parameter.js [babel] format 1`] = ` +"getter must not have any formal parameters (1:4) +> 1 | ({ get x(a){} }); + | ^ + 2 |" +`; + +exports[`getter-with-parameter.js [espree] format 1`] = ` +"getter should have no params (1:9) +> 1 | ({ get x(a){} }); + | ^ + 2 |" +`; + +exports[`getter-with-parameter.js [meriyah] format 1`] = ` +"[1:10]: Getter functions must have exactly no arguments (1:10) +> 1 | ({ get x(a){} }); + | ^ + 2 |" +`; + +exports[`setter-generator.js [babel] format 1`] = ` +"A setter cannot be a generator (2:10) + 1 | ({ +> 2 | set *iterator(iter) { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`setter-generator.js [espree] format 1`] = ` +"Unexpected token * (2:9) + 1 | ({ +> 2 | set *iterator(iter) { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`setter-generator.js [meriyah] format 1`] = ` +"[2:9]: A getter cannot be a generator (2:9) + 1 | ({ +> 2 | set *iterator(iter) { }, + | ^ + 3 | }); + 4 |" +`; + +exports[`setter-without-parameter.js [babel] format 1`] = ` +"setter must have exactly one formal parameter (1:4) +> 1 | ({ set x(){} }); + | ^ + 2 |" +`; + +exports[`setter-without-parameter.js [espree] format 1`] = ` +"setter should have exactly one param (1:9) +> 1 | ({ set x(){} }); + | ^ + 2 |" +`; + +exports[`setter-without-parameter.js [meriyah] format 1`] = ` +"[1:10]: Setter functions must have exactly one argument (1:10) +> 1 | ({ set x(){} }); + | ^ + 2 |" +`; diff --git a/tests/misc/errors/js/object/getter-generator.js b/tests/misc/errors/js/object/getter-generator.js new file mode 100644 index 000000000..d84317b46 --- /dev/null +++ b/tests/misc/errors/js/object/getter-generator.js @@ -0,0 +1,3 @@ +({ + get *iterator() { }, +}); diff --git a/tests/misc/errors/js/object/getter-with-parameter.js b/tests/misc/errors/js/object/getter-with-parameter.js new file mode 100644 index 000000000..02efaa7db --- /dev/null +++ b/tests/misc/errors/js/object/getter-with-parameter.js @@ -0,0 +1 @@ +({ get x(a){} }); diff --git a/tests/misc/errors/js/object/jsfmt.spec.js b/tests/misc/errors/js/object/jsfmt.spec.js new file mode 100644 index 000000000..38525665a --- /dev/null +++ b/tests/misc/errors/js/object/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["babel", "espree", "meriyah"]); diff --git a/tests/misc/errors/js/object/setter-generator.js b/tests/misc/errors/js/object/setter-generator.js new file mode 100644 index 000000000..3c362c298 --- /dev/null +++ b/tests/misc/errors/js/object/setter-generator.js @@ -0,0 +1,3 @@ +({ + set *iterator(iter) { }, +}); diff --git a/tests/js/objects/invalid-setter.js b/tests/misc/errors/js/object/setter-without-parameter.js similarity index 100% rename from tests/js/objects/invalid-setter.js rename to tests/misc/errors/js/object/setter-without-parameter.js diff --git a/tests/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..528f4be9b --- /dev/null +++ b/tests/misc/errors/js/optional-chaining/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (1:36) +> 1 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance + | ^" +`; + +exports[`snippet: #0 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (1:21) +> 1 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance + | ^" +`; + +exports[`snippet: #0 [meriyah] format 1`] = ` +"[1:22]: Invalid optional chain from new expression (1:22) +> 1 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance + | ^" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (1:32) +> 1 | const safe5 = new obj?.qux?.baz(); // undefined + | ^" +`; + +exports[`snippet: #1 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (1:22) +> 1 | const safe5 = new obj?.qux?.baz(); // undefined + | ^" +`; + +exports[`snippet: #1 [meriyah] format 1`] = ` +"[1:23]: Invalid optional chain from new expression (1:23) +> 1 | const safe5 = new obj?.qux?.baz(); // undefined + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (1:35) +> 1 | const safe6 = new obj?.foo.bar.qux?.(); // undefined + | ^" +`; + +exports[`snippet: #2 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (1:22) +> 1 | const safe6 = new obj?.foo.bar.qux?.(); // undefined + | ^" +`; + +exports[`snippet: #2 [meriyah] format 1`] = ` +"[1:23]: Invalid optional chain from new expression (1:23) +> 1 | const safe6 = new obj?.foo.bar.qux?.(); // undefined + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (1:39) +> 1 | const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor + | ^" +`; + +exports[`snippet: #3 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (1:26) +> 1 | const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor + | ^" +`; + +exports[`snippet: #3 [meriyah] format 1`] = ` +"[1:27]: Invalid optional chain from new expression (1:27) +> 1 | const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor + | ^" +`; + +exports[`snippet: #4 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (4:11) + 2 | class Test { + 3 | } +> 4 | new Test?.(); // test instance + | ^" +`; + +exports[`snippet: #4 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (4:9) + 2 | class Test { + 3 | } +> 4 | new Test?.(); // test instance + | ^" +`; + +exports[`snippet: #4 [meriyah] format 1`] = ` +"[4:10]: Invalid optional chain from new expression (4:10) + 2 | class Test { + 3 | } +> 4 | new Test?.(); // test instance + | ^" +`; + +exports[`snippet: #5 [babel] format 1`] = ` +"constructors in/after an Optional Chain are not allowed (1:13) +> 1 | new exists?.(); // undefined + | ^" +`; + +exports[`snippet: #5 [espree] format 1`] = ` +"Optional chaining cannot appear in the callee of new expressions (1:11) +> 1 | new exists?.(); // undefined + | ^" +`; + +exports[`snippet: #5 [meriyah] format 1`] = ` +"[1:12]: Invalid optional chain from new expression (1:12) +> 1 | new exists?.(); // undefined + | ^" +`; diff --git a/tests/misc/errors/js/optional-chaining/jsfmt.spec.js b/tests/misc/errors/js/optional-chaining/jsfmt.spec.js new file mode 100644 index 000000000..5301fb325 --- /dev/null +++ b/tests/misc/errors/js/optional-chaining/jsfmt.spec.js @@ -0,0 +1,21 @@ +const { outdent } = require("outdent"); + +run_spec( + { + dirname: __dirname, + snippets: [ + "const baz3 = new obj?.foo?.bar?.baz(); // baz instance", + "const safe5 = new obj?.qux?.baz(); // undefined", + "const safe6 = new obj?.foo.bar.qux?.(); // undefined", + "const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor", + outdent` + // Top classes can be called directly, too. + class Test { + } + new Test?.(); // test instance + `, + "new exists?.(); // undefined", + ], + }, + ["babel", "espree", "meriyah"] +); diff --git a/tests/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..4f848604d --- /dev/null +++ b/tests/misc/errors/js/record/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"Only properties and spread elements are allowed in record definitions (1:3) +> 1 | #{a() {}} + | ^" +`; + +exports[`snippet: #0 [espree] format 1`] = ` +"Unexpected character '#' (1:1) +> 1 | #{a() {}} + | ^" +`; + +exports[`snippet: #0 [meriyah] format 1`] = ` +"[1:1]: '#' not followed by identifier (1:1) +> 1 | #{a() {}} + | ^" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"Only properties and spread elements are allowed in record definitions (1:3) +> 1 | #{async b() {}} + | ^" +`; + +exports[`snippet: #1 [espree] format 1`] = ` +"Unexpected character '#' (1:1) +> 1 | #{async b() {}} + | ^" +`; + +exports[`snippet: #1 [meriyah] format 1`] = ` +"[1:1]: '#' not followed by identifier (1:1) +> 1 | #{async b() {}} + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"Only properties and spread elements are allowed in record definitions (1:3) +> 1 | #{get c() {}} + | ^" +`; + +exports[`snippet: #2 [espree] format 1`] = ` +"Unexpected character '#' (1:1) +> 1 | #{get c() {}} + | ^" +`; + +exports[`snippet: #2 [meriyah] format 1`] = ` +"[1:1]: '#' not followed by identifier (1:1) +> 1 | #{get c() {}} + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"Only properties and spread elements are allowed in record definitions (1:3) +> 1 | #{set d(_) {}} + | ^" +`; + +exports[`snippet: #3 [espree] format 1`] = ` +"Unexpected character '#' (1:1) +> 1 | #{set d(_) {}} + | ^" +`; + +exports[`snippet: #3 [meriyah] format 1`] = ` +"[1:1]: '#' not followed by identifier (1:1) +> 1 | #{set d(_) {}} + | ^" +`; + +exports[`snippet: #4 [babel] format 1`] = ` +"Only properties and spread elements are allowed in record definitions (1:3) +> 1 | #{*e() {}} + | ^" +`; + +exports[`snippet: #4 [espree] format 1`] = ` +"Unexpected character '#' (1:1) +> 1 | #{*e() {}} + | ^" +`; + +exports[`snippet: #4 [meriyah] format 1`] = ` +"[1:1]: '#' not followed by identifier (1:1) +> 1 | #{*e() {}} + | ^" +`; diff --git a/tests/misc/errors/js/record/jsfmt.spec.js b/tests/misc/errors/js/record/jsfmt.spec.js new file mode 100644 index 000000000..8e7d09d11 --- /dev/null +++ b/tests/misc/errors/js/record/jsfmt.spec.js @@ -0,0 +1,13 @@ +run_spec( + { + dirname: __dirname, + snippets: [ + "#{a() {}}", + "#{async b() {}}", + "#{get c() {}}", + "#{set d(_) {}}", + "#{*e() {}}", + ], + }, + ["babel", "espree", "meriyah"] +); diff --git a/tests/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..d8dbb0f1b --- /dev/null +++ b/tests/misc/errors/js/reserved-word/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:1) +> 1 | interface = \\"foo\\"; + | ^" +`; + +exports[`snippet: #0 [espree] format 1`] = ` +"The keyword 'interface' is reserved (1:7) +> 1 | class interface {} + | ^" +`; + +exports[`snippet: #0 [meriyah] format 1`] = ` +"[1:15]: Unexpected strict mode reserved word (1:15) +> 1 | class interface {} + | ^" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:1) +> 1 | interface + 3; + | ^" +`; + +exports[`snippet: #1 [espree] format 1`] = ` +"The keyword 'interface' is reserved (1:8) +> 1 | import interface from \\"foo\\"; + | ^" +`; + +exports[`snippet: #1 [meriyah] format 1`] = ` +"[1:16]: Unexpected strict mode reserved word (1:16) +> 1 | import interface from \\"foo\\"; + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:1) +> 1 | interface(); + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:7) +> 1 | class interface {} + | ^" +`; + +exports[`snippet: #4 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:1) +> 1 | interface ? true : false; + | ^" +`; + +exports[`snippet: #5 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:10) +> 1 | function interface() {} + | ^" +`; + +exports[`snippet: #6 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:8) +> 1 | import interface from \\"foo\\"; + | ^" +`; + +exports[`snippet: #7 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:1) +> 1 | interface.foo; + | ^" +`; + +exports[`snippet: #8 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:5) +> 1 | new interface(); + | ^" +`; + +exports[`snippet: #9 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:2) +> 1 | (interface, \\"foo\\"); + | ^" +`; + +exports[`snippet: #10 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:6) +> 1 | void interface; + | ^" +`; + +exports[`snippet: #11 [babel] format 1`] = ` +"Unexpected reserved word 'interface' (1:7) +> 1 | const interface = \\"foo\\"; + | ^" +`; diff --git a/tests/misc/errors/js/reserved-word/jsfmt.spec.js b/tests/misc/errors/js/reserved-word/jsfmt.spec.js new file mode 100644 index 000000000..bbc1081b7 --- /dev/null +++ b/tests/misc/errors/js/reserved-word/jsfmt.spec.js @@ -0,0 +1,28 @@ +run_spec( + { + dirname: __dirname, + snippets: ["class interface {}", 'import interface from "foo";'], + }, + ["espree", "meriyah"] +); + +run_spec( + { + dirname: __dirname, + snippets: [ + 'interface = "foo";', + "interface + 3;", + "interface();", + "class interface {}", + "interface ? true : false;", + "function interface() {}", + 'import interface from "foo";', + "interface.foo;", + "new interface();", + '(interface, "foo");', + "void interface;", + 'const interface = "foo";', + ], + }, + ["babel"] +); diff --git a/tests/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..77b162d0b --- /dev/null +++ b/tests/misc/errors/js/variable-declarator/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,22 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`invalid-const.js [babel] format 1`] = ` +"Const declarations require an initialization value (1:10) +> 1 | const foo; + | ^ + 2 |" +`; + +exports[`invalid-const.js [espree] format 1`] = ` +"Unexpected token ; (1:10) +> 1 | const foo; + | ^ + 2 |" +`; + +exports[`invalid-const.js [meriyah] format 1`] = ` +"[1:10]: Missing initializer in const declaration (1:10) +> 1 | const foo; + | ^ + 2 |" +`; diff --git a/tests/js/variable_declarator/invalid-const.js b/tests/misc/errors/js/variable-declarator/invalid-const.js similarity index 100% rename from tests/js/variable_declarator/invalid-const.js rename to tests/misc/errors/js/variable-declarator/invalid-const.js diff --git a/tests/misc/errors/js/variable-declarator/jsfmt.spec.js b/tests/misc/errors/js/variable-declarator/jsfmt.spec.js new file mode 100644 index 000000000..38525665a --- /dev/null +++ b/tests/misc/errors/js/variable-declarator/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["babel", "espree", "meriyah"]); diff --git a/tests_config/run_spec.js b/tests_config/run_spec.js index 4154ad161..57b08fa08 100644 --- a/tests_config/run_spec.js +++ b/tests_config/run_spec.js @@ -141,7 +141,9 @@ function runSpec(fixtures, parsers, options) { path.extname(basename) === ".snap" || !file.isFile() || basename[0] === "." || - basename === "jsfmt.spec.js" + basename === "jsfmt.spec.js" || + // VSCode creates this file sometime https://github.com/microsoft/vscode/issues/105191 + basename === "debug.log" ) { return; } From 169faf39ac6a17d5bf90df8abde3dacb631a1c4f Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Sun, 14 Mar 2021 12:14:08 +0200 Subject: [PATCH 10/89] Update yaml to 1.10.2 (#10516) --- changelog_unreleased/yaml/10516.md | 24 +++ cspell.json | 1 + .../mapping/__snapshots__/jsfmt.spec.js.snap | 143 ++++++++++++++++++ tests/yaml/mapping/anchor.yml | 6 + tests/yaml/mapping/anchor2.yml | 7 + tests/yaml/mapping/anchor3.yml | 6 + yarn.lock | 6 +- 7 files changed, 190 insertions(+), 3 deletions(-) create mode 100644 changelog_unreleased/yaml/10516.md create mode 100644 tests/yaml/mapping/anchor.yml create mode 100644 tests/yaml/mapping/anchor2.yml create mode 100644 tests/yaml/mapping/anchor3.yml diff --git a/changelog_unreleased/yaml/10516.md b/changelog_unreleased/yaml/10516.md new file mode 100644 index 000000000..3094ae3e3 --- /dev/null +++ b/changelog_unreleased/yaml/10516.md @@ -0,0 +1,24 @@ +#### Fix SyntaxError incorrectly thrown on anchors followed by empty lines (#10516 by @eemeli & @thorn0) + +Prettier couldn't parse this valid YAML. Thanks to Eemeli Aro for fixing this bug in the underlying parser. + + +```yaml +# Input +key1: &default + + subkey1: value1 + +key2: + <<: *default + +# Prettier stable +SyntaxError: Nested mappings are not allowed in compact mappings (1:7) + +# Prettier main +key1: &default + subkey1: value1 + +key2: + <<: *default +``` diff --git a/cspell.json b/cspell.json index 70cb29467..19e23479c 100644 --- a/cspell.json +++ b/cspell.json @@ -101,6 +101,7 @@ "duailibe", "Duperron", "editorconfig", + "eemeli", "ekkhus", "elektronik", "Eneman", diff --git a/tests/yaml/mapping/__snapshots__/jsfmt.spec.js.snap b/tests/yaml/mapping/__snapshots__/jsfmt.spec.js.snap index 1c854b823..37b1da0b2 100644 --- a/tests/yaml/mapping/__snapshots__/jsfmt.spec.js.snap +++ b/tests/yaml/mapping/__snapshots__/jsfmt.spec.js.snap @@ -53,6 +53,149 @@ printWidth: 80 ================================================================================ `; +exports[`anchor.yml - {"tabWidth":4} format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 +tabWidth: 4 + | printWidth +=====================================input====================================== +key1: &default + + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + +exports[`anchor.yml format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 + | printWidth +=====================================input====================================== +key1: &default + + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + +exports[`anchor2.yml - {"tabWidth":4} format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 +tabWidth: 4 + | printWidth +=====================================input====================================== +key1: &default + + # This key ... + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default # This key ... + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + +exports[`anchor2.yml format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 + | printWidth +=====================================input====================================== +key1: &default + + # This key ... + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default # This key ... + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + +exports[`anchor3.yml - {"tabWidth":4} format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 +tabWidth: 4 + | printWidth +=====================================input====================================== +key1: &default +# This key + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default # This key + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + +exports[`anchor3.yml format 1`] = ` +====================================options===================================== +parsers: ["yaml"] +printWidth: 80 + | printWidth +=====================================input====================================== +key1: &default +# This key + subkey1: value1 + +key2: + <<: *default + +=====================================output===================================== +key1: &default # This key + subkey1: value1 + +key2: + <<: *default + +================================================================================ +`; + exports[`array-key.yml - {"tabWidth":4} format 1`] = ` ====================================options===================================== parsers: ["yaml"] diff --git a/tests/yaml/mapping/anchor.yml b/tests/yaml/mapping/anchor.yml new file mode 100644 index 000000000..89c0b8b5d --- /dev/null +++ b/tests/yaml/mapping/anchor.yml @@ -0,0 +1,6 @@ +key1: &default + + subkey1: value1 + +key2: + <<: *default diff --git a/tests/yaml/mapping/anchor2.yml b/tests/yaml/mapping/anchor2.yml new file mode 100644 index 000000000..8755d9e7d --- /dev/null +++ b/tests/yaml/mapping/anchor2.yml @@ -0,0 +1,7 @@ +key1: &default + + # This key ... + subkey1: value1 + +key2: + <<: *default diff --git a/tests/yaml/mapping/anchor3.yml b/tests/yaml/mapping/anchor3.yml new file mode 100644 index 000000000..85cb33395 --- /dev/null +++ b/tests/yaml/mapping/anchor3.yml @@ -0,0 +1,6 @@ +key1: &default +# This key + subkey1: value1 + +key2: + <<: *default diff --git a/yarn.lock b/yarn.lock index 7f13e37aa..719634f7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7228,9 +7228,9 @@ yaml-unist-parser@1.3.1: yaml "^1.10.0" yaml@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" - integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yargs-parser@^18.1.2: version "18.1.3" From 2740ea6ee8bea4dd99969c693c84928633a80dfa Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Sun, 14 Mar 2021 12:15:53 +0200 Subject: [PATCH 11/89] Avoid last-argument hugging for number-only arrays (#10517) --- changelog_unreleased/javascript/10517.md | 33 +++++++++++++++ src/language-js/print/array.js | 40 ++++++++++--------- src/language-js/print/call-arguments.js | 15 +++++-- .../__snapshots__/jsfmt.spec.js.snap | 24 +++++++++++ .../number-only-array.js | 4 ++ 5 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 changelog_unreleased/javascript/10517.md create mode 100644 tests/js/last-argument-expansion/number-only-array.js diff --git a/changelog_unreleased/javascript/10517.md b/changelog_unreleased/javascript/10517.md new file mode 100644 index 000000000..abfdcf5ea --- /dev/null +++ b/changelog_unreleased/javascript/10517.md @@ -0,0 +1,33 @@ +#### Avoid last-argument hugging for number-only arrays (#10517 by @thorn0) + +Another special case for number-only arrays. + + +```jsx +// Input +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse(game.MaterialDiffuse, game.Meshes["monkey_flat"], [1, 1, 0.3, 1]), +]); + +// Prettier stable +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse(game.MaterialDiffuse, game.Meshes["monkey_flat"], [ + 1, + 1, + 0.3, + 1, + ]), +]); + +// Prettier main +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse( + game.MaterialDiffuse, + game.Meshes["monkey_flat"], + [1, 1, 0.3, 1] + ), +]); +``` diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js index aa16d383b..0f06dae53 100644 --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -80,23 +80,7 @@ function printArray(path, options, print) { return element[itemsKey] && element[itemsKey].length > 1; }); - const shouldUseConciseFormatting = - node.elements.length > 1 && - node.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, - }) - ) - ); + const shouldUseConciseFormatting = isConciselyPrintedArray(node, options); const trailingComma = !canHaveTrailingComma ? "" @@ -138,6 +122,26 @@ function printArray(path, options, print) { return parts; } +function isConciselyPrintedArray(node, options) { + return ( + node.elements.length > 1 && + node.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, + }) + ) + ) + ); +} + function printArrayItems(path, options, printPath, print) { const printedElements = []; let separatorParts = []; @@ -182,4 +186,4 @@ function printArrayItemsConcisely(path, options, print, trailingComma) { return fill(parts); } -module.exports = { printArray, printArrayItems }; +module.exports = { printArray, printArrayItems, isConciselyPrintedArray }; diff --git a/src/language-js/print/call-arguments.js b/src/language-js/print/call-arguments.js index eb1a205f8..c843bf5ee 100644 --- a/src/language-js/print/call-arguments.js +++ b/src/language-js/print/call-arguments.js @@ -31,6 +31,8 @@ const { utils: { willBreak }, } = require("../../document"); +const { isConciselyPrintedArray } = require("./array"); + function printCallArguments(path, options, print) { const node = path.getValue(); const isDynamicImport = node.type === "ImportExpression"; @@ -133,7 +135,7 @@ function printCallArguments(path, options, print) { } const shouldGroupFirst = shouldGroupFirstArg(args); - const shouldGroupLast = shouldGroupLastArg(args); + const shouldGroupLast = shouldGroupLastArg(args, options); if (shouldGroupFirst || shouldGroupLast) { const shouldBreak = (shouldGroupFirst @@ -255,7 +257,7 @@ function couldGroupArg(arg, arrowChainRecursion = false) { ); } -function shouldGroupLastArg(args) { +function shouldGroupLastArg(args, options) { const lastArg = getLast(args); const penultimateArg = getPenultimate(args); return ( @@ -267,8 +269,13 @@ function shouldGroupLastArg(args) { (!penultimateArg || penultimateArg.type !== lastArg.type) && // useMemo(() => func(), [foo, bar, baz]) (args.length !== 2 || - args[0].type !== "ArrowFunctionExpression" || - args[1].type !== "ArrayExpression") + penultimateArg.type !== "ArrowFunctionExpression" || + lastArg.type !== "ArrayExpression") && + !( + args.length > 1 && + lastArg.type === "ArrayExpression" && + isConciselyPrintedArray(lastArg, options) + ) ); } diff --git a/tests/js/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap b/tests/js/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap index 7988c9b81..a29b175a7 100644 --- a/tests/js/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/last-argument-expansion/__snapshots__/jsfmt.spec.js.snap @@ -404,6 +404,30 @@ const els = items.map((item) => ( ================================================================================ `; +exports[`number-only-array.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse(game.MaterialDiffuse, game.Meshes["monkey_flat"], [1, 1, 0.3, 1]), +]); + +=====================================output===================================== +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse( + game.MaterialDiffuse, + game.Meshes["monkey_flat"], + [1, 1, 0.3, 1] + ), +]); + +================================================================================ +`; + exports[`object.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow"] diff --git a/tests/js/last-argument-expansion/number-only-array.js b/tests/js/last-argument-expansion/number-only-array.js new file mode 100644 index 000000000..0ba0591cf --- /dev/null +++ b/tests/js/last-argument-expansion/number-only-array.js @@ -0,0 +1,4 @@ +instantiate(game, [ + transform([-0.7, 0.5, 0]), + render_colored_diffuse(game.MaterialDiffuse, game.Meshes["monkey_flat"], [1, 1, 0.3, 1]), +]); From 1501ea49793dcda4a1fac009580eb0eeefa99c5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 10:20:16 +0000 Subject: [PATCH 12/89] Build(deps): Bump codecov/codecov-action from v1.2.1 to v1.2.2 (#10519) --- .github/workflows/dev-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 494a3fab5..08e161c9b 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -65,7 +65,7 @@ jobs: run: yarn test --maxWorkers=2 - name: Upload Coverage - uses: codecov/codecov-action@v1.2.1 + uses: codecov/codecov-action@v1.2.2 if: matrix.ENABLE_CODE_COVERAGE with: fail_ci_if_error: true @@ -77,7 +77,7 @@ jobs: PRETTIER_FALLBACK_RESOLVE: true - name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE) - uses: codecov/codecov-action@v1.2.1 + uses: codecov/codecov-action@v1.2.2 if: matrix.ENABLE_CODE_COVERAGE with: fail_ci_if_error: true From 3fc328ad9751d58ea75a191b258090fdbea31744 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 10:20:30 +0000 Subject: [PATCH 13/89] Build(deps-dev): Bump docusaurus from 1.14.6 to 1.14.7 in /website (#10524) --- website/package.json | 2 +- website/yarn.lock | 2904 ++++++++++++++++++++++-------------------- 2 files changed, 1559 insertions(+), 1347 deletions(-) diff --git a/website/package.json b/website/package.json index 3c7cf5a9e..60cf2fb86 100644 --- a/website/package.json +++ b/website/package.json @@ -18,7 +18,7 @@ "@sandhose/prettier-animated-logo": "1.0.3", "babel-loader": "8.2.2", "concurrently": "6.0.0", - "docusaurus": "1.14.6", + "docusaurus": "1.14.7", "js-yaml": "4.0.0", "webpack": "5.24.3", "webpack-cli": "4.5.0" diff --git a/website/yarn.lock b/website/yarn.lock index d6bfb2e8b..90dd11c70 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2,64 +2,53 @@ # yarn lockfile v1 -"@babel/code-frame@7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" - integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/code-frame@^7.0.0": - 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/code-frame@^7.10.4": +"@babel/code-frame@7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: "@babel/highlight" "^7.10.4" -"@babel/compat-data@^7.10.4", "@babel/compat-data@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.11.0.tgz#e9f73efe09af1355b723a7f39b11bad637d7c99c" - integrity sha512-TPSvJfv73ng0pfnEOh17bYMPQbI95+nGWc71Ss4vZdRBHTDqmM9Z8ZV4rYz8Ks7sfzc95n30k6ODIq5UGnXcYQ== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.5.5": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.13.tgz#dcfc826beef65e75c50e21d3837d7d95798dd658" + integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== dependencies: - browserslist "^4.12.0" - invariant "^2.2.4" - semver "^5.5.0" + "@babel/highlight" "^7.12.13" -"@babel/core@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.0.tgz#73b9c33f1658506887f767c26dae07798b30df76" - integrity sha512-mkLq8nwaXmDtFmRkQ8ED/eA2CnVw4zr7dCztKalZXBvdK5EeNUAesrrwUqjQEzFgomJssayzB0aqlOsP1vGLqg== +"@babel/compat-data@^7.13.0", "@babel/compat-data@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.8.tgz#5b783b9808f15cef71547f1b691f34f8ff6003a6" + integrity sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== + +"@babel/core@^7.12.3": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.10.tgz#07de050bbd8193fcd8a3c27918c0890613a94559" + integrity sha512-bfIYcT0BdKeAZrovpMqX2Mx5NrgAckGbwT982AkdS5GNfn3KMGiprlBAtmBcFZRUmpaufS6WZFP8trvx8ptFDw== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.0" - "@babel/helper-module-transforms" "^7.11.0" - "@babel/helpers" "^7.10.4" - "@babel/parser" "^7.11.0" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.11.0" - "@babel/types" "^7.11.0" + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.9" + "@babel/helper-compilation-targets" "^7.13.10" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helpers" "^7.13.10" + "@babel/parser" "^7.13.10" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" convert-source-map "^1.7.0" debug "^4.1.0" - gensync "^1.0.0-beta.1" + gensync "^1.0.0-beta.2" json5 "^2.1.2" lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" + semver "^6.3.0" source-map "^0.5.0" -"@babel/generator@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.0.tgz#4b90c78d8c12825024568cbe83ee6c9af193585c" - integrity sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ== +"@babel/generator@^7.13.0", "@babel/generator@^7.13.9": + version "7.13.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" + integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== dependencies: - "@babel/types" "^7.11.0" + "@babel/types" "^7.13.0" jsesc "^2.5.1" source-map "^0.5.0" @@ -84,36 +73,34 @@ dependencies: "@babel/types" "^7.12.13" -"@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-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/helper-explode-assignable-expression" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/helper-explode-assignable-expression" "^7.12.13" + "@babel/types" "^7.12.13" -"@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" - integrity sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.10", "@babel/helper-compilation-targets@^7.13.8": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz#1310a1678cb8427c07a753750da4f8ce442bdd0c" + integrity sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA== dependencies: - "@babel/compat-data" "^7.10.4" - browserslist "^4.12.0" - invariant "^2.2.4" - levenary "^1.1.1" - semver "^5.5.0" + "@babel/compat-data" "^7.13.8" + "@babel/helper-validator-option" "^7.12.17" + browserslist "^4.14.5" + semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz#9f61446ba80e8240b0a5c85c6fdac8459d6f259d" - integrity sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A== +"@babel/helper-create-class-features-plugin@^7.13.0": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.10.tgz#073b2bbb925a097643c6fc5770e5f13394e887c9" + integrity sha512-YV7r2YxdTUaw84EwNkyrRke/TJHR/UXGiyvACRqvdVJ2/syV2rQuJNnaRLSuYiop8cMRXOgseTGoJCWX0q2fFg== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-member-expression-to-functions" "^7.10.5" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-replace-supers" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-member-expression-to-functions" "^7.13.0" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-create-regexp-features-plugin@^7.10.1": version "7.10.1" @@ -124,68 +111,65 @@ "@babel/helper-regex" "^7.10.1" regexpu-core "^4.7.0" -"@babel/helper-create-regexp-features-plugin@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz#fdd60d88524659a0b6959c0579925e425714f3b8" - integrity sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g== +"@babel/helper-create-regexp-features-plugin@^7.12.13": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz#a2ac87e9e319269ac655b8d4415e94d38d663cb7" + integrity sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-regex" "^7.10.4" - regexpu-core "^4.7.0" + "@babel/helper-annotate-as-pure" "^7.12.13" + regexpu-core "^4.7.1" -"@babel/helper-define-map@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz#b53c10db78a640800152692b13393147acb9bb30" - integrity sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ== +"@babel/helper-define-polyfill-provider@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.1.5.tgz#3c2f91b7971b9fc11fe779c945c014065dea340e" + integrity sha512-nXuzCSwlJ/WKr8qxzW816gwyT6VZgiJG17zR40fou70yfAcqjoNyTLl/DQ+FExw5Hx5KNqshmN8Ldl/r2N7cTg== dependencies: - "@babel/helper-function-name" "^7.10.4" - "@babel/types" "^7.10.5" - lodash "^4.17.19" + "@babel/helper-compilation-targets" "^7.13.0" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/traverse" "^7.13.0" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" -"@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== +"@babel/helper-explode-assignable-expression@^7.12.13": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz#17b5c59ff473d9f956f40ef570cf3a76ca12657f" + integrity sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA== dependencies: - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.13.0" -"@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== +"@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.10.4" - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" + "@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" - integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== +"@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.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-hoist-variables@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.0.tgz#5d5882e855b5c5eda91e0cadc26c6e7a2c8593d8" + integrity sha512-0kBzvXiIKfsCA0y6cFEIJf4OdzfpRuNk4+YTeHZpGGc666SATFKTz6sRncwFnQk7/ugJ4dSrCj6iJuvW4Qwr2g== dependencies: - "@babel/types" "^7.10.4" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" -"@babel/helper-member-expression-to-functions@^7.10.4", "@babel/helper-member-expression-to-functions@^7.10.5": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz#ae69c83d84ee82f4b42f96e2a09410935a8f26df" - integrity sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q== +"@babel/helper-member-expression-to-functions@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz#6aa4bb678e0f8c22f58cdb79451d30494461b091" + integrity sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ== dependencies: - "@babel/types" "^7.11.0" - -"@babel/helper-module-imports@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" - integrity sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== - dependencies: - "@babel/types" "^7.10.4" + "@babel/types" "^7.13.0" "@babel/helper-module-imports@^7.12.13": version "7.12.13" @@ -194,31 +178,38 @@ dependencies: "@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" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz#b16f250229e47211abdd84b34b64737c2ab2d359" - integrity sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg== +"@babel/helper-module-transforms@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz#42eb4bd8eea68bab46751212c357bfed8b40f6f1" + integrity sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw== dependencies: - "@babel/helper-module-imports" "^7.10.4" - "@babel/helper-replace-supers" "^7.10.4" - "@babel/helper-simple-access" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/template" "^7.10.4" - "@babel/types" "^7.11.0" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-replace-supers" "^7.13.0" + "@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.13.0" + "@babel/types" "^7.13.0" 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== +"@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: - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" "@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-plugin-utils@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" + integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== + "@babel/helper-regex@^7.10.1": version "7.10.1" resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.10.1.tgz#021cf1a7ba99822f993222a001cc3fec83255b96" @@ -226,60 +217,45 @@ dependencies: lodash "^4.17.13" -"@babel/helper-regex@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.10.5.tgz#32dfbb79899073c415557053a19bd055aae50ae0" - integrity sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg== +"@babel/helper-remap-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz#376a760d9f7b4b2077a9dd05aa9c3927cadb2209" + integrity sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg== dependencies: - lodash "^4.17.19" + "@babel/helper-annotate-as-pure" "^7.12.13" + "@babel/helper-wrap-function" "^7.13.0" + "@babel/types" "^7.13.0" -"@babel/helper-remap-async-to-generator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz#fce8bea4e9690bbe923056ded21e54b4e8b68ed5" - integrity sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg== +"@babel/helper-replace-supers@^7.12.13", "@babel/helper-replace-supers@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz#6034b7b51943094cb41627848cb219cb02be1d24" + integrity sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-wrap-function" "^7.10.4" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/helper-member-expression-to-functions" "^7.13.0" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" -"@babel/helper-replace-supers@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz#d585cd9388ea06e6031e4cd44b6713cbead9e6cf" - integrity sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A== +"@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/helper-member-expression-to-functions" "^7.10.4" - "@babel/helper-optimise-call-expression" "^7.10.4" - "@babel/traverse" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.13" -"@babel/helper-simple-access@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz#0f5ccda2945277a2a7a2d3a821e15395edcf3461" - integrity sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw== +"@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" + integrity sha512-Mf5AUuhG1/OCChOJ/HcADmvcHM42WJockombn8ATJG3OnyiSxBK/Mm5x78BQWvmtXZKHgbjdGL2kin/HOLlZGA== dependencies: - "@babel/template" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/types" "^7.12.1" -"@babel/helper-skip-transparent-expression-wrappers@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.11.0.tgz#eec162f112c2f58d3af0af125e3bb57665146729" - integrity sha512-0XIdiQln4Elglgjbwo9wuJpL/K7AGCY26kmEt0+pRP0TAj4jjyNq1MjoRvikrTVqKcx4Gysxt4cXvVFXP/JO2Q== +"@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.11.0" - -"@babel/helper-split-export-declaration@^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" - integrity sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg== - dependencies: - "@babel/types" "^7.11.0" - -"@babel/helper-validator-identifier@^7.10.3": - version "7.10.3" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.3.tgz#60d9847f98c4cea1b279e005fdb7c28be5412d15" - integrity sha512-bU8JvtlYpJSBPuj1VUmKpFGaDZuLxASky3LhaKj3bmpSTY6VWooSM8msk+Z0CZoErFye2tlABF6yDkT3FOPAXw== + "@babel/types" "^7.12.13" "@babel/helper-validator-identifier@^7.10.4": version "7.10.4" @@ -291,33 +267,29 @@ 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" - integrity sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug== - 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-validator-option@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831" + integrity sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw== -"@babel/helpers@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.10.4.tgz#2abeb0d721aff7c0a97376b9e1f6f65d7a475044" - integrity sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA== +"@babel/helper-wrap-function@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz#bdb5c66fda8526ec235ab894ad53a1235c79fcc4" + integrity sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA== dependencies: - "@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.13.0" + "@babel/types" "^7.13.0" -"@babel/highlight@^7.0.0": - version "7.10.3" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.3.tgz#c633bb34adf07c5c13156692f5922c81ec53f28d" - integrity sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw== +"@babel/helpers@^7.13.10": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.10.tgz#fd8e2ba7488533cdeac45cc158e9ebca5e3c7df8" + integrity sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ== dependencies: - "@babel/helper-validator-identifier" "^7.10.3" - chalk "^2.0.0" - js-tokens "^4.0.0" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.0" "@babel/highlight@^7.10.4": version "7.10.4" @@ -337,117 +309,119 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.10.4", "@babel/parser@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.0.tgz#a9d7e11aead25d3b422d17b2c6502c8dddef6a5d" - integrity sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw== +"@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.10.tgz#8f8f9bf7b3afa3eabd061f7a5bcdf4fec3c48409" + integrity sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ== -"@babel/plugin-proposal-async-generator-functions@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz#3491cabf2f7c179ab820606cec27fed15e0e8558" - integrity sha512-cNMCVezQbrRGvXJwm9fu/1sJj9bHdGAgKodZdLqOQIpfoH3raqmRPBM17+lh7CzhiKRRBrGtZL9WcjxSoGYUSg== +"@babel/plugin-proposal-async-generator-functions@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz#87aacb574b3bc4b5603f6fe41458d72a5a2ec4b1" + integrity sha512-rPBnhj+WgoSmgq+4gQUtXx/vOcU+UYtjy1AA/aeD61Hwj410fwYyqfUcRP3lR8ucgliVJL/G7sXcNUecC75IXA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.10.4" - "@babel/plugin-syntax-async-generators" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" + "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.10.4", "@babel/plugin-proposal-class-properties@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz#a33bf632da390a59c7a8c570045d1115cd778807" - integrity sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg== +"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz#146376000b94efd001e57a40a88a525afaab9f37" + integrity sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg== dependencies: - "@babel/helper-create-class-features-plugin" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-dynamic-import@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz#ba57a26cb98b37741e9d5bca1b8b0ddf8291f17e" - integrity sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ== +"@babel/plugin-proposal-dynamic-import@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz#876a1f6966e1dec332e8c9451afda3bebcdf2e1d" + integrity sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz#570d883b91031637b3e2958eea3c438e62c05f54" - integrity sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz#593e59c63528160233bd321b1aebe0820c2341db" - integrity sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw== +"@babel/plugin-proposal-json-strings@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz#bf1fb362547075afda3634ed31571c5901afef7b" + integrity sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.11.0.tgz#9f80e482c03083c87125dee10026b58527ea20c8" - integrity sha512-/f8p4z+Auz0Uaf+i8Ekf1iM7wUNLcViFUGiPxKeXvxTSl63B875YPiVdUDdem7hREcI0E0kSpEhS8tF5RphK7Q== +"@babel/plugin-proposal-logical-assignment-operators@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz#93fa78d63857c40ce3c8c3315220fd00bfbb4e1a" + integrity sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz#02a7e961fc32e6d5b2db0649e01bf80ddee7e04a" - integrity sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz#3730a31dafd3c10d8ccd10648ed80a2ac5472ef3" + integrity sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz#ce1590ff0a65ad12970a609d78855e9a4c1aef06" - integrity sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA== +"@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.11.0", "@babel/plugin-proposal-object-rest-spread@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.11.0.tgz#bd81f95a1f746760ea43b6c2d3d62b11790ad0af" - integrity sha512-wzch41N4yztwoRw0ak+37wxwJM2oiIiy6huGCoqkvSTA9acYWcPfn9Y4aJqmFFJ70KTJUu29f3DQ43uJ9HXzEA== +"@babel/plugin-proposal-object-rest-spread@^7.12.1", "@babel/plugin-proposal-object-rest-spread@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz#5d210a4d727d6ce3b18f9de82cc99a3964eed60a" + integrity sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.0" - "@babel/plugin-transform-parameters" "^7.10.4" + "@babel/compat-data" "^7.13.8" + "@babel/helper-compilation-targets" "^7.13.8" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.13.0" -"@babel/plugin-proposal-optional-catch-binding@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz#31c938309d24a78a49d68fdabffaa863758554dd" - integrity sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g== +"@babel/plugin-proposal-optional-catch-binding@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz#3ad6bd5901506ea996fc31bdcf3ccfa2bed71107" + integrity sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.11.0.tgz#de5866d0646f6afdaab8a566382fe3a221755076" - integrity sha512-v9fZIu3Y8562RRwhm1BbMRxtqZNFmFA2EG+pT2diuU8PT3H6T/KXoZ54KgYisfOFZHV6PfvAiBIZ9Rcz+/JCxA== +"@babel/plugin-proposal-optional-chaining@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.8.tgz#e39df93efe7e7e621841babc197982e140e90756" + integrity sha512-hpbBwbTgd7Cz1QryvwJZRo1U0k1q8uyBmeXOSQUjdg/A2TASkhR/rz7AyqZ/kS8kbpsNA80rOYbxySBJAqmhhQ== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-skip-transparent-expression-wrappers" "^7.11.0" - "@babel/plugin-syntax-optional-chaining" "^7.8.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz#b160d972b8fdba5c7d111a145fc8c421fc2a6909" - integrity sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw== +"@babel/plugin-proposal-private-methods@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz#04bd4c6d40f6e6bbfa2f57e2d8094bad900ef787" + integrity sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q== dependencies: - "@babel/helper-create-class-features-plugin" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-class-features-plugin" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-proposal-unicode-property-regex@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz#4483cda53041ce3413b7fe2f00022665ddfaa75d" - integrity sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA== +"@babel/plugin-proposal-unicode-property-regex@^7.12.13": + 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.10.4" - "@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-proposal-unicode-property-regex@^7.4.4": version "7.10.1" @@ -457,24 +431,24 @@ "@babel/helper-create-regexp-features-plugin" "^7.10.1" "@babel/helper-plugin-utils" "^7.10.1" -"@babel/plugin-syntax-async-generators@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.0.tgz#e6c3dba5a61ecf72ba00a3f3f5f1234989a58e6a" - integrity sha512-a8w8k7pK8nYhem07rXdAq03T+DlTX8LFojUptrh9JEx80AgLqGiuoFIyQOGTWif39kFnDOQqbzl1s6KQqrfV+A== +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz#6644e6a0baa55a61f9e3231f6c9eeb6ee46c124c" - integrity sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA== +"@babel/plugin-syntax-class-properties@^7.12.13": + 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.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.0.tgz#3a6c1cd36af923db602df83c5aa72e08bb14353a" - integrity sha512-Mx2RzpCHJaBfmFdA2abXDKRHVJdzJ6R0Wqwb6TxCgM7NRR5wcC4cyiAsRL7Ga+lwG8GG1cKvb+4ENjic8y15jA== +"@babel/plugin-syntax-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" @@ -485,10 +459,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-json-strings@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.0.tgz#7f798eb7e8cfd3821388120679d23d530bae6e53" - integrity sha512-LPykaAbH86L5NnDfCRSpNxtEHZk+6GaFzXfWEFU/6R4v69EXQr6GOp7hwH+Uw0QlYVN++s6TukTJ3flFcspahA== +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" @@ -506,10 +480,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.0.tgz#5d8f24ecffa4ae74164e53264953c5ea8ba6d149" - integrity sha512-Rv2hnBToN6rbA9hO2a4vtwXZLzNa+TWkoSIMMvUezFz5+D9NPeX7SFrArwtFzzbwndmWiqboTr5rNpzAz0MPpA== +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== dependencies: "@babel/helper-plugin-utils" "^7.8.0" @@ -520,99 +494,98 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.0.tgz#9b37d580d459682364d8602494c69145b394fd4c" - integrity sha512-dt89fDlkfkTrQcy5KavMQPyF2A6tR0kYp8HAnIoQv5hO34iAUffHghP/hMGd7Gf/+uYTmLQO0ar7peX1SUWyIA== +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-catch-binding@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.0.tgz#180c7bdd6b7fd81cc6d18269de12d5ddd60cabce" - integrity sha512-EIgJVy+u1RvR2gJfX4ReLwAupO/twllUue1wPrRxhu18+eC3bGTEcOSXLQdaE9ya9NG1rE0eQs0GSiloUGFEwg== +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-optional-chaining@^7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.0.tgz#c40f4d4d6a4f5e71d2bfd949b0a7f1e1e6792fe0" - integrity sha512-LV1c+TTAO8Vawe3t+WXBHYWbS7endP8MSlqKPKEZOyWPEJX2akl3jfvFG828/OE7RpyoC3JXfLJDFj/jN7A8hg== +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz#4bbeb8917b54fcf768364e0a81f560e33a3ef57d" - integrity sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ== +"@babel/plugin-syntax-top-level-await@^7.12.13": + 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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz#e22960d77e697c74f41c501d44d73dbf8a6a64cd" - integrity sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA== +"@babel/plugin-transform-arrow-functions@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz#10a59bebad52d637a027afa692e8d5ceff5e3dae" + integrity sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-async-to-generator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz#41a5017e49eb6f3cda9392a51eef29405b245a37" - integrity sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ== +"@babel/plugin-transform-async-to-generator@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz#8e112bf6771b82bf1e974e5e26806c5c99aa516f" + integrity sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg== dependencies: - "@babel/helper-module-imports" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-remap-async-to-generator" "^7.10.4" + "@babel/helper-module-imports" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-remap-async-to-generator" "^7.13.0" -"@babel/plugin-transform-block-scoped-functions@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz#1afa595744f75e43a91af73b0d998ecfe4ebc2e8" - integrity sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA== +"@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.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.5.tgz#b81b8aafefbfe68f0f65f7ef397b9ece68a6037d" - integrity sha512-6Ycw3hjpQti0qssQcA6AMSFDHeNJ++R6dIMnpRqUjFeBBTmTDPa8zgF90OVfTvAo11mXZTlVUViY1g8ffrURLg== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz#405136af2b3e218bc4a1926228bc917ab1a0adc7" - integrity sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA== +"@babel/plugin-transform-classes@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz#0265155075c42918bf4d3a4053134176ad9b533b" + integrity sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g== 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.10.4" - "@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.13.0" + "@babel/helper-replace-supers" "^7.13.0" + "@babel/helper-split-export-declaration" "^7.12.13" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz#9ded83a816e82ded28d52d4b4ecbdd810cdfc0eb" - integrity sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw== +"@babel/plugin-transform-computed-properties@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz#845c6e8b9bb55376b1fa0b92ef0bdc8ea06644ed" + integrity sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-destructuring@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz#70ddd2b3d1bea83d01509e9bb25ddb3a74fc85e5" - integrity sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA== +"@babel/plugin-transform-destructuring@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz#c5dce270014d4e1ebb1d806116694c12b7028963" + integrity sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-dotall-regex@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz#469c2062105c1eb6a040eaf4fac4b488078395ee" - integrity sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA== +"@babel/plugin-transform-dotall-regex@^7.12.13": + 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.10.4" - "@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-dotall-regex@^7.4.4": version "7.10.1" @@ -622,123 +595,123 @@ "@babel/helper-create-regexp-features-plugin" "^7.10.1" "@babel/helper-plugin-utils" "^7.10.1" -"@babel/plugin-transform-duplicate-keys@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz#697e50c9fee14380fe843d1f306b295617431e47" - integrity sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz#5ae338c57f8cf4001bdb35607ae66b92d665af2e" - integrity sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz#c08892e8819d3a5db29031b115af511dbbfebae9" - integrity sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ== +"@babel/plugin-transform-for-of@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz#c799f881a8091ac26b54867a845c3e97d2696062" + integrity sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-function-name@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz#6a467880e0fc9638514ba369111811ddbe2644b7" - integrity sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz#9f42ba0841100a135f22712d0e391c462f571f3c" - integrity sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz#b1ec44fcf195afcb8db2c62cd8e551c881baf8b7" - integrity sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw== +"@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.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.5.tgz#1b9cddaf05d9e88b3aad339cb3e445c4f020a9b1" - integrity sha512-elm5uruNio7CTLFItVC/rIzKLfQ17+fX7EVz5W0TMgIHFo1zY0Ozzx+lgwhL4plzl8OzVn6Qasx5DeEFyoNiRw== +"@babel/plugin-transform-modules-amd@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz#19f511d60e3d8753cc5a6d4e775d3a5184866cc3" + integrity sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ== dependencies: - "@babel/helper-module-transforms" "^7.10.5" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz#66667c3eeda1ebf7896d41f1f16b17105a2fbca0" - integrity sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w== +"@babel/plugin-transform-modules-commonjs@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz#7b01ad7c2dcf2275b06fa1781e00d13d420b3e1b" + integrity sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw== dependencies: - "@babel/helper-module-transforms" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-simple-access" "^7.10.4" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-simple-access" "^7.12.13" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.5.tgz#6270099c854066681bae9e05f87e1b9cadbe8c85" - integrity sha512-f4RLO/OL14/FP1AEbcsWMzpbUz6tssRaeQg11RH1BP/XnPpRoVwgeYViMFacnkaw4k4wjRSjn3ip1Uw9TaXuMw== +"@babel/plugin-transform-modules-systemjs@^7.13.8": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz#6d066ee2bff3c7b3d60bf28dec169ad993831ae3" + integrity sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A== dependencies: - "@babel/helper-hoist-variables" "^7.10.4" - "@babel/helper-module-transforms" "^7.10.5" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-hoist-variables" "^7.13.0" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-identifier" "^7.12.11" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz#9a8481fe81b824654b3a0b65da3df89f3d21839e" - integrity sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA== +"@babel/plugin-transform-modules-umd@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz#8a3d96a97d199705b9fd021580082af81c06e70b" + integrity sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw== dependencies: - "@babel/helper-module-transforms" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz#78b4d978810b6f3bcf03f9e318f2fc0ed41aecb6" - integrity sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA== +"@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.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" -"@babel/plugin-transform-new-target@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz#9097d753cb7b024cb7381a3b2e52e9513a9c6888" - integrity sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz#d7146c4d139433e7a6526f888c667e314a093894" - integrity sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ== +"@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.10.4" + "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-replace-supers" "^7.12.13" -"@babel/plugin-transform-parameters@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.5.tgz#59d339d58d0b1950435f4043e74e2510005e2c4a" - integrity sha512-xPHwUj5RdFV8l1wuYiu5S9fqWGM2DrYc24TMvUiRrPVm+SM3XeqU9BcokQX/kEUe+p2RBwy+yoiR1w/Blq6ubw== +"@babel/plugin-transform-parameters@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz#8fa7603e3097f9c0b7ca1a4821bc2fb52e9e5007" + integrity sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw== dependencies: - "@babel/helper-get-function-arity" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-property-literals@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz#f6fe54b6590352298785b83edd815d214c42e3c0" - integrity sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g== +"@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-react-display-name@^7.12.13": version "7.12.13" @@ -773,159 +746,157 @@ "@babel/helper-annotate-as-pure" "^7.10.4" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-regenerator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz#2015e59d839074e76838de2159db421966fd8b63" - integrity sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz#8f2682bcdcef9ed327e1b0861585d7013f8a54dd" - integrity sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz#9fd25ec5cdd555bb7f473e5e6ee1c971eede4dd6" - integrity sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q== +"@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.11.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.11.0.tgz#fa84d300f5e4f57752fe41a6d1b3c554f13f17cc" - integrity sha512-UwQYGOqIdQJe4aWNyS7noqAnN2VbaczPLiEtln+zPowRNlD+79w3oi2TWfYe0eZgd+gjZCbsydN7lzWysDt+gw== +"@babel/plugin-transform-spread@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz#84887710e273c1815ace7ae459f6f42a5d31d5fd" + integrity sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg== dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-skip-transparent-expression-wrappers" "^7.11.0" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" -"@babel/plugin-transform-sticky-regex@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz#8f3889ee8657581130a29d9cc91d7c73b7c4a28d" - integrity sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ== +"@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-regex" "^7.10.4" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-transform-template-literals@^7.10.4": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.5.tgz#78bc5d626a6642db3312d9d0f001f5e7639fde8c" - integrity sha512-V/lnPGIb+KT12OQikDvgSuesRX14ck5FfJXt6+tXhdkJ+Vsd0lDCVtF6jcB4rNClYFzaB2jusZ+lNISDk2mMMw== +"@babel/plugin-transform-template-literals@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz#a36049127977ad94438dee7443598d1cefdf409d" + integrity sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw== dependencies: - "@babel/helper-annotate-as-pure" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-plugin-utils" "^7.13.0" -"@babel/plugin-transform-typeof-symbol@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz#9509f1a7eec31c4edbffe137c16cc33ff0bc5bfc" - integrity sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz#feae523391c7651ddac115dae0a9d06857892007" - integrity sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg== +"@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.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz#e56d71f9282fac6db09c82742055576d5e6d80a8" - integrity sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A== +"@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.10.4" - "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-create-regexp-features-plugin" "^7.12.13" + "@babel/helper-plugin-utils" "^7.12.13" -"@babel/polyfill@^7.8.7": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.10.4.tgz#915e5bfe61490ac0199008e35ca9d7d151a8e45a" - integrity sha512-8BYcnVqQ5kMD2HXoHInBH7H1b/uP3KdnwCYXOqFnXqguOyuu443WXusbIUbWEfY3Z0Txk0M1uG/8YuAMhNl6zg== +"@babel/polyfill@^7.12.1": + version "7.12.1" + resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.12.1.tgz#1f2d6371d1261bbd961f3c5d5909150e12d0bd96" + integrity sha512-X0pi0V6gxLi6lFZpGmeNa4zxtwEmCs42isWLNjZZDE0Y8yVfgu0T2OAHlzBbdYlqbW/YXVvoBHpATEM+goCj8g== dependencies: core-js "^2.6.5" regenerator-runtime "^0.13.4" -"@babel/preset-env@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.11.0.tgz#860ee38f2ce17ad60480c2021ba9689393efb796" - integrity sha512-2u1/k7rG/gTh02dylX2kL3S0IJNF+J6bfDSp4DI2Ma8QN6Y9x9pmAax59fsCk6QUQG0yqH47yJWA+u1I1LccAg== +"@babel/preset-env@^7.12.1": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.10.tgz#b5cde31d5fe77ab2a6ab3d453b59041a1b3a5252" + integrity sha512-nOsTScuoRghRtUsRr/c69d042ysfPHcu+KOB4A9aAO9eJYqrkat+LF8G1yp1HD18QiwixT2CisZTr/0b3YZPXQ== dependencies: - "@babel/compat-data" "^7.11.0" - "@babel/helper-compilation-targets" "^7.10.4" - "@babel/helper-module-imports" "^7.10.4" - "@babel/helper-plugin-utils" "^7.10.4" - "@babel/plugin-proposal-async-generator-functions" "^7.10.4" - "@babel/plugin-proposal-class-properties" "^7.10.4" - "@babel/plugin-proposal-dynamic-import" "^7.10.4" - "@babel/plugin-proposal-export-namespace-from" "^7.10.4" - "@babel/plugin-proposal-json-strings" "^7.10.4" - "@babel/plugin-proposal-logical-assignment-operators" "^7.11.0" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.10.4" - "@babel/plugin-proposal-numeric-separator" "^7.10.4" - "@babel/plugin-proposal-object-rest-spread" "^7.11.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.10.4" - "@babel/plugin-proposal-optional-chaining" "^7.11.0" - "@babel/plugin-proposal-private-methods" "^7.10.4" - "@babel/plugin-proposal-unicode-property-regex" "^7.10.4" - "@babel/plugin-syntax-async-generators" "^7.8.0" - "@babel/plugin-syntax-class-properties" "^7.10.4" - "@babel/plugin-syntax-dynamic-import" "^7.8.0" + "@babel/compat-data" "^7.13.8" + "@babel/helper-compilation-targets" "^7.13.10" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-proposal-async-generator-functions" "^7.13.8" + "@babel/plugin-proposal-class-properties" "^7.13.0" + "@babel/plugin-proposal-dynamic-import" "^7.13.8" + "@babel/plugin-proposal-export-namespace-from" "^7.12.13" + "@babel/plugin-proposal-json-strings" "^7.13.8" + "@babel/plugin-proposal-logical-assignment-operators" "^7.13.8" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.13.8" + "@babel/plugin-proposal-numeric-separator" "^7.12.13" + "@babel/plugin-proposal-object-rest-spread" "^7.13.8" + "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" + "@babel/plugin-proposal-optional-chaining" "^7.13.8" + "@babel/plugin-proposal-private-methods" "^7.13.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.0" + "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@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.10.4" - "@babel/plugin-transform-arrow-functions" "^7.10.4" - "@babel/plugin-transform-async-to-generator" "^7.10.4" - "@babel/plugin-transform-block-scoped-functions" "^7.10.4" - "@babel/plugin-transform-block-scoping" "^7.10.4" - "@babel/plugin-transform-classes" "^7.10.4" - "@babel/plugin-transform-computed-properties" "^7.10.4" - "@babel/plugin-transform-destructuring" "^7.10.4" - "@babel/plugin-transform-dotall-regex" "^7.10.4" - "@babel/plugin-transform-duplicate-keys" "^7.10.4" - "@babel/plugin-transform-exponentiation-operator" "^7.10.4" - "@babel/plugin-transform-for-of" "^7.10.4" - "@babel/plugin-transform-function-name" "^7.10.4" - "@babel/plugin-transform-literals" "^7.10.4" - "@babel/plugin-transform-member-expression-literals" "^7.10.4" - "@babel/plugin-transform-modules-amd" "^7.10.4" - "@babel/plugin-transform-modules-commonjs" "^7.10.4" - "@babel/plugin-transform-modules-systemjs" "^7.10.4" - "@babel/plugin-transform-modules-umd" "^7.10.4" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.10.4" - "@babel/plugin-transform-new-target" "^7.10.4" - "@babel/plugin-transform-object-super" "^7.10.4" - "@babel/plugin-transform-parameters" "^7.10.4" - "@babel/plugin-transform-property-literals" "^7.10.4" - "@babel/plugin-transform-regenerator" "^7.10.4" - "@babel/plugin-transform-reserved-words" "^7.10.4" - "@babel/plugin-transform-shorthand-properties" "^7.10.4" - "@babel/plugin-transform-spread" "^7.11.0" - "@babel/plugin-transform-sticky-regex" "^7.10.4" - "@babel/plugin-transform-template-literals" "^7.10.4" - "@babel/plugin-transform-typeof-symbol" "^7.10.4" - "@babel/plugin-transform-unicode-escapes" "^7.10.4" - "@babel/plugin-transform-unicode-regex" "^7.10.4" - "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.11.0" - browserslist "^4.12.0" - core-js-compat "^3.6.2" - invariant "^2.2.2" - levenary "^1.1.1" - semver "^5.5.0" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.12.13" + "@babel/plugin-transform-arrow-functions" "^7.13.0" + "@babel/plugin-transform-async-to-generator" "^7.13.0" + "@babel/plugin-transform-block-scoped-functions" "^7.12.13" + "@babel/plugin-transform-block-scoping" "^7.12.13" + "@babel/plugin-transform-classes" "^7.13.0" + "@babel/plugin-transform-computed-properties" "^7.13.0" + "@babel/plugin-transform-destructuring" "^7.13.0" + "@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.13.0" + "@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.13.0" + "@babel/plugin-transform-modules-commonjs" "^7.13.8" + "@babel/plugin-transform-modules-systemjs" "^7.13.8" + "@babel/plugin-transform-modules-umd" "^7.13.0" + "@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.13.0" + "@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.13.0" + "@babel/plugin-transform-sticky-regex" "^7.12.13" + "@babel/plugin-transform-template-literals" "^7.13.0" + "@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.4" + "@babel/types" "^7.13.0" + babel-plugin-polyfill-corejs2 "^0.1.4" + babel-plugin-polyfill-corejs3 "^0.1.3" + babel-plugin-polyfill-regenerator "^0.1.2" + core-js-compat "^3.9.0" + semver "^6.3.0" -"@babel/preset-modules@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.3.tgz#13242b53b5ef8c883c3cf7dddd55b36ce80fbc72" - integrity sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg== +"@babel/preset-modules@^0.1.4": + version "0.1.4" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" + integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" @@ -933,7 +904,7 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@7.12.13", "@babel/preset-react@^7.9.4": +"@babel/preset-react@7.12.13", "@babel/preset-react@^7.12.5": 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== @@ -944,10 +915,10 @@ "@babel/plugin-transform-react-jsx-development" "^7.12.12" "@babel/plugin-transform-react-pure-annotations" "^7.12.1" -"@babel/register@^7.9.0": - version "7.10.5" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.10.5.tgz#354f3574895f1307f79efe37a51525e52fd38d89" - integrity sha512-eYHdLv43nyvmPn9bfNfrcC4+iYNwdQ8Pxk1MFJuU/U5LpSYl/PH4dFMazCYZDFVi8ueG3shvO+AQfLrxpYulQw== +"@babel/register@^7.12.1": + version "7.13.8" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.13.8.tgz#d9051dc6820cb4e86375cc0e2d55a4862b31184f" + integrity sha512-yCVtABcmvQjRsX2elcZFUV5Q5kDDpHdtXKKku22hNDma60lYuhKmtp1ykZ/okRCPLT2bR5S+cA1kvtBdAFlDTQ== dependencies: find-cache-dir "^2.0.0" lodash "^4.17.19" @@ -962,43 +933,34 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" - integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== +"@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.10.4" - "@babel/parser" "^7.10.4" - "@babel/types" "^7.10.4" + "@babel/code-frame" "^7.12.13" + "@babel/parser" "^7.12.13" + "@babel/types" "^7.12.13" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.11.0", "@babel/traverse@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.11.0.tgz#9b996ce1b98f53f7c3e4175115605d56ed07dd24" - integrity sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg== +"@babel/traverse@^7.12.5", "@babel/traverse@^7.13.0": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.0.tgz#6d95752475f86ee7ded06536de309a65fc8966cc" + integrity sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.11.0" - "@babel/helper-function-name" "^7.10.4" - "@babel/helper-split-export-declaration" "^7.11.0" - "@babel/parser" "^7.11.0" - "@babel/types" "^7.11.0" + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.13.0" + "@babel/helper-function-name" "^7.12.13" + "@babel/helper-split-export-declaration" "^7.12.13" + "@babel/parser" "^7.13.0" + "@babel/types" "^7.13.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.19" -"@babel/types@^7.10.1", "@babel/types@^7.10.4", "@babel/types@^7.10.5", "@babel/types@^7.11.0", "@babel/types@^7.4.4", "@babel/types@^7.9.0": - version "7.11.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.11.0.tgz#2ae6bf1ba9ae8c3c43824e5861269871b206e90d" - integrity sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA== - dependencies: - "@babel/helper-validator-identifier" "^7.10.4" - lodash "^4.17.19" - to-fast-properties "^2.0.0" - -"@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== +"@babel/types@^7.10.1", "@babel/types@^7.10.4", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.12.6", "@babel/types@^7.13.0", "@babel/types@^7.4.4": + version "7.13.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" + integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== dependencies: "@babel/helper-validator-identifier" "^7.12.11" lodash "^4.17.19" @@ -1017,11 +979,32 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@nodelib/fs.scandir@2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz#d4b3549a5db5de2683e0c1071ab4f140904bbf69" + integrity sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA== + dependencies: + "@nodelib/fs.stat" "2.0.4" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.4", "@nodelib/fs.stat@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz#a3f2dd61bab43b8db8fa108a121cfffe4c676655" + integrity sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q== + "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodelib/fs.walk@^1.2.3": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz#cce9396b30aa5afe9e3756608f5831adcb53d063" + integrity sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow== + dependencies: + "@nodelib/fs.scandir" "2.1.4" + fastq "^1.6.0" + "@sandhose/prettier-animated-logo@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@sandhose/prettier-animated-logo/-/prettier-animated-logo-1.0.3.tgz#45f34ca71bbf49826042c165236e6b7cb24f8c3f" @@ -1232,11 +1215,6 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -1255,6 +1233,21 @@ address@1.1.2, address@^1.0.1: resolved "https://registry.yarnpkg.com/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== +airbnb-prop-types@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz#b96274cefa1abb14f623f804173ee97c13971dc2" + integrity sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg== + dependencies: + array.prototype.find "^2.1.1" + function.prototype.name "^1.1.2" + is-regex "^1.1.0" + object-is "^1.1.2" + object.assign "^4.1.0" + object.entries "^1.1.2" + prop-types "^15.7.2" + prop-types-exact "^1.2.0" + react-is "^16.13.1" + ajv-keywords@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" @@ -1295,11 +1288,6 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-red@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-red/-/ansi-red-0.1.1.tgz#8c638f9d1080800a353c9c28c8a81ca4705d946c" @@ -1310,15 +1298,6 @@ ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - ansi-regex@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" @@ -1353,19 +1332,6 @@ ansi-wrap@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - arch@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" @@ -1378,14 +1344,6 @@ archive-type@^4.0.0: dependencies: file-type "^4.2.0" -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - argparse@^1.0.10, argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -1411,6 +1369,11 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -1425,6 +1388,11 @@ array-union@^1.0.1: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -1439,6 +1407,23 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.find@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.1.tgz#3baca26108ca7affb08db06bf0be6cb3115a969c" + integrity sha512-mi+MYNJYLTx2eNYy+Yh6raoQacCsNeeMUaspFPh9Y141lFSsWxxB8V9mM2ye+eqiRs917J6/pJ4M9ZPzenWckA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.17.4" + +array.prototype.flat@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.4.tgz#6ef638b43312bd401b4c6199fdec7e2dc9e9a123" + integrity sha512-4470Xi3GAPAjZqFcljX2xzckv1qeKPizoNkiS0+O4IoPR2ZNpcjE0pkhdihlDouK+x6QOast26B4Q/O9DJnwSg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -1457,11 +1442,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -async-each@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.2.tgz#8b8a7ca2a658f927e9f307d6d1a42f4199f0f735" - integrity sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg== - async@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" @@ -1473,6 +1453,11 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" @@ -1514,14 +1499,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - babel-loader@8.2.2: version "8.2.2" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" @@ -1539,6 +1516,30 @@ babel-plugin-dynamic-import-node@^2.3.3: dependencies: object.assign "^4.1.0" +babel-plugin-polyfill-corejs2@^0.1.4: + version "0.1.10" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.1.10.tgz#a2c5c245f56c0cac3dbddbf0726a46b24f0f81d1" + integrity sha512-DO95wD4g0A8KRaHKi0D51NdGXzvpqVLnLu5BTvDlpqUEpTmeEtypgC1xqesORaWmiUOQI14UHKlzNd9iZ2G3ZA== + dependencies: + "@babel/compat-data" "^7.13.0" + "@babel/helper-define-polyfill-provider" "^0.1.5" + semver "^6.1.1" + +babel-plugin-polyfill-corejs3@^0.1.3: + version "0.1.7" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.1.7.tgz#80449d9d6f2274912e05d9e182b54816904befd0" + integrity sha512-u+gbS9bbPhZWEeyy1oR/YaaSpod/KDT07arZHb80aTpl8H5ZBq+uN1nN9/xtX7jQyfLdPfoqI4Rue/MQSWJquw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.1.5" + core-js-compat "^3.8.1" + +babel-plugin-polyfill-regenerator@^0.1.2: + version "0.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.1.6.tgz#0fe06a026fe0faa628ccc8ba3302da0a6ce02f3f" + integrity sha512-OUrYG9iKPKz8NxswXbRAdSwF0GhRdIEMTloQATJi4bDuFqrXaXcCUT/VGNrr8pBcjMh1RxZ7Xt9cytVJTJfvMg== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.1.5" + babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -1624,11 +1625,6 @@ bin-wrapper@^4.0.0: os-filter-obj "^2.0.0" pify "^4.0.1" -binary-extensions@^1.0.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.0.tgz#9523e001306a32444b907423f1de2164222f6ab1" - integrity sha512-EgmjVLMn22z7eGGv3kcnHwSnJXmFHjISTY9E/S5lIcTD3Oxw05QTcBLNkJFzcb3cNueUdF/IN4U+d78V0zO8Hw== - bl@^1.0.0: version "1.2.3" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" @@ -1673,7 +1669,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^2.3.1, braces@^2.3.2: +braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -1689,16 +1685,24 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" -browserslist@4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" - integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: - caniuse-lite "^1.0.30000989" - electron-to-chromium "^1.3.247" - node-releases "^1.1.29" + fill-range "^7.0.1" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.8.3: +browserslist@4.14.2: + version "4.14.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.2.tgz#1b3cec458a1ba87588cc5e9be62f19b6d48813ce" + integrity sha512-HI4lPveGKUR0x2StIz+2FXfDk9SfVMrxn6PLh1JeGUwcuoDkdKZebWiyLRJ68iIPDpMI4JLVDf7S7XzslgWOhw== + dependencies: + caniuse-lite "^1.0.30001125" + electron-to-chromium "^1.3.564" + escalade "^3.0.2" + node-releases "^1.1.61" + +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5: version "4.14.5" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.5.tgz#1c751461a102ddc60e40993639b709be7f2c4015" integrity sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA== @@ -1708,6 +1712,17 @@ browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4 escalade "^3.1.0" node-releases "^1.1.61" +browserslist@^4.16.3: + version "4.16.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" + integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== + dependencies: + caniuse-lite "^1.0.30001181" + colorette "^1.2.1" + electron-to-chromium "^1.3.649" + escalade "^3.1.1" + node-releases "^1.1.70" + buffer-alloc-unsafe@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" @@ -1783,6 +1798,14 @@ cacheable-request@^2.1.1: normalize-url "2.0.1" responselike "1.0.2" +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" @@ -1828,7 +1851,7 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000989: +caniuse-lite@^1.0.0: version "1.0.30001048" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz#4bb4f1bc2eb304e5e1154da80b93dee3f1cf447e" integrity sha512-g1iSHKVxornw0K8LG9LLdf+Fxnv7T1Z+mMsf0/YYLclQX4Cd522Ap0Lrw6NFqHgezit78dtyWxzlV2Xfc7vgRg== @@ -1838,6 +1861,11 @@ caniuse-lite@^1.0.30001109: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001109.tgz#a9f3f26a0c3753b063d7acbb48dfb9c0e46f2b19" integrity sha512-4JIXRodHzdS3HdK8nSgIqXYLExOvG+D2/EenSvcub2Kp3QEADjo2v2oUn5g0n0D+UNwG9BtwKOyGcSq2qvQXvQ== +caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001181: + version "1.0.30001199" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001199.tgz#062afccaad21023e2e647d767bac4274b8b8fd7f" + integrity sha512-ifbK2eChUCFUwGhlEzIoVwzFt1+iriSjyKKFYNfv6hN34483wyWpLLavYQXhnR036LhkdUYaSDpHg1El++VgHQ== + caniuse-lite@^1.0.30001135: version "1.0.30001148" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001148.tgz#dc97c7ed918ab33bf8706ddd5e387287e015d637" @@ -1866,7 +1894,7 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^1.0.0, chalk@^1.1.3: +chalk@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1892,10 +1920,16 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +cheerio-select-tmp@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/cheerio-select-tmp/-/cheerio-select-tmp-0.1.1.tgz#55bbef02a4771710195ad736d5e346763ca4e646" + integrity sha512-YYs5JvbpU19VYJyj+F7oYrIE2BOll1/hRU7rEy/5+v9BzkSo3bK81iAeeQEMI92vRIxz677m72UmJUiVwwgjfQ== + dependencies: + css-select "^3.1.2" + css-what "^4.0.0" + domelementtype "^2.1.0" + domhandler "^4.0.0" + domutils "^2.4.4" cheerio@0.22.0: version "0.22.0" @@ -1919,29 +1953,18 @@ cheerio@0.22.0: lodash.reject "^4.4.0" lodash.some "^4.4.0" -chokidar@^2.0.4: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== +cheerio@^1.0.0-rc.3: + version "1.0.0-rc.5" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.5.tgz#88907e1828674e8f9fee375188b27dadd4f0fa2f" + integrity sha512-yoqps/VCaZgN4pfXtenwHROTp8NG6/Hlt4Jpz2FEP0ZJQ+ZUkVDd0hAPDNKhj3nakpfPt/CNs57yEtxD1bXQiw== dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + cheerio-select-tmp "^0.1.0" + dom-serializer "~1.2.0" + domhandler "^4.0.0" + entities "~2.1.0" + htmlparser2 "^6.0.0" + parse5 "^6.0.0" + parse5-htmlparser2-tree-adapter "^6.0.0" chrome-trace-event@^1.0.2: version "1.0.2" @@ -1964,16 +1987,6 @@ classnames@^2.2.6: version "2.2.6" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - clipboard@2.0.7, clipboard@^2.0.0: version "2.0.7" resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.7.tgz#da927f817b1859426df39212ac81feb07dbaeadc" @@ -2016,10 +2029,6 @@ coa@^2.0.2: chalk "^2.4.1" q "^1.1.2" -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - codemirror-graphql@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/codemirror-graphql/-/codemirror-graphql-1.0.0.tgz#ba8db60dc42b87768d643b3d19bf088f43dc5380" @@ -2089,7 +2098,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.15.1, commander@^2.20.0, commander@^2.8.1: +commander@^2.15.1, commander@^2.19.0, commander@^2.20.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2156,11 +2165,6 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - console-stream@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/console-stream/-/console-stream-0.1.1.tgz#a095fe07b20465955f2fafd28b5d72bccd949d44" @@ -2201,12 +2205,12 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.6.2: - version "3.6.3" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.3.tgz#41e281ca771209d5f2eb63ce34f96037d0928538" - integrity sha512-Y3YNGU3bU1yrnzVodop23ghArbKv4IqkZg9MMOWv/h7KT6NRk1/SzHhWDDlubg2+tlcUzAqgj1/GyeJ9fUKMeg== +core-js-compat@^3.8.1, core-js-compat@^3.9.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.9.1.tgz#4e572acfe90aff69d76d8c37759d21a5c59bb455" + integrity sha512-jXAirMQxrkbiiLsCx9bQPJFA6llDadKMpYrBJQJ3/c4/vsPP/fAf29h24tviRlvwUL6AmY5CHLu2GvjuYviQqA== dependencies: - browserslist "^4.8.3" + browserslist "^4.16.3" semver "7.0.0" core-js@^2.6.5: @@ -2229,15 +2233,14 @@ cosmiconfig@^5.0.0: js-yaml "^3.13.1" parse-json "^4.0.0" -cross-spawn@6.0.5, cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" +cross-spawn@7.0.3, cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" cross-spawn@^5.0.1: version "5.1.0" @@ -2247,14 +2250,15 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" crowdin-cli@^0.3.0: version "0.3.0" @@ -2291,6 +2295,17 @@ css-select@^2.0.0: domutils "^1.7.0" nth-check "^1.0.2" +css-select@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-3.1.2.tgz#d52cbdc6fee379fba97fb0d3925abbd18af2d9d8" + integrity sha512-qmss1EihSuBNWNNhHjxzxSfJoFBM/lERB/Q4EnsJQQC62R2evJDW481091oAdOr9uh46/0n4nrg0It5cAnj1RA== + dependencies: + boolbase "^1.0.0" + css-what "^4.0.0" + domhandler "^4.0.0" + domutils "^2.4.3" + nth-check "^2.0.0" + css-select@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" @@ -2319,6 +2334,11 @@ css-what@2.1, css-what@^2.1.2: resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== +css-what@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-4.0.0.tgz#35e73761cab2eeb3d3661126b23d7aa0e8432233" + integrity sha512-teijzG7kwYfNVsUh2H/YN62xW3KK9YhXEgSlbxMlcyjPNvdKJqFx5lrwlJgoFP1ZHlB89iGDlo/JyshKeRhv5A== + cssesc@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" @@ -2416,7 +2436,7 @@ date-fns@^2.16.1: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.17.0.tgz#afa55daea539239db0a64e236ce716ef3d681ba1" integrity sha512-ZEhqxUtEZeGgg9eHNSOAJ8O9xqSgiJdrL0lzSSfMF54x6KXWJiOH/xntSJ9YomJPrYH/p08t6gWjGWq1SDJlSA== -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0: +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -2429,13 +2449,20 @@ debug@4.1.0, debug@^4.1.0: dependencies: ms "^2.1.1" -debug@^3.1.0, debug@^3.1.1, debug@^3.2.5: +debug@^3.1.0, debug@^3.1.1: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: ms "^2.1.1" +debug@^4.1.1: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2503,10 +2530,6 @@ decompress@^4.0.0, decompress@^4.2.0: pify "^2.3.0" strip-dirs "^2.0.0" -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - deep-is@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -2550,11 +2573,6 @@ delegate@^3.1.2: resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166" integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw== -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -2563,11 +2581,6 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - detect-port-alt@1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/detect-port-alt/-/detect-port-alt-1.1.6.tgz#24707deabe932d4a3cf621302027c2b266568275" @@ -2587,20 +2600,32 @@ dir-glob@2.0.0: arrify "^1.0.1" path-type "^3.0.0" -docusaurus@1.14.6: - version "1.14.6" - resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.6.tgz#ffab9f6dafe8c48c477e0ebc7f491e554143b2b5" - integrity sha512-Hpo6xqYIHwazwuhXW25AKYv/os+dWoJ87qql/m1j1xp83h/BnfYV2l8PA8zLggF1wGUbJQbTx7GWo6QvD8z+4Q== +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== dependencies: - "@babel/core" "^7.9.0" - "@babel/plugin-proposal-class-properties" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.9.0" - "@babel/polyfill" "^7.8.7" - "@babel/preset-env" "^7.9.0" - "@babel/preset-react" "^7.9.4" - "@babel/register" "^7.9.0" - "@babel/traverse" "^7.9.0" - "@babel/types" "^7.9.0" + path-type "^4.0.0" + +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= + +docusaurus@1.14.7: + version "1.14.7" + resolved "https://registry.yarnpkg.com/docusaurus/-/docusaurus-1.14.7.tgz#f51858ab643b29ec52264d6dd85e0d629e5b3a4a" + integrity sha512-UWqar4ZX0lEcpLc5Tg+MwZ2jhF/1n1toCQRSeoxDON/D+E9ToLr+vTRFVMP/Tk84NXSVjZFRlrjWwM2pXzvLsQ== + dependencies: + "@babel/core" "^7.12.3" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/polyfill" "^7.12.1" + "@babel/preset-env" "^7.12.1" + "@babel/preset-react" "^7.12.5" + "@babel/register" "^7.12.1" + "@babel/traverse" "^7.12.5" + "@babel/types" "^7.12.6" autoprefixer "^9.7.5" babylon "^6.18.0" chalk "^3.0.0" @@ -2608,12 +2633,14 @@ docusaurus@1.14.6: commander "^4.0.1" crowdin-cli "^0.3.0" cssnano "^4.1.10" + enzyme "^3.10.0" + enzyme-adapter-react-16 "^1.15.1" escape-string-regexp "^2.0.0" express "^4.17.1" - feed "^4.0.0" - fs-extra "^8.1.0" + feed "^4.2.1" + fs-extra "^9.0.1" gaze "^1.1.3" - github-slugger "^1.2.1" + github-slugger "^1.3.0" glob "^7.1.6" highlight.js "^9.16.2" imagemin "^6.0.0" @@ -2621,14 +2648,14 @@ docusaurus@1.14.6: imagemin-jpegtran "^6.0.0" imagemin-optipng "^6.0.0" imagemin-svgo "^7.0.0" - lodash "^4.17.15" + lodash "^4.17.20" markdown-toc "^1.2.0" mkdirp "^0.5.1" - portfinder "^1.0.25" + portfinder "^1.0.28" postcss "^7.0.23" - prismjs "^1.17.1" + prismjs "^1.22.0" react "^16.8.4" - react-dev-utils "^9.1.0" + react-dev-utils "^11.0.1" react-dom "^16.8.4" remarkable "^2.0.0" request "^2.88.0" @@ -2646,11 +2673,25 @@ dom-serializer@0, dom-serializer@~0.1.0: domelementtype "~1.1.1" entities "~1.1.1" +dom-serializer@^1.0.1, dom-serializer@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.2.0.tgz#3433d9136aeb3c627981daa385fc7f32d27c48f1" + integrity sha512-n6kZFH/KlCrqs/1GHMOd5i2fd/beQHuehKdWvNNffbGHTr/almdhuVvTVFb3V7fglz+nC50fFusu3lY33h12pA== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + entities "^2.0.0" + domelementtype@1, domelementtype@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== +domelementtype@^2.0.1, domelementtype@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.1.0.tgz#a851c080a6d1c3d94344aed151d99f669edf585e" + integrity sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w== + domelementtype@~1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" @@ -2662,6 +2703,13 @@ domhandler@^2.3.0: dependencies: domelementtype "1" +domhandler@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.0.0.tgz#01ea7821de996d85f69029e81fa873c21833098e" + integrity sha512-KPTbnGQ1JeEMQyO1iYXoagsI6so/C96HZiFyByU3T6iAzpXn8EGEvct6unm1ZGoed8ByO2oirxgwxBmqKF9haA== + dependencies: + domelementtype "^2.1.0" + domutils@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" @@ -2677,6 +2725,15 @@ domutils@^1.5.1, domutils@^1.7.0: dom-serializer "0" domelementtype "1" +domutils@^2.4.3, domutils@^2.4.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.5.0.tgz#42f49cffdabb92ad243278b331fd761c1c2d3039" + integrity sha512-Ho16rzNMOFk2fPwChGh3D2D9OEHAfG19HgmRR2l+WLSsIstNsAYBzePH412bL0y5T44ejABIVfTHQ8nqi/tBCg== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.0.1" + domhandler "^4.0.0" + dot-prop@^4.1.1: version "4.2.1" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.1.tgz#45884194a71fc2cda71cbb4bceb3a4dd2f433ba4" @@ -2737,10 +2794,10 @@ ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" -electron-to-chromium@^1.3.247: - version "1.3.426" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.426.tgz#d7301de9e40df83a40fe1f51b4463cfe170d1153" - integrity sha512-sdQ7CXQbFflKY5CU63ra+kIYq9F7d1OqI33856qJZxTrwo0sLASdmoRl9lWpGrQDS9Nk/RFliQWd3PPDrZ+Meg== +electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.649: + version "1.3.687" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.687.tgz#c336184b7ab70427ffe2ee79eaeaedbc1ad8c374" + integrity sha512-IpzksdQNl3wdgkzf7dnA7/v10w0Utf1dF2L+B4+gKrloBrxCut+au+kky3PYvle3RMdSxZP+UiCZtLbcYRxSNQ== electron-to-chromium@^1.3.571: version "1.3.580" @@ -2757,10 +2814,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" @@ -2803,11 +2856,85 @@ entities@^1.1.1, entities@~1.1.1: resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== + envinfo@^7.7.3: version "7.7.3" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.7.3.tgz#4b2d8622e3e7366afb8091b23ed95569ea0208cc" integrity sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA== +enzyme-adapter-react-16@^1.15.1: + version "1.15.6" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.6.tgz#fd677a658d62661ac5afd7f7f541f141f8085901" + integrity sha512-yFlVJCXh8T+mcQo8M6my9sPgeGzj85HSHi6Apgf1Cvq/7EL/J9+1JoJmJsRxZgyTvPMAqOEpRSu/Ii/ZpyOk0g== + dependencies: + enzyme-adapter-utils "^1.14.0" + enzyme-shallow-equal "^1.0.4" + has "^1.0.3" + object.assign "^4.1.2" + object.values "^1.1.2" + prop-types "^15.7.2" + react-is "^16.13.1" + react-test-renderer "^16.0.0-0" + semver "^5.7.0" + +enzyme-adapter-utils@^1.14.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.0.tgz#afbb0485e8033aa50c744efb5f5711e64fbf1ad0" + integrity sha512-F/z/7SeLt+reKFcb7597IThpDp0bmzcH1E9Oabqv+o01cID2/YInlqHbFl7HzWBl4h3OdZYedtwNDOmSKkk0bg== + dependencies: + airbnb-prop-types "^2.16.0" + function.prototype.name "^1.1.3" + has "^1.0.3" + object.assign "^4.1.2" + object.fromentries "^2.0.3" + prop-types "^15.7.2" + semver "^5.7.1" + +enzyme-shallow-equal@^1.0.1, enzyme-shallow-equal@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz#b9256cb25a5f430f9bfe073a84808c1d74fced2e" + integrity sha512-MttIwB8kKxypwHvRynuC3ahyNc+cFbR8mjVIltnmzQ0uKGqmsfO4bfBuLxb0beLNPhjblUEYvEbsg+VSygvF1Q== + dependencies: + has "^1.0.3" + object-is "^1.1.2" + +enzyme@^3.10.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.11.0.tgz#71d680c580fe9349f6f5ac6c775bc3e6b7a79c28" + integrity sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw== + dependencies: + array.prototype.flat "^1.2.3" + cheerio "^1.0.0-rc.3" + enzyme-shallow-equal "^1.0.1" + function.prototype.name "^1.1.2" + has "^1.0.3" + html-element-map "^1.2.0" + is-boolean-object "^1.0.1" + is-callable "^1.1.5" + is-number-object "^1.0.4" + is-regex "^1.0.5" + is-string "^1.0.5" + is-subset "^0.1.1" + lodash.escape "^4.0.1" + lodash.isequal "^4.5.0" + object-inspect "^1.7.0" + object-is "^1.0.2" + object.assign "^4.1.0" + object.entries "^1.1.1" + object.values "^1.1.1" + raf "^3.4.1" + rst-selector-parser "^2.2.3" + string.prototype.trim "^1.2.1" + error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -2837,6 +2964,28 @@ es-abstract@^1.12.0, es-abstract@^1.5.1: string.prototype.trimleft "^2.1.0" string.prototype.trimright "^2.1.0" +es-abstract@^1.17.4, es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: + version "1.18.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.0.tgz#ab80b359eecb7ede4c298000390bc5ac3ec7b5a4" + integrity sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + get-intrinsic "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.2" + is-callable "^1.2.3" + is-negative-zero "^2.0.1" + is-regex "^1.1.2" + is-string "^1.0.5" + object-inspect "^1.9.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + string.prototype.trimend "^1.0.4" + string.prototype.trimstart "^1.0.4" + unbox-primitive "^1.0.0" + es-module-lexer@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.0.tgz#21f4181cc8b7eee06855f1c59e6087c7bc4f77b0" @@ -2851,7 +3000,16 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -escalade@^3.1.0, escalade@^3.1.1: +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escalade@^3.0.2, escalade@^3.1.0, escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== @@ -2860,15 +3018,15 @@ escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -escape-string-regexp@^2.0.0: +escape-string-regexp@2.0.0, escape-string-regexp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" @@ -2911,13 +3069,6 @@ events@^3.2.0: resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== -eventsource@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" - integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== - dependencies: - original "^1.0.0" - exec-buffer@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/exec-buffer/-/exec-buffer-3.2.0.tgz#b1686dbd904c7cf982e652c1f5a79b1e5573082b" @@ -3064,15 +3215,6 @@ extend@~3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -3112,6 +3254,18 @@ fast-glob@^2.0.2: merge2 "^1.2.3" micromatch "^3.1.10" +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" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -3121,19 +3275,19 @@ fastest-levenshtein@^1.0.12: resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2" integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== +fastq@^1.6.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.11.0.tgz#bb9fb955a07130a918eb63c1f5161cc32a5d0858" + integrity sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g== + dependencies: + reusify "^1.0.4" + faye-websocket@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" dependencies: websocket-driver ">=0.5.1" -faye-websocket@~0.11.1: - version "0.11.3" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.3.tgz#5c0e9a8968e8912c286639fde977a8b209f2508e" - integrity sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA== - dependencies: - websocket-driver ">=0.5.1" - fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" @@ -3141,10 +3295,10 @@ fd-slicer@~1.1.0: dependencies: pend "~1.2.0" -feed@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/feed/-/feed-4.0.0.tgz#d3c2bfb9aba3c0efacab1ed15be06b67f5c02539" - integrity sha512-VWtvINgG7cA91BtrGychMvxHj84nc8xS9W/PuAHlY62I8owZtcoxNaKFN+zkGl8tBsaYbxrrp4yB9DhqKNQSPw== +feed@^4.2.1: + version "4.2.2" + resolved "https://registry.yarnpkg.com/feed/-/feed-4.2.2.tgz#865783ef6ed12579e2c44bbef3c9113bc4956a7e" + integrity sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ== dependencies: xml-js "^1.6.11" @@ -3155,12 +3309,6 @@ figures@^1.3.5: escape-string-regexp "^1.0.5" object-assign "^4.1.0" -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - dependencies: - escape-string-regexp "^1.0.5" - file-type@5.2.0, file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" @@ -3205,10 +3353,10 @@ filenamify@^2.0.0: strip-outer "^1.0.0" trim-repeated "^1.0.0" -filesize@3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" - integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== +filesize@6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.1.0.tgz#e81bdaa780e2451d714d71c0d7a4f3238d37ad00" + integrity sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg== fill-range@^2.1.0: version "2.2.3" @@ -3230,6 +3378,13 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + finalhandler@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -3261,12 +3416,13 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== +find-up@4.1.0, find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: - locate-path "^3.0.0" + locate-path "^5.0.0" + path-exists "^4.0.0" find-up@^1.0.0: version "1.1.2" @@ -3275,19 +3431,12 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: - locate-path "^2.0.0" - -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" + locate-path "^3.0.0" find-versions@^3.0.0: version "3.1.0" @@ -3306,14 +3455,13 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -fork-ts-checker-webpack-plugin@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-1.5.0.tgz#ce1d77190b44d81a761b10b6284a373795e41f0c" - integrity sha512-zEhg7Hz+KhZlBhILYpXy+Beu96gwvkROWJiTXOCyOOMMrdBIRPvsBpBqgTI4jfJGrJXcqGwJR8zsBGDmzY0jsA== +fork-ts-checker-webpack-plugin@4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.6.tgz#5055c703febcf37fa06405d400c122b905167fc5" + integrity sha512-DUxuQaKoqfNne8iikd14SAkh5uw4+8vNifp6gmA73yYNS6ywLIWSLD/n/mBzHQRpW3J7rbATEakmiA8JvkTyZw== dependencies: - babel-code-frame "^6.22.0" + "@babel/code-frame" "^7.5.5" chalk "^2.4.1" - chokidar "^2.0.4" micromatch "^3.1.10" minimatch "^3.0.4" semver "^5.6.0" @@ -3356,51 +3504,38 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== +fs-extra@^9.0.1: + 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 "^4.0.0" - universalify "^0.1.0" - -fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" - integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== - dependencies: - minipass "^2.2.1" + jsonfile "^6.0.1" + universalify "^2.0.0" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" - integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== - dependencies: - nan "^2.9.2" - node-pre-gyp "^0.10.0" - function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= +function.prototype.name@^1.1.2, function.prototype.name@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.4.tgz#e4ea839b9d3672ae99d0efd9f38d9191c5eaac83" + integrity sha512-iqy1pIotY/RmhdFZygSSlW0wko2yxkSCKqsuv4pr8QESohpYyG/Z7B/XXvPRKTJS//960rgguE5mSRUsDdaJrQ== dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.2.tgz#98d93991c39da9361f8e50b337c4f6e41f120e21" + integrity sha512-bLgc3asbWdwPbx2mNk2S49kmJCuQeu0nfmaOgbs8WIyzzkw3r4htszdIi9Q9EMezDPTYuJx2wvjZ/EwgAthpnA== gaze@^1.1.3: version "1.1.3" @@ -3409,16 +3544,25 @@ gaze@^1.1.3: dependencies: globule "^1.0.0" -gensync@^1.0.0-beta.1: - version "1.0.0-beta.1" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" - integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.1" + get-proxy@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/get-proxy/-/get-proxy-2.1.0.tgz#349f2b4d91d44c4d4d4e9cba2ad90143fac5ef93" @@ -3475,10 +3619,10 @@ gifsicle@^4.0.0: execa "^1.0.0" logalot "^2.0.0" -github-slugger@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.1.tgz#47e904e70bf2dccd0014748142d31126cfd49508" - integrity sha512-SsZUjg/P03KPzQBt7OxJPasGw6NRO5uOgiZ5RGXVud5iSIZ0eNZeNp5rTwCxtavrRUa/A77j8mePVc5lEvk0KQ== +github-slugger@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.3.0.tgz#9bd0a95c5efdfc46005e82a906ef8e2a059124c9" + integrity sha512-gwJScWVNhFYSRDvURk/8yhcFBee6aFjye2a7Lhb2bUyRulpIoek9p0I9Kt7PT67d/nUlZbFu8L9RLiA0woQN8Q== dependencies: emoji-regex ">=6.0.0 <=6.1.1" @@ -3489,6 +3633,13 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-parent@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -3532,7 +3683,19 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== -globby@8.0.2, globby@^8.0.1: +globby@11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.1.tgz#9a2bf107a068f3ffeabc49ad702c79ede8cfd357" + integrity sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.1.1" + ignore "^5.1.4" + merge2 "^1.3.0" + slash "^3.0.0" + +globby@^8.0.1: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== @@ -3602,7 +3765,7 @@ got@^8.3.1: url-parse-lax "^3.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: +graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== @@ -3682,6 +3845,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-bigints@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" + integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -3700,17 +3868,17 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= +has-symbols@^1.0.1, has-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" + integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + has-to-string-tag-x@^1.2.0: version "1.4.1" resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" dependencies: has-symbol-support-x "^1.4.1" -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -3777,6 +3945,14 @@ html-comment-regex@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.1.tgz#668b93776eaae55ebde8f3ad464b307a4963625e" +html-element-map@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.3.0.tgz#fcf226985d7111e6c2b958169312ec750d02f0d3" + integrity sha512-AqCt/m9YaiMwaaAyOPdq4Ga0cM+jdDWWGueUMkdROZcTeClaGpN0AQeyGchZhTegQoABmc6+IqH7oCR/8vhQYg== + dependencies: + array-filter "^1.0.0" + call-bind "^1.0.2" + htmlparser2@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.0.tgz#5f5e422dcf6119c0d983ed36260ce9ded0bee464" @@ -3789,6 +3965,16 @@ htmlparser2@^3.9.1: inherits "^2.0.1" readable-stream "^3.0.6" +htmlparser2@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.0.1.tgz#422521231ef6d42e56bd411da8ba40aa36e91446" + integrity sha512-GDKPd+vk4jvSuvCbyuzx/unmXkk090Azec7LovXP8as1Hn8q9p3hbjmDGbUqqhknw0ajwit6LiiWqfiTUPMK7w== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + domutils "^2.4.4" + entities "^2.0.0" + http-cache-semantics@3.8.1: version "3.8.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" @@ -3832,7 +4018,7 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -3844,18 +4030,16 @@ ieee754@^1.1.4: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== -ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== - dependencies: - minimatch "^3.0.4" - ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== +ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + imagemin-gifsicle@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/imagemin-gifsicle/-/imagemin-gifsicle-6.0.1.tgz#6abad4e95566d52e5a104aba1c24b4f3b48581b3" @@ -3903,10 +4087,10 @@ imagemin@^6.0.0: pify "^4.0.1" replace-ext "^1.0.0" -immer@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" - integrity sha512-O3sR1/opvCDGLEVcvrGTMtLac8GJ5IwZC4puPrLuRj3l7ICKvkmA0vGuU9OW8mV9WIBRnaxp5GJh9IEAaNOoYg== +immer@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/immer/-/immer-8.0.1.tgz#9c73db683e2b3975c424fb0572af5889877ae656" + integrity sha512-aqXhGP7//Gui2+UrEtvxZxSquQVXTpZ7KDxfCcKAF3Vysvw0CViVaW9RZ1j1xlIYqaaaipBoqdqeibkc18PNvA== import-fresh@^2.0.0: version "2.0.0" @@ -3955,29 +4139,10 @@ inherits@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: +ini@^1.3.4, ini@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -inquirer@6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" - integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - interpret@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" @@ -3995,12 +4160,6 @@ into-stream@^3.1.0: from2 "^2.1.1" p-is-promise "^1.1.0" -invariant@^2.2.2, invariant@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - dependencies: - loose-envify "^1.0.0" - ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -4037,12 +4196,17 @@ is-arrayish@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" -is-binary-path@^1.0.0: +is-bigint@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.1.tgz#6923051dfcbc764278540b9ce0e6b3213aa5ebc2" + integrity sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg== + +is-boolean-object@^1.0.1, is-boolean-object@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0" + integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA== dependencies: - binary-extensions "^1.0.0" + call-bind "^1.0.0" is-buffer@^1.1.5: version "1.1.6" @@ -4059,6 +4223,11 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== +is-callable@^1.1.5, is-callable@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e" + integrity sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ== + is-color-stop@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-color-stop/-/is-color-stop-1.1.0.tgz#cfff471aee4dd5c9e158598fbe12967b5cdad345" @@ -4119,6 +4288,11 @@ is-directory@^0.3.1: resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= +is-docker@^2.0.0: + 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" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -4140,16 +4314,6 @@ is-finite@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -4175,6 +4339,13 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-jpg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-jpg/-/is-jpg-2.0.0.tgz#2e1997fa6e9166eaac0242daae443403e4ef1d97" @@ -4185,6 +4356,16 @@ is-natural-number@^4.0.1: resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= +is-negative-zero@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" + integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + +is-number-object@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" + integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -4197,6 +4378,11 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -4221,16 +4407,20 @@ is-png@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-png/-/is-png-1.1.0.tgz#d574b12bf275c0350455570b0e5b57ab062077ce" -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" dependencies: has "^1.0.1" +is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.2.tgz#81c8ebde4db142f2cf1c53fc86d6a45788266251" + integrity sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg== + dependencies: + call-bind "^1.0.2" + has-symbols "^1.0.1" + is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -4255,6 +4445,16 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== +is-string@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" + integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= + is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -4269,6 +4469,13 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" +is-symbol@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== + dependencies: + has-symbols "^1.0.1" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -4286,9 +4493,12 @@ is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" is2@2.0.1: version "2.0.1" @@ -4353,10 +4563,6 @@ jpegtran-bin@^4.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - js-yaml@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f" @@ -4411,10 +4617,6 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json3@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - json5@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" @@ -4429,9 +4631,12 @@ json5@^2.1.2: dependencies: minimist "^1.2.5" -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" optionalDependencies: graceful-fs "^4.1.6" @@ -4472,24 +4677,17 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + lazy-cache@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" dependencies: set-getter "^0.1.0" -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levenary@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/levenary/-/levenary-1.1.1.tgz#842a9ee98d2075aa7faeedbe32679e9205f46f77" - integrity sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ== - dependencies: - leven "^3.1.0" - lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -4523,14 +4721,14 @@ loader-runner@^4.2.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== -loader-utils@1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== +loader-utils@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" + integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== dependencies: big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" + emojis-list "^3.0.0" + json5 "^2.1.2" loader-utils@^1.4.0: version "1.4.0" @@ -4541,13 +4739,6 @@ loader-utils@^1.4.0: emojis-list "^3.0.0" json5 "^1.0.1" -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -4583,11 +4774,21 @@ lodash.chunk@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" integrity sha1-ZuXOH3btJ7QwPYxlEujRIW6BBrw= +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= + lodash.defaults@^4.0.1: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= + lodash.filter@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace" @@ -4598,11 +4799,21 @@ lodash.flatten@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + lodash.foreach@^4.3.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" integrity sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM= +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + lodash.map@^4.4.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" @@ -4666,7 +4877,7 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@~4.17.10: +lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.20, lodash@~4.17.10: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -4682,7 +4893,7 @@ longest@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -4821,6 +5032,11 @@ merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== +merge2@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -4830,7 +5046,7 @@ microevent.ts@~0.1.1: resolved "https://registry.yarnpkg.com/microevent.ts/-/microevent.ts-0.1.1.tgz#70b09b83f43df5172d0205a63025bce0f7357fa0" integrity sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g== -micromatch@^3.1.10, micromatch@^3.1.4: +micromatch@^3.1.10: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -4849,6 +5065,14 @@ micromatch@^3.1.10, micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + mime-db@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" @@ -4871,10 +5095,6 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -4895,21 +5115,6 @@ minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^2.2.1, minipass@^2.3.4: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.1.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== - dependencies: - minipass "^2.2.1" - mixin-deep@^1.1.3, mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -4918,13 +5123,18 @@ mixin-deep@^1.1.3, mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: - version "0.5.3" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c" - integrity sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg== +mkdirp@^0.5.1, mkdirp@^0.5.5, mkdirp@~0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== dependencies: minimist "^1.2.5" +moo@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.1.tgz#7aae7f384b9b09f620b6abf6f74ebbcd1b65dbc4" + integrity sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -4934,14 +5144,10 @@ ms@2.1.1, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - -nan@^2.9.2: - version "2.13.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.1.tgz#a15bee3790bde247e8f38f1d446edcdaeb05f2dd" - integrity sha512-I6YB/YEuDeUZMmhscXKxGgZlFnhsn5y0hgOZBadkzfTRrZBtJDZeg6eQf7PYMIEclwmorTKK8GztsyOUSVBREA== +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== nanomatch@^1.2.9: version "1.2.13" @@ -4960,14 +5166,15 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" - integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== +nearley@^2.7.10: + version "2.20.1" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.20.1.tgz#246cd33eff0d012faf197ff6774d7ac78acdd474" + integrity sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ== dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - sax "^1.2.4" + commander "^2.19.0" + moo "^0.5.0" + railroad-diagrams "^1.0.0" + randexp "0.4.6" negotiator@0.6.2: version "0.6.2" @@ -4988,39 +5195,15 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-pre-gyp@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" - integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4" - -node-releases@^1.1.29: - version "1.1.53" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.53.tgz#2d821bfa499ed7c5dffc5e2f28c88e78a08ee3f4" - integrity sha512-wp8zyQVwef2hpZ/dJH7SfSrIPD6YoJz6BDQDpGEkcA0s3LpAQoxBIYmfIq6QAhC1DhwsyCgTaTTcONwX8qzCuQ== - node-releases@^1.1.61: version "1.1.63" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.63.tgz#db6dbb388544c31e888216304e8fd170efee3ff5" integrity sha512-ukW3iCfQaoxJkSPN+iK7KznTeqDGVJatAEuXsJERYHa9tn/KaT5lBdIyxQjLEVTzSkyjJEuQ17/vaEjrOauDkg== -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" +node-releases@^1.1.70: + version "1.1.71" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" + integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" @@ -5041,17 +5224,6 @@ normalize-package-data@^2.5.0: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" @@ -5069,11 +5241,6 @@ normalize-url@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== -npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== - npm-conf@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/npm-conf/-/npm-conf-1.1.3.tgz#256cc47bd0e218c259c4e9550bf413bc2192aff9" @@ -5082,14 +5249,6 @@ npm-conf@^1.1.0: config-chain "^1.1.11" pify "^3.0.0" -npm-packlist@^1.1.6: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -5103,16 +5262,6 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - nth-check@^1.0.2, nth-check@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" @@ -5120,6 +5269,13 @@ nth-check@^1.0.2, nth-check@~1.0.1: dependencies: boolbase "~1.0.0" +nth-check@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.0.tgz#1bb4f6dac70072fc313e8c9cd1417b5074c0a125" + integrity sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q== + dependencies: + boolbase "^1.0.0" + nullthrows@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" @@ -5156,6 +5312,19 @@ object-inspect@^1.6.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== +object-inspect@^1.7.0, object-inspect@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.9.0.tgz#c90521d74e1127b67266ded3394ad6116986533a" + integrity sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw== + +object-is@^1.0.2, object-is@^1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -5178,6 +5347,36 @@ object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" + object-keys "^1.1.1" + +object.entries@^1.1.1, object.entries@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" + integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.1" + has "^1.0.3" + +object.fromentries@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" + integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + has "^1.0.3" + object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -5201,6 +5400,16 @@ object.values@^1.1.0: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.1, object.values@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.3.tgz#eaa8b1e17589f02f698db093f7c62ee1699742ee" + integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + has "^1.0.3" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -5213,12 +5422,6 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - dependencies: - mimic-fn "^1.0.0" - onetime@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" @@ -5226,12 +5429,13 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -open@^6.3.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/open/-/open-6.4.0.tgz#5c13e96d0dc894686164f18965ecfe889ecfc8a9" - integrity sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg== +open@^7.0.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== dependencies: - is-wsl "^1.1.0" + is-docker "^2.0.0" + is-wsl "^2.1.1" optipng-bin@^5.0.0: version "5.1.0" @@ -5242,13 +5446,6 @@ optipng-bin@^5.0.0: bin-wrapper "^4.0.0" logalot "^2.0.0" -original@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" - integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== - dependencies: - url-parse "^1.4.3" - os-filter-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/os-filter-obj/-/os-filter-obj-2.0.0.tgz#1c0b62d5f3a2442749a2d139e6dddee6e81d8d16" @@ -5256,22 +5453,6 @@ os-filter-obj@^2.0.0: dependencies: arch "^2.1.0" -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - p-cancelable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" @@ -5302,12 +5483,6 @@ p-is-promise@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" -p-limit@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" - dependencies: - p-try "^1.0.0" - p-limit@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" @@ -5329,12 +5504,6 @@ p-limit@^3.1.0: dependencies: yocto-queue "^0.1.0" -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -5376,10 +5545,6 @@ p-timeout@^2.0.1: dependencies: p-finally "^1.0.0" -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - p-try@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.1.0.tgz#c1a0f1030e97de018bb2c718929d2af59463e505" @@ -5408,6 +5573,18 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse5-htmlparser2-tree-adapter@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz#2cdf9ad823321140370d4dbf5d3e92c7c8ddc6e6" + integrity sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA== + dependencies: + parse5 "^6.0.1" + +parse5@^6.0.0, parse5@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" + integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -5473,6 +5650,11 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -5482,6 +5664,11 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" +picomatch@^2.0.5, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + pify@^2.0.0, pify@^2.2.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5530,21 +5717,21 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.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" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= +pkg-up@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" + integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA== dependencies: - find-up "^2.1.0" + find-up "^3.0.0" -portfinder@^1.0.25: - version "1.0.25" - resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.25.tgz#254fd337ffba869f4b9d37edc298059cb4d35eca" - integrity sha512-6ElJnHBbxVA1XSLgBp7G1FiCkQdlqGzuF7DswL5tcea+E8UpuvPU7beVAjjRwCioTS9ZluNbu+ZyRvgTsmqEBg== +portfinder@^1.0.28: + version "1.0.28" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778" + integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== dependencies: async "^2.6.2" debug "^3.1.1" - mkdirp "^0.5.1" + mkdirp "^0.5.5" posix-character-classes@^0.1.0: version "0.1.1" @@ -5844,10 +6031,10 @@ prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" -prismjs@^1.17.1: - version "1.21.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3" - integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw== +prismjs@^1.22.0: + version "1.23.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33" + integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA== optionalDependencies: clipboard "^2.0.0" @@ -5860,7 +6047,24 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -prop-types@15.7.2, prop-types@^15.6.2: +prompts@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.0.tgz#4aa5de0723a231d1ee9121c40fdf663df73f61d7" + integrity sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +prop-types-exact@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" + integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== + dependencies: + has "^1.0.3" + object.assign "^4.1.0" + reflect.ownkeys "^0.2.0" + +prop-types@15.7.2, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -5929,10 +6133,30 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -querystringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== +queue-microtask@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.2.tgz#abf64491e6ecf0f38a6502403d4cda04f372dfd3" + integrity sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg== + +raf@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" randomatic@^1.1.3: version "1.1.7" @@ -5970,44 +6194,34 @@ raw-body@~1.1.0: bytes "1" string_decoder "0.10" -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" +react-dev-utils@^11.0.1: + version "11.0.4" + resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-11.0.4.tgz#a7ccb60257a1ca2e0efe7a83e38e6700d17aa37a" + integrity sha512-dx0LvIGHcOPtKbeiSUM4jqpBl3TcY7CDjZdfOIcKeznE7BWr9dg0iPG90G5yfVQ+p/rGNMXdbfStvzQZEVEi4A== dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -react-dev-utils@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-9.1.0.tgz#3ad2bb8848a32319d760d0a84c56c14bdaae5e81" - integrity sha512-X2KYF/lIGyGwP/F/oXgGDF24nxDA2KC4b7AFto+eqzc/t838gpSGiaU8trTqHXOohuLxxc5qi1eDzsl9ucPDpg== - dependencies: - "@babel/code-frame" "7.5.5" + "@babel/code-frame" "7.10.4" address "1.1.2" - browserslist "4.7.0" + browserslist "4.14.2" chalk "2.4.2" - cross-spawn "6.0.5" + cross-spawn "7.0.3" detect-port-alt "1.1.6" - escape-string-regexp "1.0.5" - filesize "3.6.1" - find-up "3.0.0" - fork-ts-checker-webpack-plugin "1.5.0" + escape-string-regexp "2.0.0" + filesize "6.1.0" + find-up "4.1.0" + fork-ts-checker-webpack-plugin "4.1.6" global-modules "2.0.0" - globby "8.0.2" + globby "11.0.1" gzip-size "5.1.1" - immer "1.10.0" - inquirer "6.5.0" + immer "8.0.1" is-root "2.1.0" - loader-utils "1.2.3" - open "^6.3.0" - pkg-up "2.0.0" - react-error-overlay "^6.0.3" + loader-utils "2.0.0" + open "^7.0.2" + pkg-up "3.1.0" + prompts "2.4.0" + react-error-overlay "^6.0.9" recursive-readdir "2.2.2" shell-quote "1.7.2" - sockjs-client "1.4.0" - strip-ansi "5.2.0" + strip-ansi "6.0.0" text-table "0.2.0" react-dom@17.0.1: @@ -6029,16 +6243,31 @@ react-dom@^16.2.0, react-dom@^16.8.4: prop-types "^15.6.2" scheduler "^0.19.1" -react-error-overlay@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.3.tgz#c378c4b0a21e88b2e159a3e62b2f531fd63bf60d" - integrity sha512-bOUvMWFQVk5oz8Ded9Xb7WVdEi3QGLC8tH7HmYP0Fdp4Bn3qw0tRFmr5TW6mvahzvmrK4a6bqWGfCevBflP+Xw== +react-error-overlay@^6.0.9: + version "6.0.9" + resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" + integrity sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew== + +react-is@^16.13.1, react-is@^16.8.6: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== react-is@^16.8.1: version "16.10.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.1.tgz#0612786bf19df406502d935494f0450b40b8294f" integrity sha512-BXUMf9sIOPXXZWqr7+c5SeOKJykyVr2u0UDzEf4LNGc6taGkQe1A9DFD07umCIXz45RLr9oAAwZbAJ0Pkknfaw== +react-test-renderer@^16.0.0-0: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" + integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.19.1" + react@17.0.1: version "17.0.1" resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127" @@ -6081,7 +6310,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@~2.3.6: +readable-stream@^2.0.0, readable-stream@^2.2.2, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -6115,15 +6344,6 @@ readable-stream@^3.0.6: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -6151,6 +6371,11 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" +reflect.ownkeys@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" + integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= + regenerate-unicode-properties@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec" @@ -6195,6 +6420,18 @@ regexpu-core@^4.7.0: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.2.0" +regexpu-core@^4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.7.1.tgz#2dea5a9a07233298fbf0db91fa9abc4c6e0f8ad6" + integrity sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.2.0" + regjsgen "^0.5.1" + regjsparser "^0.6.4" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.2.0" + regjsgen@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" @@ -6223,10 +6460,6 @@ remarkable@^2.0.0: argparse "^1.0.10" autolinker "^3.11.0" -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" @@ -6275,11 +6508,6 @@ require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -6301,14 +6529,14 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.3.2: +resolve@^1.1.6: version "1.9.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" integrity sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ== dependencies: path-parse "^1.0.6" -resolve@^1.10.0: +resolve@^1.10.0, resolve@^1.14.2: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== @@ -6329,18 +6557,16 @@ responselike@1.0.2: dependencies: lowercase-keys "^1.0.0" -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rgb-regex@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rgb-regex/-/rgb-regex-1.0.1.tgz#c0e0d6882df0e23be254a475e8edd41915feaeb1" @@ -6351,20 +6577,29 @@ rgba-regex@^1.0.0: resolved "https://registry.yarnpkg.com/rgba-regex/-/rgba-regex-1.0.0.tgz#43374e2e2ca0968b0ef1523460b7d730ff22eeb3" integrity sha1-QzdOLiyglosO8VI0YLfXMP8i7rM= -rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@^2.5.4: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE= dependencies: - is-promise "^2.1.0" + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" -rxjs@^6.4.0, rxjs@^6.6.3: +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +rxjs@^6.6.3: version "6.6.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== @@ -6456,7 +6691,7 @@ semver-truncate@^1.1.2: dependencies: semver "^5.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== @@ -6466,7 +6701,12 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@^6.0.0: +semver@^5.7.0, semver@^5.7.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -6507,10 +6747,6 @@ serve-static@1.14.1: parseurl "~1.3.3" send "0.17.1" -set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - set-getter@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" @@ -6585,7 +6821,7 @@ shelljs@^0.8.4: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^3.0.0, signal-exit@^3.0.2: +signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -6600,6 +6836,11 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + sitemap@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-3.2.2.tgz#3f77c358fa97b555c879e457098e39910095c62b" @@ -6614,6 +6855,11 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -6644,18 +6890,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sockjs-client@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.4.0.tgz#c9f2568e19c8fd8173b4997ea3420e0bb306c7d5" - integrity sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g== - dependencies: - debug "^3.2.5" - eventsource "^1.0.7" - faye-websocket "~0.11.1" - inherits "^2.0.3" - json3 "^3.3.2" - url-parse "^1.4.3" - sort-keys-length@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sort-keys-length/-/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188" @@ -6813,21 +7047,6 @@ string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" @@ -6837,6 +7056,23 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" +string.prototype.trim@^1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.4.tgz#6014689baf5efaf106ad031a5fa45157666ed1bd" + integrity sha512-hWCk/iqf7lp0/AgTF7/ddO1IWtSNPASjlzCicV5irAVdE1grjsneK26YG6xACMBEdCvO8fUST0UzDMh/2Qy+9Q== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.18.0-next.2" + +string.prototype.trimend@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" + integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + string.prototype.trimleft@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" @@ -6853,6 +7089,14 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" +string.prototype.trimstart@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" + integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + string_decoder@0.10: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -6871,32 +7115,19 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@5.2.0, strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^6.0.0: +strip-ansi@6.0.0, strip-ansi@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== dependencies: ansi-regex "^5.0.0" +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -6929,10 +7160,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - strip-outer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-outer/-/strip-outer-1.0.1.tgz#b2fd2abf6604b9d1e6013057195df836b8a9d631" @@ -7022,19 +7249,6 @@ tar-stream@^1.5.2: to-buffer "^1.1.1" xtend "^4.0.0" -tar@^4: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" - integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.2" - tcp-port-used@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.1.tgz#46061078e2d38c73979a2c2c12b5a674e6689d70" @@ -7087,7 +7301,7 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -through@^2.3.6, through@^2.3.8: +through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -7116,12 +7330,6 @@ tiny-lr@^1.1.1: object-assign "^4.1.0" qs "^6.4.0" -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - to-buffer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" @@ -7146,6 +7354,13 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" @@ -7241,6 +7456,16 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +unbox-primitive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.0.tgz#eeacbc4affa28e9b3d36b5eaeccc50b3251b1d3f" + integrity sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA== + dependencies: + function-bind "^1.1.1" + has-bigints "^1.0.0" + has-symbols "^1.0.0" + which-boxed-primitive "^1.0.1" + unbzip2-stream@^1.0.9: version "1.4.3" resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" @@ -7290,9 +7515,10 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" @@ -7310,11 +7536,6 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -7339,14 +7560,6 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" @@ -7509,6 +7722,17 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" +which-boxed-primitive@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -7523,13 +7747,6 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - 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" @@ -7586,11 +7803,6 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== - yamljs@^0.2.1: version "0.2.10" resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.2.10.tgz#481cc7c25ca73af59f591f0c96e3ce56c757a40f" From 2447cc32a9a4c629ef5e5088ea145bca86705fcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 12:08:37 +0000 Subject: [PATCH 14/89] Build(deps): Bump clipboard from 2.0.7 to 2.0.8 in /website (#10525) --- website/package.json | 2 +- website/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/package.json b/website/package.json index 60cf2fb86..768f862ef 100644 --- a/website/package.json +++ b/website/package.json @@ -6,7 +6,7 @@ "update-stable-docs": "rm -rf ./versioned_docs ./versions.json && docusaurus-version stable" }, "dependencies": { - "clipboard": "2.0.7", + "clipboard": "2.0.8", "codemirror-graphql": "1.0.0", "lz-string": "1.4.4", "prop-types": "15.7.2", diff --git a/website/yarn.lock b/website/yarn.lock index 90dd11c70..895efe7ee 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1987,10 +1987,10 @@ classnames@^2.2.6: version "2.2.6" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" -clipboard@2.0.7, clipboard@^2.0.0: - version "2.0.7" - resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.7.tgz#da927f817b1859426df39212ac81feb07dbaeadc" - integrity sha512-8M8WEZcIvs0hgOma+wAPkrUxpv0PMY1L6VsAJh/2DOKARIMpyWe6ZLcEoe1qktl6/ced5ceYHs+oGedSbgZ3sg== +clipboard@2.0.8, clipboard@^2.0.0: + version "2.0.8" + resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.8.tgz#ffc6c103dd2967a83005f3f61976aa4655a4cdba" + integrity sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ== dependencies: good-listener "^1.2.2" select "^1.1.2" From 59868f4322eacb0ed9b30fd5c26551843aa53588 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 12:40:12 +0000 Subject: [PATCH 15/89] Build(deps-dev): Bump webpack from 5.24.3 to 5.25.0 in /website (#10526) --- website/package.json | 2 +- website/yarn.lock | 32 ++++++-------------------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/website/package.json b/website/package.json index 768f862ef..8bc396a30 100644 --- a/website/package.json +++ b/website/package.json @@ -20,7 +20,7 @@ "concurrently": "6.0.0", "docusaurus": "1.14.7", "js-yaml": "4.0.0", - "webpack": "5.24.3", + "webpack": "5.25.0", "webpack-cli": "4.5.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index 895efe7ee..22b389b07 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1702,17 +1702,7 @@ browserslist@4.14.2: escalade "^3.0.2" node-releases "^1.1.61" -browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5: - version "4.14.5" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.5.tgz#1c751461a102ddc60e40993639b709be7f2c4015" - integrity sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA== - dependencies: - caniuse-lite "^1.0.30001135" - electron-to-chromium "^1.3.571" - escalade "^3.1.0" - node-releases "^1.1.61" - -browserslist@^4.16.3: +browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.14.5, browserslist@^4.16.3: version "4.16.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== @@ -1866,11 +1856,6 @@ caniuse-lite@^1.0.30001125, caniuse-lite@^1.0.30001181: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001199.tgz#062afccaad21023e2e647d767bac4274b8b8fd7f" integrity sha512-ifbK2eChUCFUwGhlEzIoVwzFt1+iriSjyKKFYNfv6hN34483wyWpLLavYQXhnR036LhkdUYaSDpHg1El++VgHQ== -caniuse-lite@^1.0.30001135: - version "1.0.30001148" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001148.tgz#dc97c7ed918ab33bf8706ddd5e387287e015d637" - integrity sha512-E66qcd0KMKZHNJQt9hiLZGE3J4zuTqE1OnU53miEVtylFbwOEmeA5OsRu90noZful+XGSQOni1aT2tiqu/9yYw== - caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -2799,11 +2784,6 @@ electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.649: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.687.tgz#c336184b7ab70427ffe2ee79eaeaedbc1ad8c374" integrity sha512-IpzksdQNl3wdgkzf7dnA7/v10w0Utf1dF2L+B4+gKrloBrxCut+au+kky3PYvle3RMdSxZP+UiCZtLbcYRxSNQ== -electron-to-chromium@^1.3.571: - version "1.3.580" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.580.tgz#eb27873cfa012c43c53c9e9129038b8fd7cb964f" - integrity sha512-5flHTbRpptO6h3lQUG4zdSAxryAS3PrZOkLpLS0DL5/y2LBf+l9HJ8X6UBorNs1QRBrMR7u/QvkdK+GlekW1kQ== - "emoji-regex@>=6.0.0 <=6.1.1": version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" @@ -3009,7 +2989,7 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -escalade@^3.0.2, escalade@^3.1.0, escalade@^3.1.1: +escalade@^3.0.2, escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== @@ -7672,10 +7652,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.24.3: - version "5.24.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.3.tgz#6ec0f5059f8d7c7961075fa553cfce7b7928acb3" - integrity sha512-x7lrWZ7wlWAdyKdML6YPvfVZkhD1ICuIZGODE5SzKJjqI9A4SpqGTjGJTc6CwaHqn19gGaoOR3ONJ46nYsn9rw== +webpack@5.25.0: + version "5.25.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.25.0.tgz#f9409977f0f3b6d4b9c4f73adc7d7cb9603a09e9" + integrity sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From eadd777cc2539786a6e91b6c2c4d7f4c0d0fb535 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 12:40:17 +0000 Subject: [PATCH 16/89] Build(deps-dev): Bump webpack from 5.24.3 to 5.25.0 (#10521) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 389e021b3..8bfeb226b 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.24.3" + "webpack": "5.25.0" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 719634f7b..def8dd8c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7080,10 +7080,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.24.3: - version "5.24.3" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.24.3.tgz#6ec0f5059f8d7c7961075fa553cfce7b7928acb3" - integrity sha512-x7lrWZ7wlWAdyKdML6YPvfVZkhD1ICuIZGODE5SzKJjqI9A4SpqGTjGJTc6CwaHqn19gGaoOR3ONJ46nYsn9rw== +webpack@5.25.0: + version "5.25.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.25.0.tgz#f9409977f0f3b6d4b9c4f73adc7d7cb9603a09e9" + integrity sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From 21c81e007d90bc77a9ff918a97d492fc53369351 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 14 Mar 2021 21:04:35 +0800 Subject: [PATCH 17/89] Test json superset (#10493) --- tests/json/json-superset/jsfmt.spec.js | 78 ++++++++++++++++++++++++++ tests_config/utils/check-parsers.js | 2 +- 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 tests/json/json-superset/jsfmt.spec.js diff --git a/tests/json/json-superset/jsfmt.spec.js b/tests/json/json-superset/jsfmt.spec.js new file mode 100644 index 000000000..4bc498ad7 --- /dev/null +++ b/tests/json/json-superset/jsfmt.spec.js @@ -0,0 +1,78 @@ +const LINE_SEPARATOR = "\u2028"; +const PARAGRAPH_SEPARATOR = "\u2029"; +const SPACE = " "; +const LINE_FEED = "\n"; +const UNDERSCORE = "_"; +const BACKSLASH = "\\"; +const SINGLE_QUOTE = "'"; +const DOUBLE_QUOTE = '"'; + +const characters = [LINE_SEPARATOR, PARAGRAPH_SEPARATOR, UNDERSCORE, SPACE]; +const characterCode = (character) => + `U+${character.charCodeAt(0).toString(16).toUpperCase().padStart(4, "0")}`; + +run_spec( + { + dirname: __dirname, + snippets: [ + ...characters.map((character) => ({ + name: `json(${characterCode(character)})`, + code: SINGLE_QUOTE + character + SINGLE_QUOTE, + output: DOUBLE_QUOTE + character + DOUBLE_QUOTE + LINE_FEED, + })), + ...[...characters, LINE_FEED].map((character) => ({ + name: `json(\\${characterCode(character)})`, + code: SINGLE_QUOTE + BACKSLASH + character + SINGLE_QUOTE, + output: + character === UNDERSCORE || character === SPACE + ? DOUBLE_QUOTE + character + DOUBLE_QUOTE + LINE_FEED + : DOUBLE_QUOTE + BACKSLASH + character + DOUBLE_QUOTE + LINE_FEED, + })), + ...characters.map((character) => ({ + name: `json(\\\\${characterCode(character)})`, + code: SINGLE_QUOTE + BACKSLASH + BACKSLASH + character + SINGLE_QUOTE, + output: + DOUBLE_QUOTE + + BACKSLASH + + BACKSLASH + + character + + DOUBLE_QUOTE + + LINE_FEED, + })), + ], + }, + ["json", "json5"] +); + +run_spec( + { + dirname: __dirname, + snippets: [ + ...characters.map((character) => ({ + name: `json-stringify(${characterCode(character)})`, + code: SINGLE_QUOTE + character + SINGLE_QUOTE, + output: DOUBLE_QUOTE + character + DOUBLE_QUOTE + LINE_FEED, + })), + ...[...characters, LINE_FEED].map((character) => ({ + name: `json-stringify(\\${characterCode(character)})`, + code: SINGLE_QUOTE + BACKSLASH + character + SINGLE_QUOTE, + output: + character === UNDERSCORE || character === SPACE + ? DOUBLE_QUOTE + character + DOUBLE_QUOTE + LINE_FEED + : DOUBLE_QUOTE + DOUBLE_QUOTE + LINE_FEED, + })), + ...characters.map((character) => ({ + name: `json-stringify(\\\\${characterCode(character)})`, + code: SINGLE_QUOTE + BACKSLASH + BACKSLASH + character + SINGLE_QUOTE, + output: + DOUBLE_QUOTE + + BACKSLASH + + BACKSLASH + + character + + DOUBLE_QUOTE + + LINE_FEED, + })), + ], + }, + ["json-stringify"] +); diff --git a/tests_config/utils/check-parsers.js b/tests_config/utils/check-parsers.js index dfd2b683c..38ba9966f 100644 --- a/tests_config/utils/check-parsers.js +++ b/tests_config/utils/check-parsers.js @@ -67,7 +67,7 @@ const categoryParsers = new Map([ "json", { parsers: ["json", "json5", "json-stringify"], - verifyParsers: [], + verifyParsers: ["json", "json5", "json-stringify"], extensions: [".json"], }, ], From a5916854aa56f9a692a7668388f6232bfa930841 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 22:35:21 +0800 Subject: [PATCH 18/89] Build(deps-dev): Bump @babel/core from 7.13.8 to 7.13.10 (#10522) Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.13.8 to 7.13.10. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.10/packages/babel-core) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 47 ++++++++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 8bfeb226b..1a541c0d9 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "yaml-unist-parser": "1.3.1" }, "devDependencies": { - "@babel/core": "7.13.8", + "@babel/core": "7.13.10", "@babel/preset-env": "7.13.9", "@babel/types": "7.13.0", "@glimmer/reference": "0.77.1", diff --git a/yarn.lock b/yarn.lock index def8dd8c1..6c335703c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,17 +35,17 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.8.tgz#5b783b9808f15cef71547f1b691f34f8ff6003a6" integrity sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== -"@babel/core@7.13.8", "@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.7.5": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.8.tgz#c191d9c5871788a591d69ea1dc03e5843a3680fb" - integrity sha512-oYapIySGw1zGhEFRd6lzWNLWFX2s5dA/jm+Pw/+59ZdXtjyIuwlXbrId22Md0rgZVop+aVoqow2riXhBLNyuQg== +"@babel/core@7.13.10", "@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.7.5": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.10.tgz#07de050bbd8193fcd8a3c27918c0890613a94559" + integrity sha512-bfIYcT0BdKeAZrovpMqX2Mx5NrgAckGbwT982AkdS5GNfn3KMGiprlBAtmBcFZRUmpaufS6WZFP8trvx8ptFDw== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.0" - "@babel/helper-compilation-targets" "^7.13.8" + "@babel/generator" "^7.13.9" + "@babel/helper-compilation-targets" "^7.13.10" "@babel/helper-module-transforms" "^7.13.0" - "@babel/helpers" "^7.13.0" - "@babel/parser" "^7.13.4" + "@babel/helpers" "^7.13.10" + "@babel/parser" "^7.13.10" "@babel/template" "^7.12.13" "@babel/traverse" "^7.13.0" "@babel/types" "^7.13.0" @@ -66,10 +66,10 @@ eslint-visitor-keys "^1.3.0" semver "^6.3.0" -"@babel/generator@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.0.tgz#bd00d4394ca22f220390c56a0b5b85568ec1ec0c" - integrity sha512-zBZfgvBB/ywjx0Rgc2+BwoH/3H+lDtlgD4hBOpEv5LxRnYsm/753iRuLepqnYlynpjC3AdQxtxsoeHJoEEwOAw== +"@babel/generator@^7.13.0", "@babel/generator@^7.13.9": + version "7.13.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" + integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== dependencies: "@babel/types" "^7.13.0" jsesc "^2.5.1" @@ -90,10 +90,10 @@ "@babel/helper-explode-assignable-expression" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.8.tgz#02bdb22783439afb11b2f009814bdd88384bd468" - integrity sha512-pBljUGC1y3xKLn1nrx2eAhurLMA8OqBtBP/JwG4U8skN7kf8/aqwwxpV1N6T0e7r6+7uNitIa/fUxPFagSXp3A== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.10", "@babel/helper-compilation-targets@^7.13.8": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz#1310a1678cb8427c07a753750da4f8ce442bdd0c" + integrity sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA== dependencies: "@babel/compat-data" "^7.13.8" "@babel/helper-validator-option" "^7.12.17" @@ -265,10 +265,10 @@ "@babel/traverse" "^7.13.0" "@babel/types" "^7.13.0" -"@babel/helpers@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.0.tgz#7647ae57377b4f0408bf4f8a7af01c42e41badc0" - integrity sha512-aan1MeFPxFacZeSz6Ld7YZo5aPuqnKlD7+HZY75xQsueczFccP9A7V05+oe0XpLwHK3oLorPe9eaAUljL7WEaQ== +"@babel/helpers@^7.13.10": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.13.10.tgz#fd8e2ba7488533cdeac45cc158e9ebca5e3c7df8" + integrity sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ== dependencies: "@babel/template" "^7.12.13" "@babel/traverse" "^7.13.0" @@ -283,11 +283,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.9", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.4": +"@babel/parser@7.13.9": version "7.13.9" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99" integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.10.tgz#8f8f9bf7b3afa3eabd061f7a5bcdf4fec3c48409" + integrity sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ== + "@babel/plugin-proposal-async-generator-functions@^7.13.8": version "7.13.8" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz#87aacb574b3bc4b5603f6fe41458d72a5a2ec4b1" From 4097e704acd263a23ddfd70ed8e4a80451026602 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 23:07:38 +0800 Subject: [PATCH 19/89] Build(deps-dev): Bump rollup from 2.40.0 to 2.41.2 (#10529) Bumps [rollup](https://github.com/rollup/rollup) from 2.40.0 to 2.41.2. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.40.0...v2.41.2) 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 1a541c0d9..140f84bf9 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "prettier": "2.2.1", "pretty-bytes": "5.6.0", "rimraf": "3.0.2", - "rollup": "2.40.0", + "rollup": "2.41.2", "rollup-plugin-polyfill-node": "0.6.1", "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.4", diff --git a/yarn.lock b/yarn.lock index 6c335703c..bddf3ed41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6022,10 +6022,10 @@ rollup-plugin-terser@7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@2.40.0: - version "2.40.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.40.0.tgz#efc218eaede7ab590954df50f96195188999c304" - integrity sha512-WiOGAPbXoHu+TOz6hyYUxIksOwsY/21TRWoO593jgYt8mvYafYqQl+axaA8y1z2HFazNUUrsMSjahV2A6/2R9A== +rollup@2.41.2: + version "2.41.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.41.2.tgz#b7db5cb7c21c2d524e8b26ef39c7e9808a290c7e" + integrity sha512-6u8fJJXJx6fmvKrAC9DHYZgONvSkz8S9b/VFBjoQ6dkKdHyPpPbpqiNl2Bao9XBzDHpq672X6sGZ9G1ZBqAHMg== optionalDependencies: fsevents "~2.3.1" From 3e8fc15facf5dcad1f5b6361710d3a89a186de79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 15:42:09 +0000 Subject: [PATCH 20/89] Build(deps-dev): Bump eslint from 7.21.0 to 7.22.0 (#10530) --- package.json | 2 +- yarn.lock | 26 +++++++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 140f84bf9..fa70428e2 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "builtin-modules": "3.2.0", "cross-env": "7.0.3", "cspell": "4.2.8", - "eslint": "7.21.0", + "eslint": "7.22.0", "eslint-config-prettier": "8.1.0", "eslint-formatter-friendly": "7.0.0", "eslint-plugin-import": "2.22.1", diff --git a/yarn.lock b/yarn.lock index bddf3ed41..193d809b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3125,10 +3125,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.21.0: - version "7.21.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83" - integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg== +eslint@7.22.0: + version "7.22.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f" + integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" @@ -3147,7 +3147,7 @@ eslint@7.21.0: file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" glob-parent "^5.0.0" - globals "^12.1.0" + globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" @@ -3155,7 +3155,7 @@ eslint@7.21.0: js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" - lodash "^4.17.20" + lodash "^4.17.21" minimatch "^3.0.4" natural-compare "^1.4.0" optionator "^0.9.1" @@ -3629,6 +3629,13 @@ globals@^12.1.0: dependencies: type-fest "^0.8.1" +globals@^13.6.0: + version "13.6.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.6.0.tgz#d77138e53738567bb96a3916ff6f6b487af20ef7" + integrity sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ== + dependencies: + type-fest "^0.20.2" + globby@11.0.2, globby@^11.0.1: version "11.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" @@ -4884,7 +4891,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.21, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4: +lodash@4.17.21, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -6786,6 +6793,11 @@ type-fest@^0.16.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" From 9f3c95b6599b1c813d34cd0d696bdaa5678ccc64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Mar 2021 16:03:25 +0000 Subject: [PATCH 21/89] Build(deps-dev): Bump @babel/preset-env from 7.13.9 to 7.13.10 (#10527) --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fa70428e2..f484433e1 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ }, "devDependencies": { "@babel/core": "7.13.10", - "@babel/preset-env": "7.13.9", + "@babel/preset-env": "7.13.10", "@babel/types": "7.13.0", "@glimmer/reference": "0.77.1", "@rollup/plugin-alias": "3.1.2", diff --git a/yarn.lock b/yarn.lock index 193d809b6..7b7d8c19f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -748,13 +748,13 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13" -"@babel/preset-env@7.13.9": - version "7.13.9" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.9.tgz#3ee5f233316b10d066d7f379c6d1e13a96853654" - integrity sha512-mcsHUlh2rIhViqMG823JpscLMesRt3QbMsv1+jhopXEb3W2wXvQ9QoiOlZI9ZbR3XqPtaFpZwEZKYqGJnGMZTQ== +"@babel/preset-env@7.13.10": + version "7.13.10" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.10.tgz#b5cde31d5fe77ab2a6ab3d453b59041a1b3a5252" + integrity sha512-nOsTScuoRghRtUsRr/c69d042ysfPHcu+KOB4A9aAO9eJYqrkat+LF8G1yp1HD18QiwixT2CisZTr/0b3YZPXQ== dependencies: "@babel/compat-data" "^7.13.8" - "@babel/helper-compilation-targets" "^7.13.8" + "@babel/helper-compilation-targets" "^7.13.10" "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-validator-option" "^7.12.17" "@babel/plugin-proposal-async-generator-functions" "^7.13.8" From 6a87ce138a1f9278bdcfa81e0aa1fe3f0bc8adfb Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 15 Mar 2021 00:08:37 +0200 Subject: [PATCH 22/89] Improve detection of AMD define (#10528) --- changelog_unreleased/javascript/10528.md | 23 ++++++++++ src/language-js/print/call-expression.js | 37 +++++++++++++--- .../__snapshots__/jsfmt.spec.js.snap | 43 +++++++++++++++++++ tests/js/require-amd/named-amd-module.js | 6 +++ tests/js/require-amd/non-amd-define.js | 5 +++ 5 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 changelog_unreleased/javascript/10528.md create mode 100644 tests/js/require-amd/named-amd-module.js create mode 100644 tests/js/require-amd/non-amd-define.js diff --git a/changelog_unreleased/javascript/10528.md b/changelog_unreleased/javascript/10528.md new file mode 100644 index 000000000..ae9c2f1cf --- /dev/null +++ b/changelog_unreleased/javascript/10528.md @@ -0,0 +1,23 @@ +#### Improve detection of AMD `define` (#10528 by @thorn0) + +Prettier special-cases AMD `define` calls to avoid unexpected line breaks in them. `define` calls that weren't expression statements and had nothing to do with AMD were formatted this way too. This happens no longer. + + +```jsx +// Input +const someVariable = define( + "some string literal", + anotherVariable, + yetAnotherVariable +); + +// Prettier stable +const someVariable = define("some string literal", anotherVariable, yetAnotherVariable); + +// Prettier main +const someVariable = define( + "some string literal", + anotherVariable, + yetAnotherVariable +); +``` diff --git a/src/language-js/print/call-expression.js b/src/language-js/print/call-expression.js index e8b1ca15b..8146c5b8d 100644 --- a/src/language-js/print/call-expression.js +++ b/src/language-js/print/call-expression.js @@ -9,6 +9,7 @@ const { hasFlowAnnotationComment, isCallExpression, isMemberish, + isStringLiteral, isTemplateOnItsOwnLine, isTestCall, iterateCallArgumentsPath, @@ -19,27 +20,25 @@ const { printOptionalToken, printFunctionTypeParameters } = require("./misc"); function printCallExpression(path, options, print) { const node = path.getValue(); + const parentNode = path.getParentNode(); const isNew = node.type === "NewExpression"; const isDynamicImport = node.type === "ImportExpression"; const optional = printOptionalToken(path); const args = getCallArguments(node); if ( - // Dangling comments not handled, all these special cases should has argument #9668 + // Dangling comments are not handled, all these special cases should have arguments #9668 args.length > 0 && // We want to keep CommonJS- and AMD-style require calls, and AMD-style // define calls, as a unit. - // e.g. `define(["some/lib", (lib) => {` - ((!isDynamicImport && - !isNew && - node.callee.type === "Identifier" && - (node.callee.name === "require" || node.callee.name === "define")) || + // e.g. `define(["some/lib"], (lib) => {` + ((!isDynamicImport && !isNew && isCommonsJsOrAmdCall(node, parentNode)) || // Template literals as single arguments (args.length === 1 && isTemplateOnItsOwnLine(args[0], options.originalText)) || // Keep test declarations on a single line // e.g. `it('long name', () => {` - (!isNew && isTestCall(node, path.getParentNode()))) + (!isNew && isTestCall(node, parentNode))) ) { const printed = []; iterateCallArgumentsPath(path, (argPath) => { @@ -102,4 +101,28 @@ function printCallExpression(path, options, print) { return contents; } +function isCommonsJsOrAmdCall(node, parentNode) { + if (node.callee.type !== "Identifier") { + return false; + } + + if (node.callee.name === "require") { + return true; + } + + if (node.callee.name === "define") { + const args = getCallArguments(node); + return ( + parentNode.type === "ExpressionStatement" && + (args.length === 1 || + (args.length === 2 && args[0].type === "ArrayExpression") || + (args.length === 3 && + isStringLiteral(args[0]) && + args[1].type === "ArrayExpression")) + ); + } + + return false; +} + module.exports = { printCallExpression }; diff --git a/tests/js/require-amd/__snapshots__/jsfmt.spec.js.snap b/tests/js/require-amd/__snapshots__/jsfmt.spec.js.snap index d42f56631..5b2329192 100644 --- a/tests/js/require-amd/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/require-amd/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,48 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`named-amd-module.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +define("foo/title", + ["my/cart", "my/inventory"], + function(cart, inventory) { + //Define foo/title object in here. + } +) + +=====================================output===================================== +define("foo/title", ["my/cart", "my/inventory"], function (cart, inventory) { + //Define foo/title object in here. +}); + +================================================================================ +`; + +exports[`non-amd-define.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const someVariable = define( + "some string literal", + anotherVariable, + yetAnotherVariable +); + +=====================================output===================================== +const someVariable = define( + "some string literal", + anotherVariable, + yetAnotherVariable +); + +================================================================================ +`; + exports[`require.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/require-amd/named-amd-module.js b/tests/js/require-amd/named-amd-module.js new file mode 100644 index 000000000..c3ce3ab29 --- /dev/null +++ b/tests/js/require-amd/named-amd-module.js @@ -0,0 +1,6 @@ +define("foo/title", + ["my/cart", "my/inventory"], + function(cart, inventory) { + //Define foo/title object in here. + } +) diff --git a/tests/js/require-amd/non-amd-define.js b/tests/js/require-amd/non-amd-define.js new file mode 100644 index 000000000..038334f70 --- /dev/null +++ b/tests/js/require-amd/non-amd-define.js @@ -0,0 +1,5 @@ +const someVariable = define( + "some string literal", + anotherVariable, + yetAnotherVariable +); From 3f12d6496d7322bca2899c25fa1482063f83517c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 06:09:58 +0800 Subject: [PATCH 23/89] Build(deps-dev): Bump eslint-plugin-jest from 24.1.8 to 24.3.1 (#10532) Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 24.1.8 to 24.3.1. - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v24.1.8...v24.3.1) 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 f484433e1..1dfd80a4d 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "eslint-config-prettier": "8.1.0", "eslint-formatter-friendly": "7.0.0", "eslint-plugin-import": "2.22.1", - "eslint-plugin-jest": "24.1.8", + "eslint-plugin-jest": "24.3.1", "eslint-plugin-prettier-internal-rules": "link:scripts/tools/eslint-plugin-prettier-internal-rules", "eslint-plugin-react": "7.22.0", "eslint-plugin-unicorn": "28.0.2", diff --git a/yarn.lock b/yarn.lock index 7b7d8c19f..d65242a1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3035,10 +3035,10 @@ eslint-plugin-import@2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-jest@24.1.8: - version "24.1.8" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.1.8.tgz#c790cab5d556d3918c45c9842984cb281723af69" - integrity sha512-0ZU0d4ohDF/ibC1RT/VJQY4orrFw0tyaGBWET09yB/V7ilnjKENSPFSGaLp3u0KHGiNDhZZKe+ZbWSAwy2Sffg== +eslint-plugin-jest@24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.1.tgz#c8df037847b83397940bef7fbc2cc168ab466bcc" + integrity sha512-RQt59rfMSHyvedImT72iaf8JcvCcR4P7Uq499dALtjY8mrCjbwWrFi1UceG4sid2wVIeDi+0tjxXZ8CZEVO7Zw== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" From 127a7839655e7bef88dceff5e47888f4b7bc1797 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 06:30:02 +0800 Subject: [PATCH 24/89] Build(deps-dev): Bump rollup-plugin-polyfill-node from 0.6.1 to 0.6.2 (#10533) Bumps [rollup-plugin-polyfill-node](https://github.com/snowpackjs/rollup-plugin-polyfill-node) from 0.6.1 to 0.6.2. - [Release notes](https://github.com/snowpackjs/rollup-plugin-polyfill-node/releases) - [Commits](https://github.com/snowpackjs/rollup-plugin-polyfill-node/commits) 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 1dfd80a4d..dd56c4deb 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "pretty-bytes": "5.6.0", "rimraf": "3.0.2", "rollup": "2.41.2", - "rollup-plugin-polyfill-node": "0.6.1", + "rollup-plugin-polyfill-node": "0.6.2", "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.4", "snapshot-diff": "0.8.1", diff --git a/yarn.lock b/yarn.lock index d65242a1e..0ac80a86a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6012,10 +6012,10 @@ rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup-plugin-polyfill-node@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.6.1.tgz#021db7417559dc9faf5eac7d34232f596ad95607" - integrity sha512-r+A3VUWVMm5tiWoQPpe9BOPycN+G+XgXQGmOyDn6REPaZNvNz16rOQ/3X9U6xE7kQAlXQCnec9L5i0fFytNYCQ== +rollup-plugin-polyfill-node@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-polyfill-node/-/rollup-plugin-polyfill-node-0.6.2.tgz#dea62e00f5cc2c174e4b4654b5daab79b1a92fc3" + integrity sha512-gMCVuR0zsKq0jdBn8pSXN1Ejsc458k2QsFFvQdbHoM0Pot5hEnck+pBP/FDwFS6uAi77pD3rDTytsaUStsOMlA== dependencies: "@rollup/plugin-inject" "^4.0.0" From f7fe6f52ca5a61f063fa576d2f8470e210e3025c Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 15 Mar 2021 02:25:18 +0200 Subject: [PATCH 25/89] docs: refine browser.md (#10539) --- docs/browser.md | 77 +++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/docs/browser.md b/docs/browser.md index 352c9bdd4..245b801da 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -3,7 +3,7 @@ id: browser title: Browser --- -Run Prettier in the browser using its **standalone** version. This version only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins. +Run Prettier in the browser using its **standalone** version. This version doesn’t depend on Node.js. It only formats the code and has no support for config files, ignore files, CLI usage, or automatic loading of plugins. The standalone version comes as: @@ -14,42 +14,18 @@ The [`browser` field](https://github.com/defunctzombie/package-browser-field-spe ### `prettier.format(code, options)` -Unlike the `format` function from the [main API](api.md#prettierformatsource--options), this function does not load plugins automatically, so a `plugins` property is required if you want to load [plugins](#plugins). Additionally, the parsers included in the Prettier package won’t be loaded automatically, so you need to load them as plugins before using them. +Required options: -See [Usage](#usage) below for examples. +- **[`parser`](options.md#parser) (or [`filepath`](options.md#file-path))**: One of these options has to be specified for Prettier to know which parser to use. -## Plugins +- **`plugins`**: Unlike the `format` function from the [Node.js-based API](api.md#prettierformatsource--options), this function doesn’t load plugins automatically. The `plugins` option is required because all the parsers included in the Prettier package come as plugins (for reasons of file size). These plugins are files named -All available plugins are files named `parser-*.js` in and `parser-*.mjs` in . + - `parser-*.js` in and + - `parser-*.mjs` in -If you want format embed code, you need load related plugins too, for example + You need to load the ones that you’re going to use and pass them to `prettier.format` using the `plugins` option. -```html - -``` - -the HTML code inside JavaScript code won't get formatted, because it requires `html` parser too, correct usage - -```html - -``` +See below for examples. ## Usage @@ -119,3 +95,40 @@ prettier.format("type Query { hello: String }", { plugins: prettierPlugins, }); ``` + +## Parser plugins for embedded code + +If you want to format [embedded code](options.md#embedded-language-formatting), you need to load related plugins too. For example: + +```html + +``` + +The HTML code embedded in JavaScript stays unformatted because the `html` parser hasn’t been loaded. Correct usage: + +```html + +``` From 259d91d9abd1ee9c414e1f3be89bac37e21f7961 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Mar 2021 08:31:18 +0800 Subject: [PATCH 26/89] Build(deps): Bump @angular/compiler from 11.2.4 to 11.2.5 (#10534) Bumps [@angular/compiler](https://github.com/angular/angular/tree/HEAD/packages/compiler) from 11.2.4 to 11.2.5. - [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.2.5/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 dd56c4deb..aa2efb192 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "11.2.4", + "@angular/compiler": "11.2.5", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.9", "@glimmer/syntax": "0.77.1", diff --git a/yarn.lock b/yarn.lock index 0ac80a86a..37718fc95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/compiler@11.2.4": - version "11.2.4" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.4.tgz#613fcb59494d7b7eb8228b8c4fa3eac0b4ada5f7" - integrity sha512-2FXgkyJRWrULX3qyMhD6p16t/zAFCRI6+kHoRqfM5EzNKwPaUuSPIL8XAfr+xf0PbJ0Htkfb8jT1TtvctQW0Yw== +"@angular/compiler@11.2.5": + version "11.2.5" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.5.tgz#5d0aef6161484b6f8f67ff2fef10db5a631c7661" + integrity sha512-MrgZnTY6OPooDZw76wgj1ZM43IwwStsDfwuvYI8B7PR+QtPIwAkxi+spW78MHy3ltzsIQorC98pMiz7c7oTxDg== dependencies: tslib "^2.0.0" From 4fc2630c162e46d43cd374283a9a936d57805baf Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 15 Mar 2021 03:54:59 +0200 Subject: [PATCH 27/89] Remove stale plugins from home page and docs (#10538) --- docs/plugins.md | 2 -- website/data/languages.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index e7770bf13..52b710b82 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -40,7 +40,6 @@ Providing at least one path to `--plugin-search-dir`/`pluginSearchDirs` turns of - [`@prettier/plugin-php`](https://github.com/prettier/plugin-php) - [`@prettier/plugin-pug`](https://github.com/prettier/plugin-pug) by [**@Shinigami92**](https://github.com/Shinigami92) - [`@prettier/plugin-ruby`](https://github.com/prettier/plugin-ruby) -- [`@prettier/plugin-swift`](https://github.com/prettier/plugin-swift) - [`@prettier/plugin-xml`](https://github.com/prettier/plugin-xml) ## Community Plugins @@ -50,7 +49,6 @@ Providing at least one path to `--plugin-search-dir`/`pluginSearchDirs` turns of - [`prettier-plugin-go-template`](https://github.com/NiklasPor/prettier-plugin-go-template) by [**@NiklasPor**](https://github.com/NiklasPor) - [`prettier-plugin-java`](https://github.com/jhipster/prettier-java) by [**@JHipster**](https://github.com/jhipster) - [`prettier-plugin-kotlin`](https://github.com/Angry-Potato/prettier-plugin-kotlin) by [**@Angry-Potato**](https://github.com/Angry-Potato) -- [`prettier-plugin-pg`](https://github.com/benjie/prettier-plugin-pg) by [**@benjie**](https://github.com/benjie) - [`prettier-plugin-properties`](https://github.com/eemeli/prettier-plugin-properties) by [**@eemeli**](https://github.com/eemeli) - [`prettier-plugin-solidity`](https://github.com/prettier-solidity/prettier-plugin-solidity) by [**@mattiaerre**](https://github.com/mattiaerre) - [`prettier-plugin-svelte`](https://github.com/UnwrittenFun/prettier-plugin-svelte) by [**@UnwrittenFun**](https://github.com/UnwrittenFun) diff --git a/website/data/languages.yml b/website/data/languages.yml index 55281059b..b301531da 100644 --- a/website/data/languages.yml +++ b/website/data/languages.yml @@ -46,8 +46,6 @@ - "[Elm](https://github.com/gicentre/prettier-plugin-elm) (via [`elm-format`](https://github.com/avh4/elm-format))" - "[Java](https://github.com/jhipster/prettier-java)" - "[PHP](https://github.com/prettier/plugin-php)" - - "[PostgreSQL](https://github.com/benjie/prettier-plugin-pg-sql/)" - "[Ruby](https://github.com/prettier/plugin-ruby)" - - "[Swift](https://github.com/prettier/plugin-swift)" - "[TOML](https://github.com/bd82/toml-tools/tree/master/packages/prettier-plugin-toml)" - "[XML](https://github.com/prettier/plugin-xml)" From 521b63bb2754291a0612c315022a2012375e61e3 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 15 Mar 2021 11:04:12 +0800 Subject: [PATCH 28/89] Update `no-identifier-n` rule (#10540) --- .../no-identifier-n.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js index 373ab6820..56e197e80 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-identifier-n.js @@ -4,7 +4,7 @@ const { findVariable } = require("eslint-utils"); const ERROR = "error"; const SUGGESTION = "suggestion"; -const selectors = [ +const selector = [ "Identifier", '[name="n"]', `:not(${[ @@ -29,7 +29,7 @@ module.exports = { create(context) { const variables = new Map(); return { - [selectors](node) { + [selector](node) { const scope = context.getScope(); const variable = findVariable(scope, node); @@ -88,8 +88,4 @@ module.exports = { }, }; }, - schema: { - type: "array", - uniqueItems: true, - }, }; From 863eb079dc0aa6478b24842f69bef2b99408c948 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 15 Mar 2021 17:20:27 +0800 Subject: [PATCH 29/89] Forbid `AstPath.call` without name (#10541) --- .eslintrc.yml | 1 + .../index.js | 1 + .../no-unnecessary-ast-path-call.js | 57 +++++++++++++++++++ .../test.js | 25 ++++++++ src/language-css/printer-postcss.js | 4 +- src/language-graphql/printer-graphql.js | 2 +- src/language-js/print/binaryish.js | 2 +- src/language-js/print/call-arguments.js | 4 +- src/language-js/print/function-parameters.js | 2 +- src/language-js/print/function.js | 4 +- src/language-js/print/member-chain.js | 2 +- src/language-js/print/type-annotation.js | 2 +- src/language-js/printer-estree.js | 2 +- src/language-markdown/printer-markdown.js | 14 ++--- 14 files changed, 103 insertions(+), 19 deletions(-) create mode 100644 scripts/tools/eslint-plugin-prettier-internal-rules/no-unnecessary-ast-path-call.js diff --git a/.eslintrc.yml b/.eslintrc.yml index 743225ce4..d2436dc52 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -121,6 +121,7 @@ overrides: prettier-internal-rules/flat-ast-path-call: error prettier-internal-rules/no-doc-builder-concat: error prettier-internal-rules/no-empty-flat-contents-for-if-break: error + prettier-internal-rules/no-unnecessary-ast-path-call: error prettier-internal-rules/prefer-ast-path-each: error prettier-internal-rules/prefer-indent-if-break: error prettier-internal-rules/prefer-is-non-empty-array: error diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js index 37cf78b1e..9989800f6 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js @@ -10,6 +10,7 @@ module.exports = { "no-empty-flat-contents-for-if-break": require("./no-empty-flat-contents-for-if-break"), "no-identifier-n": require("./no-identifier-n"), "no-node-comments": require("./no-node-comments"), + "no-unnecessary-ast-path-call": require("./no-unnecessary-ast-path-call"), "prefer-ast-path-each": require("./prefer-ast-path-each"), "prefer-indent-if-break": require("./prefer-indent-if-break"), "prefer-is-non-empty-array": require("./prefer-is-non-empty-array"), diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/no-unnecessary-ast-path-call.js b/scripts/tools/eslint-plugin-prettier-internal-rules/no-unnecessary-ast-path-call.js new file mode 100644 index 000000000..4596e9891 --- /dev/null +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/no-unnecessary-ast-path-call.js @@ -0,0 +1,57 @@ +"use strict"; + +const selector = [ + "CallExpression", + "[optional=false]", + '[callee.type="MemberExpression"]', + "[callee.computed=false]", + "[callee.optional=false]", + '[callee.property.type="Identifier"]', + '[callee.property.name="call"]', + "[arguments.length=1]", + '[arguments.0.type!="SpreadElement"]', +].join(""); + +const messageId = "no-unnecessary-ast-path-call"; + +module.exports = { + meta: { + type: "suggestion", + docs: { + url: + "https://github.com/prettier/prettier/blob/main/scripts/eslint-plugin-prettier-internal-rules/no-unnecessary-ast-path-call.js", + }, + messages: { + [messageId]: "Do not use `AstPath.call()` with one argument.", + }, + fixable: "code", + }, + create(context) { + const sourceCode = context.getSourceCode(); + + return { + [selector](node) { + const problem = { + node, + messageId, + }; + + const [callback] = node.arguments; + + // Don't fix to IIFE + if ( + callback.type !== "ArrowFunctionExpression" && + callback.type !== "FunctionExpression" + ) { + problem.fix = function (fixer) { + const callbackText = sourceCode.getText(callback); + const astPathText = sourceCode.getText(node.callee.object); + return fixer.replaceText(node, `${callbackText}(${astPathText})`); + }; + } + + context.report(problem); + }, + }; + }, +}; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js index 12d778a05..6dfd77e86 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js @@ -367,3 +367,28 @@ test("no-empty-flat-contents-for-if-break", { }, ], }); + +test("no-unnecessary-ast-path-call", { + valid: [ + "call(foo)", + 'foo["call"](bar)', + "foo.call?.(bar)", + "foo?.call(bar)", + "foo.call(bar, name)", + "foo.notCall(bar)", + "foo.call(...bar)", + "foo.call()", + ], + invalid: [ + { + code: "foo.call(bar)", + output: "bar(foo)", + errors: 1, + }, + { + code: "foo.call(() => bar)", + output: "foo.call(() => bar)", + errors: 1, + }, + ], +}); diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js index 971bd3160..9465784ac 100644 --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -311,7 +311,7 @@ function genericPrint(path, options, print) { if (node.type === "media-query" && node.value === "") { return; } - parts.push(childPath.call(print)); + parts.push(print(childPath)); }, "nodes"); return group(indent(join(line, parts))); @@ -988,7 +988,7 @@ function printNodeSequence(path, options, print) { options.originalText.slice(locStart(childNode), locEnd(childNode)) ); } else { - parts.push(pathChild.call(print)); + parts.push(print(pathChild)); } if (i !== nodes.length - 1) { diff --git a/src/language-graphql/printer-graphql.js b/src/language-graphql/printer-graphql.js index 8ecf9e6e1..a8bee421f 100644 --- a/src/language-graphql/printer-graphql.js +++ b/src/language-graphql/printer-graphql.js @@ -21,7 +21,7 @@ function genericPrint(path, options, print) { case "Document": { const parts = []; path.each((pathChild, index, definitions) => { - parts.push(pathChild.call(print)); + parts.push(print(pathChild)); if (index !== definitions.length - 1) { parts.push(hardline); if ( diff --git a/src/language-js/print/binaryish.js b/src/language-js/print/binaryish.js index 2554970dc..01848d327 100644 --- a/src/language-js/print/binaryish.js +++ b/src/language-js/print/binaryish.js @@ -285,7 +285,7 @@ function printBinaryishExpressions( } } else { // Our stopping case. Simply print the node normally. - parts.push(group(path.call(print))); + parts.push(group(print(path))); } return parts; diff --git a/src/language-js/print/call-arguments.js b/src/language-js/print/call-arguments.js index c843bf5ee..77e5aa492 100644 --- a/src/language-js/print/call-arguments.js +++ b/src/language-js/print/call-arguments.js @@ -150,7 +150,7 @@ function printCallArguments(path, options, print) { if (shouldGroupFirst && i === 0) { printedExpanded = [ [ - argPath.call((p) => print(p, { expandFirstArg: true })), + print(argPath, { expandFirstArg: true }), printedArguments.length > 1 ? "," : "", hasEmptyLineFollowingFirstArg ? hardline : line, hasEmptyLineFollowingFirstArg ? hardline : "", @@ -161,7 +161,7 @@ function printCallArguments(path, options, print) { if (shouldGroupLast && i === args.length - 1) { printedExpanded = [ ...printedArguments.slice(0, -1), - argPath.call((p) => print(p, { expandLastArg: true })), + print(argPath, { expandLastArg: true }), ]; } }); diff --git a/src/language-js/print/function-parameters.js b/src/language-js/print/function-parameters.js index 7a5b0150d..d8a6e3c17 100644 --- a/src/language-js/print/function-parameters.js +++ b/src/language-js/print/function-parameters.js @@ -65,7 +65,7 @@ function printFunctionParameters( if (isLastParameter && functionNode.rest) { printed.push("..."); } - printed.push(parameterPath.call(print)); + printed.push(print(parameterPath)); if (isLastParameter) { return; } diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js index 6240c7e5c..27542fea4 100644 --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -250,7 +250,7 @@ function printArrowFunctionExpression(path, options, print, args) { let body; let chainShouldBreak = false; - path.call(function rec(path) { + (function rec(path) { const doc = printArrowFunctionSignature(path, options, print, args); signatures.push( signatures.length === 0 ? doc : printComments(path, doc, options) @@ -272,7 +272,7 @@ function printArrowFunctionExpression(path, options, print, args) { node = node.body; path.call(rec, "body"); } - }); + })(path); if (signatures.length > 1) { return printArrowChain( diff --git a/src/language-js/print/member-chain.js b/src/language-js/print/member-chain.js index 81e9f565a..43963f394 100644 --- a/src/language-js/print/member-chain.js +++ b/src/language-js/print/member-chain.js @@ -135,7 +135,7 @@ function printMemberChain(path, options, print) { } else { printedNodes.unshift({ node, - printed: path.call(print), + printed: print(path), }); } } diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js index 5761d9ee8..0b8972dfa 100644 --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -169,7 +169,7 @@ function printUnionType(path, options, print) { // // comment // | child2 const printed = path.map((typePath) => { - let printedType = typePath.call(print); + let printedType = print(typePath); if (!shouldHug) { printedType = align(2, printedType); } diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 7fb5c6905..29ab70c91 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -702,7 +702,7 @@ function printPathNoParens(path, options, print, args) { path.map((casePath, index, cases) => { const caseNode = casePath.getValue(); return [ - casePath.call(print), + print(casePath), index !== cases.length - 1 && isNextLineEmpty(caseNode, options) ? hardline diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index b67adb16a..b1f2f8d06 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -411,8 +411,8 @@ function genericPrint(path, options, print) { printChildren(path, options, print, { processor: (childPath, index) => index === 0 - ? group([softline, childPath.call(print)]) - : childPath.call(print), + ? group([softline, print(childPath)]) + : print(childPath), }) ), nextNode && nextNode.type === "footnoteDefinition" @@ -469,13 +469,13 @@ function printListItem(path, options, print, listPrefix) { printChildren(path, options, print, { processor: (childPath, index) => { if (index === 0 && childPath.getValue().type !== "list") { - return align(" ".repeat(prefix.length), childPath.call(print)); + return align(" ".repeat(prefix.length), print(childPath)); } const alignment = " ".repeat( clamp(options.tabWidth - listPrefix.length, 0, 3) // 4+ will cause indented code block ); - return [alignment, align(alignment, childPath.call(print))]; + return [alignment, align(alignment, print(childPath))]; }, }), ]; @@ -565,7 +565,7 @@ function printTable(path, options, print) { const contents = path.map( (rowPath) => rowPath.map((cellPath, columnIndex) => { - const text = printDocToString(cellPath.call(print), options).formatted; + const text = printDocToString(print(cellPath), options).formatted; const width = getStringWidth(text); columnMaxWidths[columnIndex] = Math.max( columnMaxWidths[columnIndex] || 3, // minimum width = 3 (---, :--, :-:, --:) @@ -691,14 +691,14 @@ function printRoot(path, options, print) { } } - return childPath.call(print); + return print(childPath); }, }); } function printChildren(path, options, print, events = {}) { const { postprocessor } = events; - const processor = events.processor || ((childPath) => childPath.call(print)); + const processor = events.processor || ((childPath) => print(childPath)); const node = path.getValue(); const parts = []; From 72fcf45df3151fab4e5c20c50579c7fcd3d9d6f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 04:07:53 +0000 Subject: [PATCH 30/89] Build(deps): Bump @babel/parser from 7.13.9 to 7.13.10 (#10523) --- package.json | 2 +- .../babel-ts/__snapshots__/jsfmt.spec.js.snap | 17 ++++++++++ .../errors/typescript/babel-ts/abstract.ts | 3 ++ .../classAbstractMethodWithImplementation.ts | 0 .../errors/typescript/babel-ts/jsfmt.spec.js | 1 + .../__snapshots__/jsfmt.spec.js.snap | 2 -- .../invalid-modifiers.ts | 1 - .../__snapshots__/jsfmt.spec.js.snap | 31 ------------------- .../classAbstractAccessor.ts | 2 -- .../classAbstractMethodInNonAbstractClass.ts | 4 --- yarn.lock | 7 +---- 11 files changed, 23 insertions(+), 47 deletions(-) create mode 100644 tests/misc/errors/typescript/babel-ts/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/typescript/babel-ts/abstract.ts rename tests/{typescript/conformance/classes/classDeclarations/classAbstractKeyword => misc/errors/typescript/babel-ts}/classAbstractMethodWithImplementation.ts (100%) create mode 100644 tests/misc/errors/typescript/babel-ts/jsfmt.spec.js diff --git a/package.json b/package.json index aa2efb192..0316e2864 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@angular/compiler": "11.2.5", "@babel/code-frame": "7.12.13", - "@babel/parser": "7.13.9", + "@babel/parser": "7.13.10", "@glimmer/syntax": "0.77.1", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.16.1", diff --git a/tests/misc/errors/typescript/babel-ts/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/typescript/babel-ts/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..68018f13d --- /dev/null +++ b/tests/misc/errors/typescript/babel-ts/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,17 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`abstract.ts [babel-ts] format 1`] = ` +"Method 'foo' cannot have an implementation because it is marked abstract. (2:5) + 1 | class A { +> 2 | abstract foo() {} + | ^ + 3 | }" +`; + +exports[`classAbstractMethodWithImplementation.ts [babel-ts] format 1`] = ` +"Method 'foo' cannot have an implementation because it is marked abstract. (2:5) + 1 | abstract class A { +> 2 | abstract foo() {} + | ^ + 3 | }" +`; diff --git a/tests/misc/errors/typescript/babel-ts/abstract.ts b/tests/misc/errors/typescript/babel-ts/abstract.ts new file mode 100644 index 000000000..3dca2625d --- /dev/null +++ b/tests/misc/errors/typescript/babel-ts/abstract.ts @@ -0,0 +1,3 @@ +class A { + abstract foo() {} +} \ No newline at end of file diff --git a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodWithImplementation.ts b/tests/misc/errors/typescript/babel-ts/classAbstractMethodWithImplementation.ts similarity index 100% rename from tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodWithImplementation.ts rename to tests/misc/errors/typescript/babel-ts/classAbstractMethodWithImplementation.ts diff --git a/tests/misc/errors/typescript/babel-ts/jsfmt.spec.js b/tests/misc/errors/typescript/babel-ts/jsfmt.spec.js new file mode 100644 index 000000000..a969baea5 --- /dev/null +++ b/tests/misc/errors/typescript/babel-ts/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["babel-ts"]); diff --git a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap index d5e87823f..45f2edd13 100644 --- a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap @@ -38,7 +38,6 @@ interface Foo { class Bar { declare e() {}; - abstract f() {}; readonly g() {}; } @@ -55,7 +54,6 @@ interface Foo { class Bar { declare e() {} - abstract f() {} readonly g() {} } diff --git a/tests/misc/typescript-babel-only/invalid-modifiers.ts b/tests/misc/typescript-babel-only/invalid-modifiers.ts index 440e6268d..97fbbb1e8 100644 --- a/tests/misc/typescript-babel-only/invalid-modifiers.ts +++ b/tests/misc/typescript-babel-only/invalid-modifiers.ts @@ -10,6 +10,5 @@ interface Foo { class Bar { declare e() {}; - abstract f() {}; readonly g() {}; } diff --git a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/__snapshots__/jsfmt.spec.js.snap index c2035fc91..a335ac33d 100644 --- a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/__snapshots__/jsfmt.spec.js.snap @@ -9,19 +9,13 @@ printWidth: 80 abstract class A { abstract get a(); - abstract get aa() { return 1; } abstract set b(x: string); - abstract set bb(x: string) {} } =====================================output===================================== abstract class A { abstract get a(); - abstract get aa() { - return 1; - } abstract set b(x: string); - abstract set bb(x: string) {} } ================================================================================ @@ -600,36 +594,11 @@ printWidth: 80 class A { abstract foo(); } - -class B { - abstract foo() {} -} =====================================output===================================== class A { abstract foo(); } -class B { - abstract foo() {} -} - -================================================================================ -`; - -exports[`classAbstractMethodWithImplementation.ts format 1`] = ` -====================================options===================================== -parsers: ["typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -abstract class A { - abstract foo() {} -} -=====================================output===================================== -abstract class A { - abstract foo() {} -} - ================================================================================ `; diff --git a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts index dce14fb3a..19f6592c3 100644 --- a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts +++ b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractAccessor.ts @@ -1,7 +1,5 @@ abstract class A { abstract get a(); - abstract get aa() { return 1; } abstract set b(x: string); - abstract set bb(x: string) {} } diff --git a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodInNonAbstractClass.ts b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodInNonAbstractClass.ts index 68d0f5603..3eea2f5d6 100644 --- a/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodInNonAbstractClass.ts +++ b/tests/typescript/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractMethodInNonAbstractClass.ts @@ -1,7 +1,3 @@ class A { abstract foo(); -} - -class B { - abstract foo() {} } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 37718fc95..2e5d28910 100644 --- a/yarn.lock +++ b/yarn.lock @@ -283,12 +283,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.9": - version "7.13.9" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.9.tgz#ca34cb95e1c2dd126863a84465ae8ef66114be99" - integrity sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw== - -"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": +"@babel/parser@7.13.10", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": version "7.13.10" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.10.tgz#8f8f9bf7b3afa3eabd061f7a5bcdf4fec3c48409" integrity sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ== From f6b63e8807d3f13dbe34d6fb7c253ebf63a781a6 Mon Sep 17 00:00:00 2001 From: Cyrille David Date: Tue, 16 Mar 2021 10:25:06 +0100 Subject: [PATCH 31/89] Move Handlebars support out of alpha to release (#10290) Co-authored-by: Georgii Dolzhykov --- changelog_unreleased/handlebars/10290.md | 16 ++++++++++++++ scripts/draft-blog-post.js | 2 +- src/language-handlebars/index.js | 2 +- src/main/core-options.js | 6 +---- .../__snapshots__/early-exit.js.snap | 7 +++--- .../__snapshots__/help-options.js.snap | 3 ++- .../plugin-options-string.js.snap | 4 ++-- .../__snapshots__/plugin-options.js.snap | 7 +++--- .../__tests__/__snapshots__/schema.js.snap | 6 +++++ .../__snapshots__/support-info.js.snap | 22 +++++++++++++++++++ website/data/languages.yml | 1 + 11 files changed, 60 insertions(+), 16 deletions(-) create mode 100644 changelog_unreleased/handlebars/10290.md diff --git a/changelog_unreleased/handlebars/10290.md b/changelog_unreleased/handlebars/10290.md new file mode 100644 index 000000000..00bd2f97a --- /dev/null +++ b/changelog_unreleased/handlebars/10290.md @@ -0,0 +1,16 @@ +#### Move Handlebars support out of alpha to release (#10290 by @dcyriller & @thorn0) + +This started in 2017. Handlebars support has been in Prettier for a while, but it wasn’t released officially as it wasn’t really ready. Its status was “alpha”, “experimental”, “beta”. Then, if you checked older release notes, you could see that after “beta” somehow it was “alpha” again… + +Well, anyway, it finally is happening: Prettier can now officially format Handlebars files! 🎉 + +It uses [Glimmer], [Ember]’s Handlebars parser, so it should be compliant with the HTML spec thanks to the Ember team. + +The [`--html-whitespace-sensitivity`][hws-option] option is supported and defaults to `strict`, which means that Prettier will always respect the presence or absence of whitespace around tags and consider it unsafe to add whitespace where there were none and vice versa as this can affect how the document is rendered in the browser. The `css` value is not yet supported (treated as `strict` for now). + +The feature is called “Ember / Handlebars” and not just “Handlebars” because Glimmer doesn’t support some syntax and use cases of Handlebars. This is mostly due to the fact that [Handlebars], being a template engine (a preprocessor), doesn’t care about the underlying syntax of the content it processes whereas Glimmer parses two syntaxes – HTML and Handlebars – at the same time and combines the result into a single tree, which Prettier can print. This means Prettier won’t format Handlebars files that can’t be parsed into such a tree, either because the underlying syntax isn’t HTML or because template directives and tags overlap in a way that can’t be represented in a tree (e.g., `{{#if foo}}
{{/if}`). Even with these restrictions, the formatter still seems to be useful enough to non-Ember Handlebars users. + +[glimmer]: https://www.npmjs.com/package/@glimmer/syntax +[ember]: https://emberjs.com +[hws-option]: https://prettier.io/docs/en/options.html#html-whitespace-sensitivity +[handlebars]: https://handlebarsjs.com/ diff --git a/scripts/draft-blog-post.js b/scripts/draft-blog-post.js index eca419567..6654d5907 100644 --- a/scripts/draft-blog-post.js +++ b/scripts/draft-blog-post.js @@ -37,7 +37,7 @@ const categories = [ { dir: "vue", title: "Vue" }, { dir: "angular", title: "Angular" }, { dir: "lwc", title: "LWC" }, - { dir: "handlebars", title: "Handlebars (alpha)" }, + { dir: "handlebars", title: "Ember / Handlebars" }, { dir: "graphql", title: "GraphQL" }, { dir: "markdown", title: "Markdown" }, { dir: "mdx", title: "MDX" }, diff --git a/src/language-handlebars/index.js b/src/language-handlebars/index.js index 01e35dd96..04ca83ed1 100644 --- a/src/language-handlebars/index.js +++ b/src/language-handlebars/index.js @@ -5,7 +5,7 @@ const printer = require("./printer-glimmer"); const languages = [ createLanguage(require("linguist-languages/data/Handlebars.json"), () => ({ - since: null, // unreleased + since: "2.3.0", parsers: ["glimmer"], vscodeLanguageIds: ["handlebars"], })), diff --git a/src/main/core-options.js b/src/main/core-options.js index 8f192daa4..e8356a8c1 100644 --- a/src/main/core-options.js +++ b/src/main/core-options.js @@ -146,11 +146,7 @@ const options = { { value: "mdx", since: "1.15.0", description: "MDX" }, { value: "vue", since: "1.10.0", description: "Vue" }, { value: "yaml", since: "1.14.0", description: "YAML" }, - { - value: "glimmer", - since: null, - description: "Handlebars", - }, + { value: "glimmer", since: "2.3.0", description: "Ember / Handlebars" }, { value: "html", since: "1.15.0", description: "HTML" }, { value: "angular", since: "1.15.0", description: "Angular" }, { diff --git a/tests_integration/__tests__/__snapshots__/early-exit.js.snap b/tests_integration/__tests__/__snapshots__/early-exit.js.snap index 932fd54c1..832a1af9f 100644 --- a/tests_integration/__tests__/__snapshots__/early-exit.js.snap +++ b/tests_integration/__tests__/__snapshots__/early-exit.js.snap @@ -84,7 +84,7 @@ Format options: Defaults to false. --jsx-single-quote Use single quotes in JSX. Defaults to false. - --parser + --parser Which parser to use. --print-width The line length where Prettier will try wrap. Defaults to 80. @@ -182,7 +182,7 @@ exports[`show warning with --help not-found (typo) (stderr) 1`] = ` `; exports[`show warning with --help not-found (typo) (stdout) 1`] = ` -"--parser +"--parser Which parser to use. @@ -206,6 +206,7 @@ Valid options: mdx MDX vue Vue yaml YAML + glimmer Ember / Handlebars html HTML angular Angular lwc Lightning Web Components @@ -248,7 +249,7 @@ Format options: Defaults to false. --jsx-single-quote Use single quotes in JSX. Defaults to false. - --parser + --parser Which parser to use. --print-width The line length where Prettier will try wrap. Defaults to 80. diff --git a/tests_integration/__tests__/__snapshots__/help-options.js.snap b/tests_integration/__tests__/__snapshots__/help-options.js.snap index c98b0f62d..0d8680b47 100644 --- a/tests_integration/__tests__/__snapshots__/help-options.js.snap +++ b/tests_integration/__tests__/__snapshots__/help-options.js.snap @@ -372,7 +372,7 @@ exports[`show detailed usage with --help no-semi (write) 1`] = `Array []`; exports[`show detailed usage with --help parser (stderr) 1`] = `""`; exports[`show detailed usage with --help parser (stdout) 1`] = ` -"--parser +"--parser Which parser to use. @@ -396,6 +396,7 @@ Valid options: mdx MDX vue Vue yaml YAML + glimmer Ember / Handlebars html HTML angular Angular lwc Lightning Web Components diff --git a/tests_integration/__tests__/__snapshots__/plugin-options-string.js.snap b/tests_integration/__tests__/__snapshots__/plugin-options-string.js.snap index a26fe7ba3..df76a8fa3 100644 --- a/tests_integration/__tests__/__snapshots__/plugin-options-string.js.snap +++ b/tests_integration/__tests__/__snapshots__/plugin-options-string.js.snap @@ -20,8 +20,8 @@ exports[` 1`] = ` Defaults to false. --jsx-single-quote Use single quotes in JSX. Defaults to false. -- --parser -+ --parser +- --parser ++ --parser Which parser to use. --print-width The line length where Prettier will try wrap. Defaults to 80. diff --git a/tests_integration/__tests__/__snapshots__/plugin-options.js.snap b/tests_integration/__tests__/__snapshots__/plugin-options.js.snap index 37d71257b..93d8477e5 100644 --- a/tests_integration/__tests__/__snapshots__/plugin-options.js.snap +++ b/tests_integration/__tests__/__snapshots__/plugin-options.js.snap @@ -20,8 +20,8 @@ exports[` 1`] = ` Defaults to false. --jsx-single-quote Use single quotes in JSX. Defaults to false. -- --parser -+ --parser +- --parser ++ --parser Which parser to use. --print-width The line length where Prettier will try wrap. Defaults to 80. @@ -32,7 +32,7 @@ exports[` 1`] = ` exports[`include plugin's parsers to the values of the \`parser\` option\` (stderr) 1`] = `""`; exports[`include plugin's parsers to the values of the \`parser\` option\` (stdout) 1`] = ` -"--parser +"--parser Which parser to use. @@ -56,6 +56,7 @@ Valid options: mdx MDX vue Vue yaml YAML + glimmer Ember / Handlebars html HTML angular Angular lwc Lightning Web Components diff --git a/tests_integration/__tests__/__snapshots__/schema.js.snap b/tests_integration/__tests__/__snapshots__/schema.js.snap index 337ebad5d..9ff912718 100644 --- a/tests_integration/__tests__/__snapshots__/schema.js.snap +++ b/tests_integration/__tests__/__snapshots__/schema.js.snap @@ -240,6 +240,12 @@ This option cannot be used with --range-start and --range-end.", "yaml", ], }, + Object { + "description": "Ember / Handlebars", + "enum": Array [ + "glimmer", + ], + }, Object { "description": "HTML", "enum": Array [ diff --git a/tests_integration/__tests__/__snapshots__/support-info.js.snap b/tests_integration/__tests__/__snapshots__/support-info.js.snap index a3b3bdef9..00004e910 100644 --- a/tests_integration/__tests__/__snapshots__/support-info.js.snap +++ b/tests_integration/__tests__/__snapshots__/support-info.js.snap @@ -19,6 +19,9 @@ Object { "HTML": Array [ "html", ], + "Handlebars": Array [ + "glimmer", + ], "JSON": Array [ "json", ], @@ -167,6 +170,7 @@ Object { "mdx", "vue", "yaml", + "glimmer", "html", "angular", "lwc", @@ -578,6 +582,19 @@ exports[`CLI --support-info (stdout) 1`] = ` \\"type\\": \\"markup\\", \\"vscodeLanguageIds\\": [\\"scss\\"] }, + { + \\"aceMode\\": \\"handlebars\\", + \\"aliases\\": [\\"hbs\\", \\"htmlbars\\"], + \\"color\\": \\"#f7931e\\", + \\"extensions\\": [\\".handlebars\\", \\".hbs\\"], + \\"linguistLanguageId\\": 155, + \\"name\\": \\"Handlebars\\", + \\"parsers\\": [\\"glimmer\\"], + \\"since\\": \\"2.3.0\\", + \\"tmScope\\": \\"text.html.handlebars\\", + \\"type\\": \\"markup\\", + \\"vscodeLanguageIds\\": [\\"handlebars\\"] + }, { \\"aceMode\\": \\"text\\", \\"color\\": \\"#e10098\\", @@ -910,6 +927,11 @@ exports[`CLI --support-info (stdout) 1`] = ` { \\"description\\": \\"MDX\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"mdx\\" }, { \\"description\\": \\"Vue\\", \\"since\\": \\"1.10.0\\", \\"value\\": \\"vue\\" }, { \\"description\\": \\"YAML\\", \\"since\\": \\"1.14.0\\", \\"value\\": \\"yaml\\" }, + { + \\"description\\": \\"Ember / Handlebars\\", + \\"since\\": \\"2.3.0\\", + \\"value\\": \\"glimmer\\" + }, { \\"description\\": \\"HTML\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"html\\" }, { \\"description\\": \\"Angular\\", \\"since\\": \\"1.15.0\\", \\"value\\": \\"angular\\" }, { diff --git a/website/data/languages.yml b/website/data/languages.yml index b301531da..f7026c70a 100644 --- a/website/data/languages.yml +++ b/website/data/languages.yml @@ -12,6 +12,7 @@ variants: - "[Vue](https://vuejs.org)" - "[Angular](https://angular.io)" + - "[Ember / Handlebars](https://emberjs.com)" - name: CSS showName: true image: /images/languages/tools_css.svg From 68fd9db7d0619bb1979387d3ade037e217a29332 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 16 Mar 2021 15:05:15 +0200 Subject: [PATCH 32/89] Fix Prettier 2.0 blog post --- website/blog/2020-03-21-2.0.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/blog/2020-03-21-2.0.0.md b/website/blog/2020-03-21-2.0.0.md index 08a65e26c..7ade3ab9c 100644 --- a/website/blog/2020-03-21-2.0.0.md +++ b/website/blog/2020-03-21-2.0.0.md @@ -1453,6 +1453,7 @@ prop="My Text">
and + ```hbs {{!-- Input --}}
From 13744dffa20725d2651eba0d89add891d98d309a Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 16 Mar 2021 15:51:03 +0200 Subject: [PATCH 33/89] Fix edge case with trailing comments in arrow chains (#10543) * Fix edge case with trailing comments in arrow chains * Remove handling of args.needsSemi from printComments --- changelog_unreleased/javascript/9992.md | 2 +- src/language-js/print/function.js | 22 ++++-- src/language-js/printer-estree.js | 6 +- src/main/ast-to-doc.js | 2 +- src/main/comments.js | 38 ++++++---- .../arrows/__snapshots__/jsfmt.spec.js.snap | 76 +++++++++++++++++++ .../arrow-chain-with-trailing-comments.js | 9 +++ 7 files changed, 128 insertions(+), 27 deletions(-) create mode 100644 tests/js/arrows/arrow-chain-with-trailing-comments.js diff --git a/changelog_unreleased/javascript/9992.md b/changelog_unreleased/javascript/9992.md index 73ab6c7bd..58b7d9633 100644 --- a/changelog_unreleased/javascript/9992.md +++ b/changelog_unreleased/javascript/9992.md @@ -1,4 +1,4 @@ -#### Refine formatting of curried arrow functions (#9992 by @sosukesuzuki and @thorn0) +#### Refine formatting of curried arrow functions (#9992, #10543 by @sosukesuzuki & @thorn0) ```js diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js index 27542fea4..83548b2e8 100644 --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -1,8 +1,13 @@ "use strict"; +/** @typedef {import("../../document/doc-builders").Doc} Doc */ + /** @type {import("assert")} */ const assert = require("assert"); -const { printDanglingComments, printComments } = require("../../main/comments"); +const { + printDanglingComments, + printCommentsSeparately, +} = require("../../main/comments"); const { getNextNonSpaceNonCommentCharacterIndex, } = require("../../common/util"); @@ -246,15 +251,20 @@ function printArrowChain( function printArrowFunctionExpression(path, options, print, args) { let node = path.getValue(); + /** @type {Doc[]} */ const signatures = []; - let body; + const body = []; let chainShouldBreak = false; (function rec(path) { const doc = printArrowFunctionSignature(path, options, print, args); - signatures.push( - signatures.length === 0 ? doc : printComments(path, doc, options) - ); + if (signatures.length === 0) { + signatures.push(doc); + } else { + const { leading, trailing } = printCommentsSeparately(path, options); + signatures.push([leading, doc]); + body.unshift(trailing); + } chainShouldBreak = chainShouldBreak || @@ -267,7 +277,7 @@ function printArrowFunctionExpression(path, options, print, args) { node.body.type !== "ArrowFunctionExpression" || (args && args.expandLastArg) ) { - body = path.call((bodyPath) => print(bodyPath, args), "body"); + body.unshift(path.call((bodyPath) => print(bodyPath, args), "body")); } else { node = node.body; path.call(rec, "body"); diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 29ab70c91..f8503baf3 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -113,7 +113,7 @@ function genericPrint(path, options, print, args) { } const printedDecorators = printDecorators(path, options, print); - // Nodes with decorators can't have parentheses + // Nodes with decorators can't have parentheses and don't need leading semicolons if (printedDecorators) { return group([...printedDecorators, printed]); } @@ -121,10 +121,10 @@ function genericPrint(path, options, print, args) { const needsParens = pathNeedsParens(path, options); if (!needsParens) { - return printed; + return args && args.needsSemi ? [";", printed] : printed; } - const parts = ["(", printed]; + const parts = [args && args.needsSemi ? ";(" : "(", printed]; if (hasFlowShorthandAnnotationComment(node)) { const [comment] = node.trailingComments; diff --git a/src/main/ast-to-doc.js b/src/main/ast-to-doc.js index b4dde2be0..366628086 100644 --- a/src/main/ast-to-doc.js +++ b/src/main/ast-to-doc.js @@ -57,7 +57,7 @@ function printAstToDoc(ast, options, alignmentSize = 0) { ) { // printComments will call the plugin print function and check for // comments to print - doc = printComments(path, doc, options, args && args.needsSemi); + doc = printComments(path, doc, options); } if (shouldCache) { diff --git a/src/main/comments.js b/src/main/comments.js index 7459ae2e4..17e652396 100644 --- a/src/main/comments.js +++ b/src/main/comments.js @@ -540,23 +540,18 @@ function printDanglingComments(path, options, sameIndent, filter) { return indent([hardline, join(hardline, parts)]); } -function prependCursorPlaceholder(path, options, printed) { - if (path.getNode() === options.cursorNode && path.getValue()) { - return [cursor, printed, cursor]; - } - return printed; -} - -function printComments(path, printed, options, needsSemi) { +function printCommentsSeparately(path, options) { const value = path.getValue(); - const comments = value && value.comments; + const hasComments = isNonEmptyArray(value && value.comments); + const isCursorNode = Boolean(value && value === options.cursorNode); - if (!isNonEmptyArray(comments)) { - return prependCursorPlaceholder(path, options, printed); + if (!hasComments) { + const maybeCursor = isCursorNode ? cursor : ""; + return { leading: maybeCursor, trailing: maybeCursor }; } const leadingParts = []; - const trailingParts = [needsSemi ? ";" : "", printed]; + const trailingParts = []; path.each((commentPath) => { const comment = commentPath.getValue(); @@ -583,10 +578,20 @@ function printComments(path, printed, options, needsSemi) { } }, "comments"); - return prependCursorPlaceholder(path, options, [ - ...leadingParts, - ...trailingParts, - ]); + if (isCursorNode) { + leadingParts.unshift(cursor); + trailingParts.push(cursor); + } + + return { leading: leadingParts, trailing: trailingParts }; +} + +function printComments(path, doc, options) { + const { leading, trailing } = printCommentsSeparately(path, options); + if (!leading && !trailing) { + return doc; + } + return [leading, doc, trailing]; } function ensureAllCommentsPrinted(astComments) { @@ -609,6 +614,7 @@ function ensureAllCommentsPrinted(astComments) { module.exports = { attach, printComments, + printCommentsSeparately, printDanglingComments, getSortedChildNodes, ensureAllCommentsPrinted, diff --git a/tests/js/arrows/__snapshots__/jsfmt.spec.js.snap b/tests/js/arrows/__snapshots__/jsfmt.spec.js.snap index 9f3185e4d..8af63ba70 100644 --- a/tests/js/arrows/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/arrows/__snapshots__/jsfmt.spec.js.snap @@ -164,6 +164,82 @@ a = b => { ================================================================================ `; +exports[`arrow-chain-with-trailing-comments.js - {"arrowParens":"always"} format 1`] = ` +====================================options===================================== +arrowParens: "always" +parsers: ["babel", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +x = (bifornCringerMoshedPerplexSawder) => ((askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => (f00) => { + averredBathersBoxroomBuggyNurl(); +} // BOOM +) + +x2 = (a) => ((askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askTrovenaBeenaDependsRowans3) => { + c(); +} /* ! */ // KABOOM +) + +=====================================output===================================== +x = + (bifornCringerMoshedPerplexSawder) => + (askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => + (f00) => { + averredBathersBoxroomBuggyNurl(); + }; // BOOM + +x2 = + (a) => + ( + askTrovenaBeenaDependsRowans1, + askTrovenaBeenaDependsRowans2, + askTrovenaBeenaDependsRowans3 + ) => { + c(); + } /* ! */; // KABOOM + +================================================================================ +`; + +exports[`arrow-chain-with-trailing-comments.js - {"arrowParens":"avoid"} format 1`] = ` +====================================options===================================== +arrowParens: "avoid" +parsers: ["babel", "typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +x = (bifornCringerMoshedPerplexSawder) => ((askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => (f00) => { + averredBathersBoxroomBuggyNurl(); +} // BOOM +) + +x2 = (a) => ((askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askTrovenaBeenaDependsRowans3) => { + c(); +} /* ! */ // KABOOM +) + +=====================================output===================================== +x = + bifornCringerMoshedPerplexSawder => + (askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => + f00 => { + averredBathersBoxroomBuggyNurl(); + }; // BOOM + +x2 = + a => + ( + askTrovenaBeenaDependsRowans1, + askTrovenaBeenaDependsRowans2, + askTrovenaBeenaDependsRowans3 + ) => { + c(); + } /* ! */; // KABOOM + +================================================================================ +`; + exports[`assignment-chain-with-arrow-chain.js - {"arrowParens":"always"} format 1`] = ` ====================================options===================================== arrowParens: "always" diff --git a/tests/js/arrows/arrow-chain-with-trailing-comments.js b/tests/js/arrows/arrow-chain-with-trailing-comments.js new file mode 100644 index 000000000..e5fc47736 --- /dev/null +++ b/tests/js/arrows/arrow-chain-with-trailing-comments.js @@ -0,0 +1,9 @@ +x = (bifornCringerMoshedPerplexSawder) => ((askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie) => (f00) => { + averredBathersBoxroomBuggyNurl(); +} // BOOM +) + +x2 = (a) => ((askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askTrovenaBeenaDependsRowans3) => { + c(); +} /* ! */ // KABOOM +) From 18a316bbaaeb1332c9e3e4362af1bded4ed074c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 15:24:36 +0000 Subject: [PATCH 34/89] Build(deps-dev): Bump webpack from 5.25.0 to 5.26.0 (#10545) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0316e2864..0b887eb55 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.25.0" + "webpack": "5.26.0" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 2e5d28910..f7422ac23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7092,10 +7092,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.25.0: - version "5.25.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.25.0.tgz#f9409977f0f3b6d4b9c4f73adc7d7cb9603a09e9" - integrity sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw== +webpack@5.26.0: + version "5.26.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.26.0.tgz#269841ed7b5c6522221aa27f7efceda04c8916d7" + integrity sha512-9kQATUOGQBkqzNKFmFON4KXZDsXnE7xk58tBxca8aCi+6/QhAbmWIvtGqBL66XIsBFpomFH0/0KyCaySo0ta2g== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From 527ff953544174f85f35cfada28879c875c5b25f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 15:32:20 +0000 Subject: [PATCH 35/89] Build(deps-dev): Bump @glimmer/reference from 0.77.1 to 0.77.2 (#10544) --- package.json | 2 +- yarn.lock | 50 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 0b887eb55..2e65b9f26 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "@babel/core": "7.13.10", "@babel/preset-env": "7.13.10", "@babel/types": "7.13.0", - "@glimmer/reference": "0.77.1", + "@glimmer/reference": "0.77.2", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.3.0", "@rollup/plugin-commonjs": "16.0.0", diff --git a/yarn.lock b/yarn.lock index f7422ac23..2d24da33b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1066,10 +1066,10 @@ resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= -"@glimmer/global-context@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.1.tgz#3af524269ee6de77ee1236f3650747774c026470" - integrity sha512-ncHfREo4zQC8XGFf1zQuQ+2T8THUIZtcGMm+Aj0k80TUb9PgE5oJPNeY7hhbYHJV531o5cuEX/SuTlCTrLm9wg== +"@glimmer/global-context@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.2.tgz#5c872a40eaec994c89a87df837d5a29cf05822c7" + integrity sha512-q6a6MVY2ibOPvPFC+1kQy70lZpOvOXZCBS3U0+z8r81WQbRsO9k89PlkXenrLqlpNdLO42SrbCd8ZcXrdO1COg== dependencies: "@glimmer/env" "^0.1.7" @@ -1080,16 +1080,23 @@ dependencies: "@simple-dom/interface" "^1.4.0" -"@glimmer/reference@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.1.tgz#2bf591a1766efb58361333fa66d30175c6090733" - integrity sha512-bqlO+kOzTLHs24OpPeJWk/D14TTJImntMxVDr9XWj4VLWlH3QRISPg6ArtrJdI30MBESXHdzScaAyv7c8rN6yA== +"@glimmer/interfaces@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.2.tgz#9e0f732439ac140d485d9c155ca9cc9ecfb73029" + integrity sha512-UUGjjlOYwKYe3jO81zyqKeMnLTtppP3vSRGaATx2+SKe0Ik5brHQY7FO7bWqdBP7QAHffzFHFhlWWYmu7Hu19A== + dependencies: + "@simple-dom/interface" "^1.4.0" + +"@glimmer/reference@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.2.tgz#760d3520294ddb2f833fbebc713205e3a3d6206a" + integrity sha512-ELEwShIOow0cIsgYXhkB9nmUzQh7YwoHosoMcTQJ1HOZ2OyuH9Cm9IVDICM1edEzLs9KiIcE9jatjDaFZZkx9g== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.1" - "@glimmer/interfaces" "0.77.1" - "@glimmer/util" "0.77.1" - "@glimmer/validator" "0.77.1" + "@glimmer/global-context" "0.77.2" + "@glimmer/interfaces" "0.77.2" + "@glimmer/util" "0.77.2" + "@glimmer/validator" "0.77.2" "@glimmer/syntax@0.77.1": version "0.77.1" @@ -1110,13 +1117,22 @@ "@glimmer/interfaces" "0.77.1" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.1.tgz#8ff2c2e2ef67db5b6e6f2a13586852f1150b6ca9" - integrity sha512-iGaSkBdcWQRxoEd2XFTH8jieKZBMwztIPP1/Y4Y62nArj+gQJjJb59c6t9uiUKxwGMURLBsyMY3+rrzVfFB7xQ== +"@glimmer/util@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.2.tgz#4673867c83a090c0eac501d07b1816ed7645709c" + integrity sha512-Q+jC1Rd1gywFsHyj1GWOQNLY20JOu63s0L8fsTUlXHkK/PIBENylnDG4phTrdSuPgeHexB6DzSRTWJPaLXB9+Q== + dependencies: + "@glimmer/env" "0.1.7" + "@glimmer/interfaces" "0.77.2" + "@simple-dom/interface" "^1.4.0" + +"@glimmer/validator@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.2.tgz#2d1fe44671c888be1cb43bbbe7c5b5a79d320a79" + integrity sha512-BNPut4s9Vj61PvJLkiv8GvRiYnM1CKSViUvTgXy+x6SIL3Y/XCUAecos3pFSmeEFPb2uevK4mzex5GlX/fQ+ug== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.1" + "@glimmer/global-context" "0.77.2" "@handlebars/parser@^2.0.0": version "2.1.0" From 770ed280cfc074aca8f3801e202fdfabf10e5b51 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 16 Mar 2021 17:53:05 +0200 Subject: [PATCH 36/89] Playground: serialize errors in AST (#10548) --- website/static/worker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/static/worker.js b/website/static/worker.js index 5af519105..18e423b56 100644 --- a/website/static/worker.js +++ b/website/static/worker.js @@ -41,7 +41,11 @@ function serializeAst(ast) { return JSON.stringify( ast, (_, value) => - typeof value === "bigint" ? `BigInt('${String(value)}')` : value, + value instanceof Error + ? { name: value.name, message: value.message, ...value } + : typeof value === "bigint" + ? `BigInt('${String(value)}')` + : value, 2 ); } From 5624eaf87eb766045cea94e9ff10dba7b7feaff9 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Tue, 16 Mar 2021 18:31:36 +0200 Subject: [PATCH 37/89] issue template: insist on using the Playground (#7974) --- .github/ISSUE_TEMPLATE/formatting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/formatting.md b/.github/ISSUE_TEMPLATE/formatting.md index 76c445afc..05ded854d 100644 --- a/.github/ISSUE_TEMPLATE/formatting.md +++ b/.github/ISSUE_TEMPLATE/formatting.md @@ -15,10 +15,10 @@ BEFORE SUBMITTING AN ISSUE: 2. We get a lot of requests for adding options, but Prettier is built on the principle of being opinionated about code formatting. - This means we have a very high bar for adding new options. + This means we add options only in the case of strict technical necessity. Find out more: https://prettier.io/docs/en/option-philosophy.html -Tip! Don't write this stuff manually. +Don't fill the form below manually! Let a program create a report for you: 1. Go to https://prettier.io/playground 2. Paste your code and set options From e29c8083fb09cb32d43eed5774952e35715c092e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 16:58:20 +0000 Subject: [PATCH 38/89] Build(deps-dev): Bump rollup from 2.41.2 to 2.41.4 (#10549) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2e65b9f26..29dd9ee0e 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "prettier": "2.2.1", "pretty-bytes": "5.6.0", "rimraf": "3.0.2", - "rollup": "2.41.2", + "rollup": "2.41.4", "rollup-plugin-polyfill-node": "0.6.2", "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.4", diff --git a/yarn.lock b/yarn.lock index 2d24da33b..726c768ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6040,10 +6040,10 @@ rollup-plugin-terser@7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@2.41.2: - version "2.41.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.41.2.tgz#b7db5cb7c21c2d524e8b26ef39c7e9808a290c7e" - integrity sha512-6u8fJJXJx6fmvKrAC9DHYZgONvSkz8S9b/VFBjoQ6dkKdHyPpPbpqiNl2Bao9XBzDHpq672X6sGZ9G1ZBqAHMg== +rollup@2.41.4: + version "2.41.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.41.4.tgz#2a674d64db4322482d440699acb060dc6dd9e65f" + integrity sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g== optionalDependencies: fsevents "~2.3.1" From edce20a822dd87f437d9c55b557e9b945586db9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Mar 2021 18:03:38 +0000 Subject: [PATCH 39/89] Build(deps): Bump @glimmer/syntax from 0.77.1 to 0.77.2 (#10550) --- changelog_unreleased/handlebars/10550.md | 13 +++++++ package.json | 2 +- .../escape/__snapshots__/jsfmt.spec.js.snap | 27 +++++++++++++ tests/handlebars/escape/numeric-entities.hbs | 9 +++++ .../__snapshots__/jsfmt.spec.js.snap | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 6 +-- yarn.lock | 38 ++++++------------- 7 files changed, 65 insertions(+), 32 deletions(-) create mode 100644 changelog_unreleased/handlebars/10550.md create mode 100644 tests/handlebars/escape/numeric-entities.hbs diff --git a/changelog_unreleased/handlebars/10550.md b/changelog_unreleased/handlebars/10550.md new file mode 100644 index 000000000..1d334f225 --- /dev/null +++ b/changelog_unreleased/handlebars/10550.md @@ -0,0 +1,13 @@ +#### Preserve numeric character references (#10550 by @rwjblue and @thorn0) + + +```hbs +{{! Input }} + + +{{! Prettier stable }} + + +{{! Prettier main }} + +``` diff --git a/package.json b/package.json index 29dd9ee0e..44e7c681d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@angular/compiler": "11.2.5", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.10", - "@glimmer/syntax": "0.77.1", + "@glimmer/syntax": "0.77.2", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.16.1", "angular-estree-parser": "2.3.0", diff --git a/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap index c300b89ae..9348648cb 100644 --- a/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/escape/__snapshots__/jsfmt.spec.js.snap @@ -26,3 +26,30 @@ printWidth: 80
\\{{
================================================================================ `; + +exports[`numeric-entities.hbs format 1`] = ` +====================================options===================================== +parsers: ["glimmer"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +Σ: Σ Σ Σ Σ Σ + +[&nbsp;] [&#160;] + +
+ + + +=====================================output===================================== + + +Σ: Σ Σ Σ Σ Σ [&nbsp;] [&#160;] + +
+ + +================================================================================ +`; diff --git a/tests/handlebars/escape/numeric-entities.hbs b/tests/handlebars/escape/numeric-entities.hbs new file mode 100644 index 000000000..b2d756a95 --- /dev/null +++ b/tests/handlebars/escape/numeric-entities.hbs @@ -0,0 +1,9 @@ + + +Σ: Σ Σ Σ Σ Σ + +[&nbsp;] [&#160;] + +
+ + diff --git a/tests/handlebars/text-wrap/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/text-wrap/__snapshots__/jsfmt.spec.js.snap index 7f322201e..f3f95ba16 100644 --- a/tests/handlebars/text-wrap/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/text-wrap/__snapshots__/jsfmt.spec.js.snap @@ -238,7 +238,7 @@ printWidth: 80
- First
+ First
Second
Third diff --git a/tests/handlebars/whitespace/__snapshots__/jsfmt.spec.js.snap b/tests/handlebars/whitespace/__snapshots__/jsfmt.spec.js.snap index fbd622509..a268a0c7c 100644 --- a/tests/handlebars/whitespace/__snapshots__/jsfmt.spec.js.snap +++ b/tests/handlebars/whitespace/__snapshots__/jsfmt.spec.js.snap @@ -231,9 +231,9 @@ printWidth: 40 our primary goal. Consumers own 60% of the cooperative and worker members 40%. Consumer and worker members share - proportionately in the cooperative’s - profits through our annual patronage - dividends. + proportionately in the + cooperative’s profits through + our annual patronage dividends.

================================================================================ `; diff --git a/yarn.lock b/yarn.lock index 726c768ef..39862c75f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1073,13 +1073,6 @@ dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.1.tgz#845a62ff6dc6a3646642cfbeec84b13a8a66ea1c" - integrity sha512-Dp0hebviZpcqEPjuNA5kGa/gl5nfYv+XEI0e9ozF5d1FD5yGPdvwQ9D+sQ4Dn888XCCmTWzKME4iRsVHK5aJoA== - dependencies: - "@simple-dom/interface" "^1.4.0" - "@glimmer/interfaces@0.77.2": version "0.77.2" resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.2.tgz#9e0f732439ac140d485d9c155ca9cc9ecfb73029" @@ -1098,25 +1091,16 @@ "@glimmer/util" "0.77.2" "@glimmer/validator" "0.77.2" -"@glimmer/syntax@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.1.tgz#155109c2e62a3dc94cf0ae7ccf2e840fe8875c7c" - integrity sha512-Jbfr34s0D70OlXeGzHzzK0aTRoXR0KtC6klVw5IQQlxvJIrHlZuRDpIueByL5sxhyYh9KQc13lMcHXUFaIPEtA== +"@glimmer/syntax@0.77.2": + version "0.77.2" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.2.tgz#0e37085c8b81228590396a7fe7365513a0d64798" + integrity sha512-LJYShzftktJoFLZ2r5C9RbFxGGXWwTAExsKTXCgbxUPUtNjFwJeNddnkbJOe/Ko6QhKP+mkCYyjECIiKwn8A8A== dependencies: - "@glimmer/interfaces" "0.77.1" - "@glimmer/util" "0.77.1" - "@handlebars/parser" "^2.0.0" + "@glimmer/interfaces" "0.77.2" + "@glimmer/util" "0.77.2" + "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.77.1": - version "0.77.1" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.1.tgz#9dfa721a3e3d06d7ec84488ef2e1a0107ea7cf3f" - integrity sha512-9BHDbmc/z7wzre+esFI+UPR2bx2Z+NYS5SxH10zgdYMDaN7qAQ63lIt+20AasQjC49JH4GxoPTettSknMQ6F1A== - dependencies: - "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.77.1" - "@simple-dom/interface" "^1.4.0" - "@glimmer/util@0.77.2": version "0.77.2" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.2.tgz#4673867c83a090c0eac501d07b1816ed7645709c" @@ -1134,10 +1118,10 @@ "@glimmer/env" "^0.1.7" "@glimmer/global-context" "0.77.2" -"@handlebars/parser@^2.0.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-2.1.0.tgz#100e625d53c339e2b571c91fa93a455e93670fe2" - integrity sha512-R14NuNaSKZ6eE9y4t0fg/1f8iKd5ZJtSOTIseGFzXINTV17XffhLG2Y0CvdKOgyVQ7+UnXi89YGzRo/xsgwHIA== +"@handlebars/parser@~2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@handlebars/parser/-/parser-2.0.0.tgz#5e8b7298f31ff8f7b260e6b7363c7e9ceed7d9c5" + integrity sha512-EP9uEDZv/L5Qh9IWuMUGJRfwhXJ4h1dqKTT4/3+tY0eu7sPis7xh23j61SYUnNF4vqCQvvUXpDo9Bh/+q1zASA== "@iarna/toml@2.2.5": version "2.2.5" From 230428f34b1186fb62d9cddb2424670787cd4f0d Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 20 Mar 2021 20:06:12 +0800 Subject: [PATCH 40/89] Add `consistent-negative-index-access` rule (#10569) --- .eslintrc.yml | 1 + .../consistent-negative-index-access.js | 72 +++++++++++++++++++ .../index.js | 1 + .../test.js | 44 ++++++++++++ src/document/doc-printer.js | 15 ++-- src/document/doc-utils.js | 13 ++-- src/language-css/parser-postcss.js | 7 +- src/language-css/printer-postcss.js | 5 +- src/language-handlebars/utils.js | 5 +- src/language-html/ast.js | 5 +- src/language-html/parser-html.js | 3 +- src/language-html/print-preprocess.js | 3 +- src/language-html/syntax-attribute.js | 3 +- src/language-js/comments.js | 5 +- src/language-js/needs-parens.js | 5 +- src/language-js/print/function.js | 3 +- src/language-js/print/member-chain.js | 5 +- src/language-js/print/template-literal.js | 3 +- src/language-markdown/print-preprocess.js | 3 +- src/language-markdown/printer-markdown.js | 2 +- src/main/options-normalizer.js | 5 +- src/utils/get-last.js | 4 +- 22 files changed, 164 insertions(+), 48 deletions(-) create mode 100644 scripts/tools/eslint-plugin-prettier-internal-rules/consistent-negative-index-access.js diff --git a/.eslintrc.yml b/.eslintrc.yml index d2436dc52..8f82f0170 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -118,6 +118,7 @@ overrides: prettier-internal-rules/better-parent-property-check-in-needs-parens: error - files: src/**/*.js rules: + prettier-internal-rules/consistent-negative-index-access: error prettier-internal-rules/flat-ast-path-call: error prettier-internal-rules/no-doc-builder-concat: error prettier-internal-rules/no-empty-flat-contents-for-if-break: error diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/consistent-negative-index-access.js b/scripts/tools/eslint-plugin-prettier-internal-rules/consistent-negative-index-access.js new file mode 100644 index 000000000..ef53aa7b2 --- /dev/null +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/consistent-negative-index-access.js @@ -0,0 +1,72 @@ +"use strict"; + +const selector = [ + "MemberExpression", + "[computed=true]", + "[optional=false]", + '[property.type="BinaryExpression"]', + '[property.operator="-"]', + '[property.left.type="MemberExpression"]', + "[property.left.optional=false]", + "[property.left.computed=false]", + '[property.left.property.type="Identifier"]', + '[property.left.property.name="length"]', + '[property.right.type="Literal"]', + `:not(${[ + "AssignmentExpression > .left", + "UpdateExpression > .argument", + // Ignore `getPenultimate` and `getLast` function self + 'VariableDeclarator[id.name="getPenultimate"] > ArrowFunctionExpression.init *', + 'VariableDeclarator[id.name="getLast"] > ArrowFunctionExpression.init *', + ].join(", ")})`, +].join(""); + +const messageId = "consistent-negative-index-access"; + +module.exports = { + meta: { + type: "suggestion", + docs: { + url: + "https://github.com/prettier/prettier/blob/main/scripts/tools/eslint-plugin-prettier-internal-rules/consistent-negative-index-access.js", + }, + messages: { + [messageId]: "Prefer `{{method}}(…)` over `…[….length - {{index}}]`.", + }, + fixable: "code", + }, + create(context) { + const sourceCode = context.getSourceCode(); + + return { + [selector](node) { + const { value: index } = node.property.right; + + if (index !== 1 && index !== 2) { + return; + } + + const { object } = node; + const lengthObject = node.property.left.object; + + const objectText = sourceCode.getText(object); + // Simply use text to compare object + if (sourceCode.getText(lengthObject) !== objectText) { + return; + } + + const method = ["getLast", "getPenultimate"][index - 1]; + + context.report({ + node, + messageId, + data: { + index, + method, + }, + fix: (fixer) => fixer.replaceText(node, `${method}(${objectText})`), + }); + }, + }; + }, +}; diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js index 9989800f6..79f5ff909 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/index.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/index.js @@ -3,6 +3,7 @@ module.exports = { rules: { "better-parent-property-check-in-needs-parens": require("./better-parent-property-check-in-needs-parens"), + "consistent-negative-index-access": require("./consistent-negative-index-access"), "directly-loc-start-end": require("./directly-loc-start-end"), "flat-ast-path-call": require("./flat-ast-path-call"), "jsx-identifier-case": require("./jsx-identifier-case"), diff --git a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js index 6dfd77e86..015ea7fd9 100644 --- a/scripts/tools/eslint-plugin-prettier-internal-rules/test.js +++ b/scripts/tools/eslint-plugin-prettier-internal-rules/test.js @@ -53,6 +53,50 @@ test("better-parent-property-check-in-needs-parens", { })), }); +test("consistent-negative-index-access", { + valid: [ + "getLast(foo)", + "getPenultimate(foo)", + "foo[foo.length]", + "foo[foo.length - 3]", + "foo[foo.length + 1]", + "foo[foo.length + -1]", + "foo[foo.length * -1]", + "foo.length - 1", + "foo?.[foo.length - 1]", + "foo[foo?.length - 1]", + "foo[foo['length'] - 1]", + "foo[bar.length - 1]", + "foo.bar[foo. bar.length - 1]", + "foo[foo.length - 1]++", + "--foo[foo.length - 1]", + "foo[foo.length - 1] += 1", + "foo[foo.length - 1] = 1", + ], + invalid: [ + { + code: "foo[foo.length - 1]", + output: "getLast(foo)", + errors: 1, + }, + { + code: "foo[foo.length - 2]", + output: "getPenultimate(foo)", + errors: 1, + }, + { + code: "foo[foo.length - 0b10]", + output: "getPenultimate(foo)", + errors: 1, + }, + { + code: "foo()[foo().length - 1]", + output: "getLast(foo())", + errors: 1, + }, + ], +}); + test("directly-loc-start-end", { valid: [], invalid: [ diff --git a/src/document/doc-printer.js b/src/document/doc-printer.js index 728cbf01f..5ebf6c579 100644 --- a/src/document/doc-printer.js +++ b/src/document/doc-printer.js @@ -130,15 +130,15 @@ function trim(out) { // Trim whitespace at the end of line while ( out.length > 0 && - typeof out[out.length - 1] === "string" && - /^[\t ]*$/.test(out[out.length - 1]) + typeof getLast(out) === "string" && + /^[\t ]*$/.test(getLast(out)) ) { trimCount += out.pop().length; } - if (out.length > 0 && typeof out[out.length - 1] === "string") { - const trimmed = out[out.length - 1].replace(/[\t ]*$/, ""); - trimCount += out[out.length - 1].length - trimmed.length; + if (out.length > 0 && typeof getLast(out) === "string") { + const trimmed = getLast(out).replace(/[\t ]*$/, ""); + trimCount += getLast(out).length - trimmed.length; out[out.length - 1] = trimmed; } @@ -353,8 +353,7 @@ function printDocToString(doc, options) { // group has these, we need to manually go through // these states and find the first one that fits. if (doc.expandedStates) { - const mostExpanded = - doc.expandedStates[doc.expandedStates.length - 1]; + const mostExpanded = getLast(doc.expandedStates); if (doc.break) { cmds.push([ind, MODE_BREAK, mostExpanded]); @@ -388,7 +387,7 @@ function printDocToString(doc, options) { } if (doc.id) { - groupModeMap[doc.id] = cmds[cmds.length - 1][1]; + groupModeMap[doc.id] = getLast(cmds)[1]; } break; // Fills each line with as much code as possible before moving to a new diff --git a/src/document/doc-utils.js b/src/document/doc-utils.js index 649a1cfd5..084844cf4 100644 --- a/src/document/doc-utils.js +++ b/src/document/doc-utils.js @@ -1,5 +1,5 @@ "use strict"; - +const getLast = require("../utils/get-last"); const { literalline } = require("./doc-builders"); const isConcat = (doc) => Array.isArray(doc) || (doc && doc.type === "concat"); @@ -128,7 +128,7 @@ function willBreak(doc) { function breakParentGroup(groupStack) { if (groupStack.length > 0) { - const parentGroup = groupStack[groupStack.length - 1]; + const parentGroup = getLast(groupStack); // Breaks are not propagated through conditional groups because // the user is expected to manually handle what breaks. if (!parentGroup.expandedStates && !parentGroup.break) { @@ -210,7 +210,7 @@ function stripDocTrailingHardlineFromDoc(doc) { } if (parts.length > 0) { - const lastPart = stripDocTrailingHardlineFromDoc(parts[parts.length - 1]); + const lastPart = stripDocTrailingHardlineFromDoc(getLast(parts)); parts[parts.length - 1] = lastPart; } return Array.isArray(doc) ? parts : { ...doc, parts }; @@ -289,10 +289,7 @@ function cleanDocFn(doc) { const [currentPart, ...restParts] = isConcat(part) ? getDocParts(part) : [part]; - if ( - typeof currentPart === "string" && - typeof parts[parts.length - 1] === "string" - ) { + if (typeof currentPart === "string" && typeof getLast(parts) === "string") { parts[parts.length - 1] += currentPart; } else { parts.push(currentPart); @@ -335,7 +332,7 @@ function normalizeParts(parts) { if ( newParts.length > 0 && - typeof newParts[newParts.length - 1] === "string" && + typeof getLast(newParts) === "string" && typeof part === "string" ) { newParts[newParts.length - 1] += part; diff --git a/src/language-css/parser-postcss.js b/src/language-css/parser-postcss.js index 0858e7f3e..5c7ea089e 100644 --- a/src/language-css/parser-postcss.js +++ b/src/language-css/parser-postcss.js @@ -1,6 +1,7 @@ "use strict"; const createError = require("../common/parser-create-error"); +const getLast = require("../utils/get-last"); const parseFrontMatter = require("../utils/front-matter/parse"); const { hasPragma } = require("./pragma"); const { @@ -45,7 +46,7 @@ function parseValueNode(valueNode, options) { isSCSS(options.parser, node.value) && node.type === "number" && node.unit === ".." && - node.value[node.value.length - 1] === "." + getLast(node.value) === "." ) { // Work around postcss bug parsing `50...` as `50.` with unit `..` // Set the unit to `...` to "accidentally" have arbitrary arguments work in the same way that cases where the node already had a unit work. @@ -116,11 +117,11 @@ function parseValueNode(valueNode, options) { } commaGroupStack.pop(); - commaGroup = commaGroupStack[commaGroupStack.length - 1]; + commaGroup = getLast(commaGroupStack); commaGroup.groups.push(parenGroup); parenGroupStack.pop(); - parenGroup = parenGroupStack[parenGroupStack.length - 1]; + parenGroup = getLast(parenGroupStack); } else if (node.type === "comma") { parenGroup.groups.push(commaGroup); commaGroup = { diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js index 9465784ac..04a444456 100644 --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -1,5 +1,6 @@ "use strict"; +const getLast = require("../utils/get-last"); const { printNumber, printString, @@ -855,7 +856,7 @@ function genericPrint(path, options, print) { const isSCSSMapItem = isSCSSMapItemNode(path); - const lastItem = node.groups[node.groups.length - 1]; + const lastItem = getLast(node.groups); const isLastItemComment = lastItem && lastItem.type === "value-comment"; const isKey = isKeyInValuePairNode(node, parentNode); @@ -941,7 +942,7 @@ function genericPrint(path, options, print) { // Don't add spaces on escaped colon `:`, e.g: grid-template-rows: [row-1-00\:00] auto; (prevNode && typeof prevNode.value === "string" && - prevNode.value[prevNode.value.length - 1] === "\\") || + getLast(prevNode.value) === "\\") || // Don't add spaces on `:` in `url` function (i.e. `url(fbglyph: cross-outline, fig-white)`) insideValueFunctionNode(path, "url") ? "" diff --git a/src/language-handlebars/utils.js b/src/language-handlebars/utils.js index dc1825b6e..807a8cc2a 100644 --- a/src/language-handlebars/utils.js +++ b/src/language-handlebars/utils.js @@ -1,6 +1,7 @@ "use strict"; const htmlVoidElements = require("html-void-elements"); +const getLast = require("../utils/get-last"); function isLastNodeOfSiblings(path) { const node = path.getValue(); @@ -8,14 +9,14 @@ function isLastNodeOfSiblings(path) { if ( isParentOfSomeType(path, ["ElementNode"]) && - parentNode.children[parentNode.children.length - 1] === node + getLast(parentNode.children) === node ) { return true; } if ( isParentOfSomeType(path, ["Block"]) && - parentNode.body[parentNode.body.length - 1] === node + getLast(parentNode.body) === node ) { return true; } diff --git a/src/language-html/ast.js b/src/language-html/ast.js index 1f57014ab..b7d74f6b3 100644 --- a/src/language-html/ast.js +++ b/src/language-html/ast.js @@ -2,6 +2,7 @@ const fromPairs = require("lodash/fromPairs"); const { isNonEmptyArray } = require("../common/util"); +const getLast = require("../utils/get-last"); const NODES_KEYS = { attrs: true, children: true, @@ -75,9 +76,7 @@ class Node { } get lastChild() { - return isNonEmptyArray(this.children) - ? this.children[this.children.length - 1] - : null; + return isNonEmptyArray(this.children) ? getLast(this.children) : null; } // for element and attribute diff --git a/src/language-html/parser-html.js b/src/language-html/parser-html.js index 079e99760..a3002eecb 100644 --- a/src/language-html/parser-html.js +++ b/src/language-html/parser-html.js @@ -6,6 +6,7 @@ const { ParseSourceFile, } = require("angular-html-parser/lib/compiler/src/parse_util"); const parseFrontMatter = require("../utils/front-matter/parse"); +const getLast = require("../utils/get-last"); const createError = require("../common/parser-create-error"); const { inferParserByLanguage } = require("../common/util"); const { @@ -314,7 +315,7 @@ function _parse(text, options, parserOptions, shouldParseFrontMatter = true) { ); subAst.sourceSpan = new ParseSourceSpan( startSpan, - subAst.children[subAst.children.length - 1].sourceSpan.end + getLast(subAst.children).sourceSpan.end ); const firstText = subAst.children[0]; if (firstText.length === offset) { diff --git a/src/language-html/print-preprocess.js b/src/language-html/print-preprocess.js index 896d72bcd..9280f8ff9 100644 --- a/src/language-html/print-preprocess.js +++ b/src/language-html/print-preprocess.js @@ -3,6 +3,7 @@ const { ParseSourceSpan, } = require("angular-html-parser/lib/compiler/src/parse_util"); +const getLast = require("../utils/get-last"); const { htmlTrim, getLeadingAndTrailingHtmlWhitespace, @@ -141,7 +142,7 @@ function mergeNodeIntoText(ast, shouldMerge, getValue) { if ( newChildren.length === 0 || - newChildren[newChildren.length - 1].type !== "text" + getLast(newChildren).type !== "text" ) { newChildren.push(newChild); continue; diff --git a/src/language-html/syntax-attribute.js b/src/language-html/syntax-attribute.js index 3180ae3b2..cb655da24 100644 --- a/src/language-html/syntax-attribute.js +++ b/src/language-html/syntax-attribute.js @@ -1,6 +1,7 @@ "use strict"; const parseSrcset = require("parse-srcset"); +const getLast = require("../utils/get-last"); const { builders: { group, ifBreak, indent, join, line, softline }, } = require("../document"); @@ -89,7 +90,7 @@ function printClassNames(value) { ) { groupedByPrefix.push([]); } - groupedByPrefix[groupedByPrefix.length - 1].push(classNames[i]); + getLast(groupedByPrefix).push(classNames[i]); previousPrefix = prefix; } diff --git a/src/language-js/comments.js b/src/language-js/comments.js index 8d14c418e..b3fc525e3 100644 --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -392,10 +392,7 @@ function handleClassComments({ isNonEmptyArray(enclosingNode.decorators) && !(followingNode && followingNode.type === "Decorator") ) { - addTrailingComment( - enclosingNode.decorators[enclosingNode.decorators.length - 1], - comment - ); + addTrailingComment(getLast(enclosingNode.decorators), comment); return true; } diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js index f897421e5..ac63bba0b 100644 --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -1,5 +1,6 @@ "use strict"; +const getLast = require("../utils/get-last"); const { getFunctionParameters, getLeftSidePathName, @@ -862,9 +863,7 @@ function isFollowedByRightBracket(path) { case "ObjectProperty": if (name === "value") { const parentParent = path.getParentNode(1); - return ( - parentParent.properties[parentParent.properties.length - 1] === parent - ); + return getLast(parentParent.properties) === parent; } break; case "BinaryExpression": diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js index 83548b2e8..9318700b7 100644 --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -8,6 +8,7 @@ const { printDanglingComments, printCommentsSeparately, } = require("../../main/comments"); +const getLast = require("../../utils/get-last"); const { getNextNonSpaceNonCommentCharacterIndex, } = require("../../common/util"); @@ -446,7 +447,7 @@ function printReturnAndThrowArgument(path, options, print) { } const comments = getComments(node); - const lastComment = comments[comments.length - 1]; + const lastComment = getLast(comments); const isLastCommentLine = lastComment && isLineComment(lastComment); if (isLastCommentLine) { diff --git a/src/language-js/print/member-chain.js b/src/language-js/print/member-chain.js index 43963f394..6040db191 100644 --- a/src/language-js/print/member-chain.js +++ b/src/language-js/print/member-chain.js @@ -309,10 +309,7 @@ function printMemberChain(path, options, print) { const printed = printedGroup.map((tuple) => tuple.printed); // Checks if the last node (i.e. the parent node) needs parens and print // accordingly - if ( - printedGroup.length > 0 && - printedGroup[printedGroup.length - 1].needsParens - ) { + if (printedGroup.length > 0 && getLast(printedGroup).needsParens) { return ["(", ...printed, ")"]; } return printed; diff --git a/src/language-js/print/template-literal.js b/src/language-js/print/template-literal.js index 9e7833296..9e42c5cf3 100644 --- a/src/language-js/print/template-literal.js +++ b/src/language-js/print/template-literal.js @@ -1,5 +1,6 @@ "use strict"; +const getLast = require("../../utils/get-last"); const { getStringWidth, getIndentSize } = require("../../common/util"); const { builders: { @@ -140,7 +141,7 @@ function printJestEachTemplateLiteral(path, options, print) { const tableBody = [{ hasLineBreak: false, cells: [] }]; for (let i = 1; i < node.quasis.length; i++) { - const row = tableBody[tableBody.length - 1]; + const row = getLast(tableBody); const correspondingExpression = stringifiedExpressions[i - 1]; row.cells.push(correspondingExpression); diff --git a/src/language-markdown/print-preprocess.js b/src/language-markdown/print-preprocess.js index fcbac279a..711b88895 100644 --- a/src/language-markdown/print-preprocess.js +++ b/src/language-markdown/print-preprocess.js @@ -1,5 +1,6 @@ "use strict"; +const getLast = require("../utils/get-last"); const { getOrderedListItemInfo, mapAst, splitText } = require("./utils"); // 0x0 ~ 0x10ffff @@ -78,7 +79,7 @@ function mergeChildren(ast, shouldMerge, mergeNode) { return node; } const children = node.children.reduce((current, child) => { - const lastChild = current[current.length - 1]; + const lastChild = getLast(current); if (lastChild && shouldMerge(lastChild, child)) { current.splice(-1, 1, mergeNode(lastChild, child)); } else { diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index b1f2f8d06..677a05829 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -752,7 +752,7 @@ function printChildren(path, options, print, events = {}) { function getLastDescendantNode(node) { let current = node; while (isNonEmptyArray(current.children)) { - current = current.children[current.children.length - 1]; + current = getLast(current.children); } return current; } diff --git a/src/main/options-normalizer.js b/src/main/options-normalizer.js index 4c6d0c16e..eb54905e9 100644 --- a/src/main/options-normalizer.js +++ b/src/main/options-normalizer.js @@ -4,6 +4,7 @@ const vnopts = require("vnopts"); const leven = require("leven"); const chalk = require("chalk"); const flat = require("lodash/flatten"); +const getLast = require("../utils/get-last"); const cliDescriptor = { key: (key) => (key.length === 1 ? `-${key}` : `--${key}`), @@ -196,9 +197,7 @@ function optionInfoToSchema(optionInfo, { isCLI, optionInfos }) { const originalPreprocess = parameters.preprocess || ((x) => x); parameters.preprocess = (value, schema, utils) => schema.preprocess( - originalPreprocess( - Array.isArray(value) ? value[value.length - 1] : value - ), + originalPreprocess(Array.isArray(value) ? getLast(value) : value), utils ); } diff --git a/src/utils/get-last.js b/src/utils/get-last.js index f7d19fafe..371abf867 100644 --- a/src/utils/get-last.js +++ b/src/utils/get-last.js @@ -1,3 +1,5 @@ "use strict"; -module.exports = (arr) => arr[arr.length - 1]; +const getLast = (arr) => arr[arr.length - 1]; + +module.exports = getLast; From 5cf5b93fb64078e006e34dc1f398de88dcac49ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 00:03:41 +0900 Subject: [PATCH 41/89] Build(deps-dev): Bump tempy from 1.0.0 to 1.0.1 (#10576) Bumps [tempy](https://github.com/sindresorhus/tempy) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/sindresorhus/tempy/releases) - [Commits](https://github.com/sindresorhus/tempy/compare/v1.0.0...v1.0.1) 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 44e7c681d..6a63ace75 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "shelljs": "0.8.4", "snapshot-diff": "0.8.1", "synchronous-promise": "2.0.15", - "tempy": "1.0.0", + "tempy": "1.0.1", "terser-webpack-plugin": "5.1.1", "webpack": "5.26.0" }, diff --git a/yarn.lock b/yarn.lock index 39862c75f..9c36aec4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6580,10 +6580,10 @@ temp-dir@^2.0.0: resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-2.0.0.tgz#bde92b05bdfeb1516e804c9c00ad45177f31321e" integrity sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg== -tempy@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/tempy/-/tempy-1.0.0.tgz#4f192b3ee3328a2684d0e3fc5c491425395aab65" - integrity sha512-eLXG5B1G0mRPHmgH2WydPl5v4jH35qEn3y/rA/aahKhIa91Pn119SsU7n7v/433gtT9ONzC8ISvNHIh2JSTm0w== +tempy@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tempy/-/tempy-1.0.1.tgz#30fe901fd869cfb36ee2bd999805aa72fbb035de" + integrity sha512-biM9brNqxSc04Ee71hzFbryD11nX7VPhQQY32AdDmjFvodsRFz/3ufeoTZ6uYkRFfGo188tENcASNs3vTdsM0w== dependencies: del "^6.0.0" is-stream "^2.0.0" From 60e4d2348c7eeb13f6f1004b77c4f5059582df69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 18:17:10 +0000 Subject: [PATCH 42/89] Build(deps-dev): Bump webpack from 5.25.0 to 5.27.1 in /website (#10575) --- website/package.json | 2 +- website/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/package.json b/website/package.json index 8bc396a30..3c75d5aef 100644 --- a/website/package.json +++ b/website/package.json @@ -20,7 +20,7 @@ "concurrently": "6.0.0", "docusaurus": "1.14.7", "js-yaml": "4.0.0", - "webpack": "5.25.0", + "webpack": "5.27.1", "webpack-cli": "4.5.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index 22b389b07..5a20edc63 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -7652,10 +7652,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.25.0: - version "5.25.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.25.0.tgz#f9409977f0f3b6d4b9c4f73adc7d7cb9603a09e9" - integrity sha512-jqQZopNCzt9c4K6Qa7j6kIhzHfR9wgF84go58VoNp4JbZrBr2D2l5lcv72CW80yc6NJl8CR6OY8xctnIs0r2uw== +webpack@5.27.1: + version "5.27.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.27.1.tgz#6808fb6e45e35290cdb8ae43c7a10884839a3079" + integrity sha512-rxIDsPZ3Apl3JcqiemiLmWH+hAq04YeOXqvCxNZOnTp8ZgM9NEPtbu4CaMfMEf9KShnx/Ym8uLGmM6P4XnwCoA== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From adb24f5a674fbe5b3f810043b5d6ef20e01351ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 18:17:29 +0000 Subject: [PATCH 43/89] Build(deps): Bump @angular/compiler from 11.2.5 to 11.2.6 (#10574) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6a63ace75..218f5d38b 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "11.2.5", + "@angular/compiler": "11.2.6", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.10", "@glimmer/syntax": "0.77.2", diff --git a/yarn.lock b/yarn.lock index 9c36aec4e..de48560c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/compiler@11.2.5": - version "11.2.5" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.5.tgz#5d0aef6161484b6f8f67ff2fef10db5a631c7661" - integrity sha512-MrgZnTY6OPooDZw76wgj1ZM43IwwStsDfwuvYI8B7PR+QtPIwAkxi+spW78MHy3ltzsIQorC98pMiz7c7oTxDg== +"@angular/compiler@11.2.6": + version "11.2.6" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.6.tgz#8b69cd2f2c3bb0fbc6f95ded1ccbe20e6858daed" + integrity sha512-3ijsCxnCLU1V1hy4UMf9qtMz5LR+wCdVFDqktEQccN9YEkN0cNtOc8Nu9EV9/mc2tqd1Q4xSBpb2o2mvpy7AhQ== dependencies: tslib "^2.0.0" From bd28688993303585ac7606cbc8622e043096afc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 18:17:57 +0000 Subject: [PATCH 44/89] Build(deps): Bump codecov/codecov-action from v1.2.2 to v1.3.1 (#10572) --- .github/workflows/dev-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-test.yml b/.github/workflows/dev-test.yml index 08e161c9b..4f677b855 100644 --- a/.github/workflows/dev-test.yml +++ b/.github/workflows/dev-test.yml @@ -65,7 +65,7 @@ jobs: run: yarn test --maxWorkers=2 - name: Upload Coverage - uses: codecov/codecov-action@v1.2.2 + uses: codecov/codecov-action@v1.3.1 if: matrix.ENABLE_CODE_COVERAGE with: fail_ci_if_error: true @@ -77,7 +77,7 @@ jobs: PRETTIER_FALLBACK_RESOLVE: true - name: Upload Coverage (PRETTIER_FALLBACK_RESOLVE) - uses: codecov/codecov-action@v1.2.2 + uses: codecov/codecov-action@v1.3.1 if: matrix.ENABLE_CODE_COVERAGE with: fail_ci_if_error: true From 434ca91698f63d0708aa5a93451b28f5475b8f4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 19:51:26 +0000 Subject: [PATCH 45/89] Build(deps): Bump @glimmer/syntax from 0.77.2 to 0.77.3 (#10579) --- package.json | 2 +- yarn.lock | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 218f5d38b..7c55ddfa5 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@angular/compiler": "11.2.6", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.10", - "@glimmer/syntax": "0.77.2", + "@glimmer/syntax": "0.77.3", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.16.1", "angular-estree-parser": "2.3.0", diff --git a/yarn.lock b/yarn.lock index de48560c6..6c23751e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1080,6 +1080,13 @@ dependencies: "@simple-dom/interface" "^1.4.0" +"@glimmer/interfaces@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.3.tgz#cd0523147da72d8901950a24c3be7aa4e38d8d09" + integrity sha512-i/2YmyjFKhKNheEfvajQbbQr9AWbahNV71oakipz8b+qWx0nni5cjM/m/Z0nhnwrsa2cNFIt5kNknD6rh18AHg== + dependencies: + "@simple-dom/interface" "^1.4.0" + "@glimmer/reference@0.77.2": version "0.77.2" resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.2.tgz#760d3520294ddb2f833fbebc713205e3a3d6206a" @@ -1091,13 +1098,13 @@ "@glimmer/util" "0.77.2" "@glimmer/validator" "0.77.2" -"@glimmer/syntax@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.2.tgz#0e37085c8b81228590396a7fe7365513a0d64798" - integrity sha512-LJYShzftktJoFLZ2r5C9RbFxGGXWwTAExsKTXCgbxUPUtNjFwJeNddnkbJOe/Ko6QhKP+mkCYyjECIiKwn8A8A== +"@glimmer/syntax@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.3.tgz#219bd46687147f10cf3893f81ebfd6ac7733ac07" + integrity sha512-C5sMmRyiDnhYHkdogcEpBuSbiFrClAwGg1tBk61dMkYmXlInjlwpAj5SfgtSzcgXjUM/60uZo+DvMacyZsx9Nw== dependencies: - "@glimmer/interfaces" "0.77.2" - "@glimmer/util" "0.77.2" + "@glimmer/interfaces" "0.77.3" + "@glimmer/util" "0.77.3" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" @@ -1110,6 +1117,15 @@ "@glimmer/interfaces" "0.77.2" "@simple-dom/interface" "^1.4.0" +"@glimmer/util@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.3.tgz#c91fc3b61743ddea3e4470cf1ed8378f88cc863f" + integrity sha512-pqkU2b4BOkmSehRPSbS4bIw1zk8K6dVkVbXdXRqVz4oKqM7c0zYR/5fV2Sjayd3gEElt71lAef5uBr+7WddDlA== + dependencies: + "@glimmer/env" "0.1.7" + "@glimmer/interfaces" "0.77.3" + "@simple-dom/interface" "^1.4.0" + "@glimmer/validator@0.77.2": version "0.77.2" resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.2.tgz#2d1fe44671c888be1cb43bbbe7c5b5a79d320a79" From 7d6a19d82ca5202d72dcbb409e2c5d19715f5038 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 20:01:21 +0000 Subject: [PATCH 46/89] Build(deps-dev): Bump webpack from 5.26.0 to 5.27.1 (#10573) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7c55ddfa5..7aa38bb7a 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "synchronous-promise": "2.0.15", "tempy": "1.0.1", "terser-webpack-plugin": "5.1.1", - "webpack": "5.26.0" + "webpack": "5.27.1" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 6c23751e3..c2b80bdca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7108,10 +7108,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.26.0: - version "5.26.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.26.0.tgz#269841ed7b5c6522221aa27f7efceda04c8916d7" - integrity sha512-9kQATUOGQBkqzNKFmFON4KXZDsXnE7xk58tBxca8aCi+6/QhAbmWIvtGqBL66XIsBFpomFH0/0KyCaySo0ta2g== +webpack@5.27.1: + version "5.27.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.27.1.tgz#6808fb6e45e35290cdb8ae43c7a10884839a3079" + integrity sha512-rxIDsPZ3Apl3JcqiemiLmWH+hAq04YeOXqvCxNZOnTp8ZgM9NEPtbu4CaMfMEf9KShnx/Ym8uLGmM6P4XnwCoA== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From fb057549f486a23dec32dbbcd9e49ec148ec283e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:35:56 +0000 Subject: [PATCH 47/89] Build(deps-dev): Bump eslint-plugin-jest from 24.3.1 to 24.3.2 (#10580) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7aa38bb7a..2aa355d8f 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "eslint-config-prettier": "8.1.0", "eslint-formatter-friendly": "7.0.0", "eslint-plugin-import": "2.22.1", - "eslint-plugin-jest": "24.3.1", + "eslint-plugin-jest": "24.3.2", "eslint-plugin-prettier-internal-rules": "link:scripts/tools/eslint-plugin-prettier-internal-rules", "eslint-plugin-react": "7.22.0", "eslint-plugin-unicorn": "28.0.2", diff --git a/yarn.lock b/yarn.lock index c2b80bdca..09cef24bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3046,10 +3046,10 @@ eslint-plugin-import@2.22.1: resolve "^1.17.0" tsconfig-paths "^3.9.0" -eslint-plugin-jest@24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.1.tgz#c8df037847b83397940bef7fbc2cc168ab466bcc" - integrity sha512-RQt59rfMSHyvedImT72iaf8JcvCcR4P7Uq499dALtjY8mrCjbwWrFi1UceG4sid2wVIeDi+0tjxXZ8CZEVO7Zw== +eslint-plugin-jest@24.3.2: + version "24.3.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.2.tgz#30a8b2dea6278d0da1d6fb9d6cd530aaf58050a1" + integrity sha512-cicWDr+RvTAOKS3Q/k03+Z3odt3VCiWamNUHWd6QWbVQWcYJyYgUTu8x0mx9GfeDEimawU5kQC+nQ3MFxIM6bw== dependencies: "@typescript-eslint/experimental-utils" "^4.0.1" From 678c46f0104bd767f82f6b177d7fc86213eb4d76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Mar 2021 22:36:46 +0000 Subject: [PATCH 48/89] Build(deps): Bump mem from 8.0.0 to 8.1.0 (#10581) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2aa355d8f..23a2dd87a 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "lines-and-columns": "1.1.6", "linguist-languages": "7.13.0", "lodash": "4.17.21", - "mem": "8.0.0", + "mem": "8.1.0", "meriyah": "4.1.5", "minimatch": "3.0.4", "minimist": "1.2.5", diff --git a/yarn.lock b/yarn.lock index 09cef24bc..efe20e11a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4974,10 +4974,10 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -mem@8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-8.0.0.tgz#b5e4b6d2d241c6296da05436173b4d0c7ae1f9ac" - integrity sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA== +mem@8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-8.1.0.tgz#445e47827fb757a4e5f35b0a6a62743cbfdc0a0d" + integrity sha512-FIkgXo0kTi3XpvaznV5Muk6Y6w8SkdmRXcY7ZLonQesuYezp59UooLxAVBcGuN6PH2tXN84mR3vyzSc6oSMUfA== dependencies: map-age-cleaner "^0.1.3" mimic-fn "^3.1.0" From 35ca803565549e95ca889862a3dc952e339e38c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 09:09:03 +0800 Subject: [PATCH 49/89] Build(deps-dev): Bump @glimmer/reference from 0.77.2 to 0.77.3 (#10583) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 50 +++++++++++++++++--------------------------------- 2 files changed, 18 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 23a2dd87a..d67693fcb 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "@babel/core": "7.13.10", "@babel/preset-env": "7.13.10", "@babel/types": "7.13.0", - "@glimmer/reference": "0.77.2", + "@glimmer/reference": "0.77.3", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.3.0", "@rollup/plugin-commonjs": "16.0.0", diff --git a/yarn.lock b/yarn.lock index efe20e11a..af4a0b413 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1066,20 +1066,13 @@ resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= -"@glimmer/global-context@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.2.tgz#5c872a40eaec994c89a87df837d5a29cf05822c7" - integrity sha512-q6a6MVY2ibOPvPFC+1kQy70lZpOvOXZCBS3U0+z8r81WQbRsO9k89PlkXenrLqlpNdLO42SrbCd8ZcXrdO1COg== +"@glimmer/global-context@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.3.tgz#b83f2c9d2d0720fdbd49d1ecf33d6836d06c3af2" + integrity sha512-bNPwdoW0/+bwSAR3Ek5C+xo+xkIlUxR4LljfRuwDOXlTebm7YPVDNLN+Vb2XUGNZfMgyNDRPkMO9P3CxW1wDTA== dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.2.tgz#9e0f732439ac140d485d9c155ca9cc9ecfb73029" - integrity sha512-UUGjjlOYwKYe3jO81zyqKeMnLTtppP3vSRGaATx2+SKe0Ik5brHQY7FO7bWqdBP7QAHffzFHFhlWWYmu7Hu19A== - dependencies: - "@simple-dom/interface" "^1.4.0" - "@glimmer/interfaces@0.77.3": version "0.77.3" resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.3.tgz#cd0523147da72d8901950a24c3be7aa4e38d8d09" @@ -1087,16 +1080,16 @@ dependencies: "@simple-dom/interface" "^1.4.0" -"@glimmer/reference@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.2.tgz#760d3520294ddb2f833fbebc713205e3a3d6206a" - integrity sha512-ELEwShIOow0cIsgYXhkB9nmUzQh7YwoHosoMcTQJ1HOZ2OyuH9Cm9IVDICM1edEzLs9KiIcE9jatjDaFZZkx9g== +"@glimmer/reference@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.3.tgz#8bf252da20aacd444ab8b7fd4b35d3d56d71a235" + integrity sha512-g9XsW/ZqJ2/6htZYegYoSY4vl43E5KsN2xSNw2sy4Hk901tzvsvjsiLtdH7CvzxZI+s5AUJNQNc2D+/WSppQIQ== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.2" - "@glimmer/interfaces" "0.77.2" - "@glimmer/util" "0.77.2" - "@glimmer/validator" "0.77.2" + "@glimmer/global-context" "0.77.3" + "@glimmer/interfaces" "0.77.3" + "@glimmer/util" "0.77.3" + "@glimmer/validator" "0.77.3" "@glimmer/syntax@0.77.3": version "0.77.3" @@ -1108,15 +1101,6 @@ "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.2.tgz#4673867c83a090c0eac501d07b1816ed7645709c" - integrity sha512-Q+jC1Rd1gywFsHyj1GWOQNLY20JOu63s0L8fsTUlXHkK/PIBENylnDG4phTrdSuPgeHexB6DzSRTWJPaLXB9+Q== - dependencies: - "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.77.2" - "@simple-dom/interface" "^1.4.0" - "@glimmer/util@0.77.3": version "0.77.3" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.3.tgz#c91fc3b61743ddea3e4470cf1ed8378f88cc863f" @@ -1126,13 +1110,13 @@ "@glimmer/interfaces" "0.77.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.2.tgz#2d1fe44671c888be1cb43bbbe7c5b5a79d320a79" - integrity sha512-BNPut4s9Vj61PvJLkiv8GvRiYnM1CKSViUvTgXy+x6SIL3Y/XCUAecos3pFSmeEFPb2uevK4mzex5GlX/fQ+ug== +"@glimmer/validator@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.3.tgz#bbbd802742983ad5deed66c02d636e0faa520c65" + integrity sha512-e/eUJszfBrr0wQkW1+vsiP8Sa+S7oBuSa1XPh1b7maGUNkWpk49THERfyULsWYGzrl5iYHWmM+Cl6proAXdI6g== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.2" + "@glimmer/global-context" "0.77.3" "@handlebars/parser@~2.0.0": version "2.0.0" From be0bbd1900cf4b0e04a6fccef0cc1f3be3c6c898 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 02:14:59 +0000 Subject: [PATCH 50/89] Build(deps-dev): Bump rollup from 2.41.4 to 2.42.1 (#10582) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d67693fcb..15044a173 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "prettier": "2.2.1", "pretty-bytes": "5.6.0", "rimraf": "3.0.2", - "rollup": "2.41.4", + "rollup": "2.42.1", "rollup-plugin-polyfill-node": "0.6.2", "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.4", diff --git a/yarn.lock b/yarn.lock index af4a0b413..3e0553c10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6024,10 +6024,10 @@ rollup-plugin-terser@7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@2.41.4: - version "2.41.4" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.41.4.tgz#2a674d64db4322482d440699acb060dc6dd9e65f" - integrity sha512-f9IHfMO8p2Y8OdisI7Oj3oKkPuaQ6cgSwYqAi0TDvP3w2p+oX1VejX/w28a1h8WTnrapzfO5d4Uqhww+gL0b0g== +rollup@2.42.1: + version "2.42.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.42.1.tgz#6d675b7971e3bee510935326a0f7e556bb7d43de" + integrity sha512-/y7M2ULg06JOXmMpPzhTeQroJSchy8lX8q6qrjqil0jmLz6ejCWbQzVnWTsdmMQRhfU0QcwtiW8iZlmrGXWV4g== optionalDependencies: fsevents "~2.3.1" From 199be1ac2f1afd67f106847e51c0a6bf47396f91 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Mar 2021 10:22:18 +0800 Subject: [PATCH 51/89] Simplify JS parser handling Hashbang (#10407) --- src/language-js/parse-postprocess.js | 21 --------------------- src/language-js/parser-espree.js | 13 ++++--------- src/language-js/parser-flow.js | 3 ++- src/language-js/parser-typescript.js | 6 ++++-- src/language-js/parser/replace-hashbang.js | 13 +++++++++++++ 5 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 src/language-js/parser/replace-hashbang.js diff --git a/src/language-js/parse-postprocess.js b/src/language-js/parse-postprocess.js index 2a9b4fbae..6d95b3866 100644 --- a/src/language-js/parse-postprocess.js +++ b/src/language-js/parse-postprocess.js @@ -3,21 +3,12 @@ const { getLast, getNextNonSpaceNonCommentCharacter, - getShebang, } = require("../common/util"); const createError = require("../common/parser-create-error"); const { locStart, locEnd } = require("./loc"); const { isTypeCastComment } = require("./comments"); function postprocess(ast, options) { - if ( - options.parser === "typescript" || - options.parser === "flow" || - options.parser === "espree" - ) { - includeShebang(ast, options); - } - // Invalid decorators are removed since `@typescript-eslint/typescript-estree` v4 // https://github.com/typescript-eslint/typescript-eslint/pull/2375 if (options.parser === "typescript" && options.originalText.includes("@")) { @@ -256,16 +247,4 @@ function rebalanceLogicalTree(node) { }); } -function includeShebang(ast, options) { - const shebang = getShebang(options.originalText); - - if (shebang) { - ast.comments.unshift({ - type: "Line", - value: shebang.slice(2), - range: [0, shebang.length], - }); - } -} - module.exports = postprocess; diff --git a/src/language-js/parser-espree.js b/src/language-js/parser-espree.js index 214fe9b20..a7abe00ab 100644 --- a/src/language-js/parser-espree.js +++ b/src/language-js/parser-espree.js @@ -1,9 +1,9 @@ "use strict"; -const { getShebang } = require("../common/util"); const createError = require("../common/parser-create-error"); const tryCombinations = require("../utils/try-combinations"); const postprocess = require("./parse-postprocess"); const createParser = require("./parser/create-parser"); +const replaceHashbang = require("./parser/replace-hashbang"); const parseOptions = { range: true, @@ -33,15 +33,10 @@ function parse(originalText, parsers, options) { const { parse, latestEcmaVersion } = require("espree"); parseOptions.ecmaVersion = latestEcmaVersion; - // Replace shebang with space - const shebang = getShebang(originalText); - const text = shebang - ? " ".repeat(shebang.length) + originalText.slice(shebang.length) - : originalText; - + const textToParse = replaceHashbang(originalText); const { result: ast, error: moduleParseError } = tryCombinations( - () => parse(text, { ...parseOptions, sourceType: "module" }), - () => parse(text, { ...parseOptions, sourceType: "script" }) + () => parse(textToParse, { ...parseOptions, sourceType: "module" }), + () => parse(textToParse, { ...parseOptions, sourceType: "script" }) ); if (!ast) { diff --git a/src/language-js/parser-flow.js b/src/language-js/parser-flow.js index 91662089e..e6b9f5936 100644 --- a/src/language-js/parser-flow.js +++ b/src/language-js/parser-flow.js @@ -3,6 +3,7 @@ const createError = require("../common/parser-create-error"); const postprocess = require("./parse-postprocess"); const createParser = require("./parser/create-parser"); +const replaceHashbang = require("./parser/replace-hashbang"); // https://github.com/facebook/flow/tree/master/packages/flow-parser#options const parseOptions = { @@ -47,7 +48,7 @@ function createParseError(error) { function parse(text, parsers, opts) { // Inline the require to avoid loading all the JS if we don't use it const { parse } = require("flow-parser"); - const ast = parse(text, parseOptions); + const ast = parse(replaceHashbang(text), parseOptions); const [error] = ast.errors; if (error) { throw createParseError(error); diff --git a/src/language-js/parser-typescript.js b/src/language-js/parser-typescript.js index 107cb7830..533c631b1 100644 --- a/src/language-js/parser-typescript.js +++ b/src/language-js/parser-typescript.js @@ -4,6 +4,7 @@ const createError = require("../common/parser-create-error"); const tryCombinations = require("../utils/try-combinations"); const postprocess = require("./parse-postprocess"); const createParser = require("./parser/create-parser"); +const replaceHashbang = require("./parser/replace-hashbang"); /** @type {import("@typescript-eslint/typescript-estree").TSESTreeOptions} */ const parseOptions = { @@ -33,14 +34,15 @@ function createParseError(error) { } function parse(text, parsers, opts) { + const textToParse = replaceHashbang(text); const jsx = isProbablyJsx(text); const { parseWithNodeMaps } = require("@typescript-eslint/typescript-estree"); const { result, error: firstError } = tryCombinations( // Try passing with our best guess first. - () => parseWithNodeMaps(text, { ...parseOptions, jsx }), + () => parseWithNodeMaps(textToParse, { ...parseOptions, jsx }), // But if we get it wrong, try the opposite. - () => parseWithNodeMaps(text, { ...parseOptions, jsx: !jsx }) + () => parseWithNodeMaps(textToParse, { ...parseOptions, jsx: !jsx }) ); if (!result) { diff --git a/src/language-js/parser/replace-hashbang.js b/src/language-js/parser/replace-hashbang.js new file mode 100644 index 000000000..56fec9e98 --- /dev/null +++ b/src/language-js/parser/replace-hashbang.js @@ -0,0 +1,13 @@ +"use strict"; + +// Replace `#!` with `//` so `typescript`, `flow`, and `espree` can parse it as line comment +// Inspired by ESLint parse function https://github.com/eslint/eslint/blob/9d6063add931f0803cae1676d5df307baf114360/lib/linter/linter.js#L635 +function replaceHashbang(text) { + if (text.charAt(0) === "#" && text.charAt(1) === "!") { + return "//" + text.slice(2); + } + + return text; +} + +module.exports = replaceHashbang; From 5a789f52db88a06c5eb8bce12de818694535429c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 18:15:01 +0900 Subject: [PATCH 52/89] Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11 (#10546) * Build(deps): Bump @babel/parser from 7.13.10 to 7.13.11 Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.10 to 7.13.11. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.11/packages/babel-parser) Signed-off-by: dependabot[bot] * Format type imports in TSImportEqualsDeclaration Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: sosukesuzuki Co-authored-by: Georgii Dolzhykov --- package.json | 2 +- src/language-js/print/typescript.js | 8 +++- .../__snapshots__/jsfmt.spec.js.snap | 40 +++++++++++++++++++ .../type-import-equals-declaration.ts | 18 +++++++++ yarn.lock | 8 ++-- 5 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 tests/misc/typescript-babel-only/type-import-equals-declaration.ts diff --git a/package.json b/package.json index 15044a173..6d637bbc1 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "@angular/compiler": "11.2.6", "@babel/code-frame": "7.12.13", - "@babel/parser": "7.13.10", + "@babel/parser": "7.13.11", "@glimmer/syntax": "0.77.3", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.16.1", diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index 9a71c934a..c49a818e9 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -457,8 +457,14 @@ function printTypescript(path, options, print) { if (node.isExport) { parts.push("export "); } + + parts.push("import "); + + if (node.importKind && node.importKind !== "value") { + parts.push(node.importKind, " "); + } + parts.push( - "import ", path.call(print, "id"), " = ", path.call(print, "moduleReference") diff --git a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap index 45f2edd13..61aa2f761 100644 --- a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap @@ -81,3 +81,43 @@ type T = [x: A]; ================================================================================ `; + +exports[`type-import-equals-declaration.ts format 1`] = ` +====================================options===================================== +parsers: ["babel-ts"] +printWidth: 80 + | printWidth +=====================================input====================================== +import type A = require("foo"); +export import type = require("A"); + +import type +A = require("A"); + +import +type +a = require("a"); + +export import +type +B = require("B"); + +export +import +type +b = require("b"); + +=====================================output===================================== +import type A = require("foo"); +export import type = require("A"); + +import type A = require("A"); + +import type a = require("a"); + +export import type B = require("B"); + +export import type b = require("b"); + +================================================================================ +`; diff --git a/tests/misc/typescript-babel-only/type-import-equals-declaration.ts b/tests/misc/typescript-babel-only/type-import-equals-declaration.ts new file mode 100644 index 000000000..acdf20f77 --- /dev/null +++ b/tests/misc/typescript-babel-only/type-import-equals-declaration.ts @@ -0,0 +1,18 @@ +import type A = require("foo"); +export import type = require("A"); + +import type +A = require("A"); + +import +type +a = require("a"); + +export import +type +B = require("B"); + +export +import +type +b = require("b"); diff --git a/yarn.lock b/yarn.lock index 3e0553c10..b46f56b8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -283,10 +283,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.10", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.10.tgz#8f8f9bf7b3afa3eabd061f7a5bcdf4fec3c48409" - integrity sha512-0s7Mlrw9uTWkYua7xWr99Wpk2bnGa0ANleKfksYAES8LpWH4gW1OUr42vqKNf0us5UQNfru2wPqMqRITzq/SIQ== +"@babel/parser@7.13.11", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": + version "7.13.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.11.tgz#f93ebfc99d21c1772afbbaa153f47e7ce2f50b88" + integrity sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q== "@babel/plugin-proposal-async-generator-functions@^7.13.8": version "7.13.8" From 7cc52da144a31ddce4ff29b37a8ae3107e58e44c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Mar 2021 22:57:03 +0800 Subject: [PATCH 53/89] Simplified `printGenerically` (#10557) Co-authored-by: Georgii Dolzhykov --- changelog_unreleased/api/10557.md | 35 ++++ docs/plugins.md | 17 +- src/language-css/printer-postcss.js | 38 ++-- src/language-graphql/printer-graphql.js | 96 +++++----- src/language-handlebars/printer-glimmer.js | 18 +- src/language-html/printer-html.js | 4 +- src/language-js/print/angular.js | 22 +-- src/language-js/print/array.js | 4 +- src/language-js/print/assignment.js | 16 +- src/language-js/print/binaryish.js | 8 +- src/language-js/print/block.js | 2 +- src/language-js/print/call-arguments.js | 18 +- src/language-js/print/call-expression.js | 8 +- src/language-js/print/class.js | 12 +- src/language-js/print/flow.js | 16 +- src/language-js/print/function-parameters.js | 2 +- src/language-js/print/function.js | 31 ++-- src/language-js/print/interface.js | 8 +- src/language-js/print/jsx.js | 60 ++---- src/language-js/print/member-chain.js | 2 +- src/language-js/print/member.js | 4 +- src/language-js/print/misc.js | 10 +- src/language-js/print/module.js | 16 +- src/language-js/print/object.js | 2 +- src/language-js/print/property.js | 8 +- src/language-js/print/statement.js | 4 +- src/language-js/print/template-literal.js | 4 +- src/language-js/print/ternary.js | 24 +-- src/language-js/print/type-annotation.js | 24 +-- src/language-js/print/type-parameters.js | 18 +- src/language-js/print/typescript.js | 120 +++++------- src/language-js/printer-estree-json.js | 14 +- src/language-js/printer-estree.js | 175 ++++++++---------- src/language-markdown/printer-markdown.js | 14 +- src/language-yaml/print/block.js | 2 +- .../print/flow-mapping-sequence.js | 2 +- src/language-yaml/print/mapping-item.js | 4 +- src/language-yaml/printer-yaml.js | 31 ++-- src/main/ast-to-doc.js | 124 +++++++------ 39 files changed, 483 insertions(+), 534 deletions(-) create mode 100644 changelog_unreleased/api/10557.md diff --git a/changelog_unreleased/api/10557.md b/changelog_unreleased/api/10557.md new file mode 100644 index 000000000..3e2afefcb --- /dev/null +++ b/changelog_unreleased/api/10557.md @@ -0,0 +1,35 @@ +#### Simplified `print` callback (#10557 by @fisker) + +The third argument of the `print` method of plugin printers (the `print` callback) has been updated. Its first argument can be a string or an array of strings now. + +To print the current node, call `print` without arguments: + +```diff + function print(path, options, print) { + const parts = []; + path.each((childPath) => { +- parts.push(print(childPath)); ++ parts.push(print()); + }, "children"); + return parts; + } +``` + +To print a property of the current node, use `"property"` or `["property"]`: + +```diff + function print(path, options, print) { +- return path.call(print, "property"); ++ return print("property"); + } +``` + +To print a sub-property of the current node, use `["property1", "property2"]`: + +```diff + function print(path, options, print) { + // print `node.child.child` +- return path.call(print, "child", "child"); ++ return print(["child", "child"]); + } +``` diff --git a/docs/plugins.md b/docs/plugins.md index 52b710b82..201d386b1 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -176,21 +176,28 @@ function print( path: AstPath, options: object, // Recursively print a child node - print: (path: AstPath) => Doc + print: (selector?: string | number | Array | AstPath) => Doc ): Doc; ``` -The `print` function is passed a `path` object, which can be used to access nodes in the AST via `path.getValue()`. It is also passed a persistent `options` object (which contains global options and which a plugin may mutate), and a `print` function used for making recursive calls. A basic `print` function might be as follows: +The `print` function is passed the following parameters: + +- **`path`**: An object, which can be used to access nodes in the AST. It’s a stack-like data structure that maintains the current state of the recursion. It is called “path” because it represents the path to the current node from the root of the AST. The current node is returned by `path.getValue()`. +- **`options`**: A persistent object, which contains global options and which a plugin may mutate to store contextual data. +- **`print`**: A callback for printing sub-nodes. This function contains the core printing logic that consists of steps whose implementation is provided by plugins. In particular, it calls the printer’s `print` function and passes itself to it. Thus, the two `print` functions – the one from the core and the one from the plugin – call each other while descending down the AST recursively. + +Here’s a simplified example to give an idea of what a typical implementation of `print` looks like: ```js -const { builders } = require("prettier").doc; +const { join } = require("prettier").doc.builders; function print(path, options, print) { const node = path.getValue(); if (Array.isArray(node)) { - return builders.concat(path.map(print)); + return join(", ", path.map(print)); } + return node.value; } ``` @@ -206,7 +213,7 @@ function embed( // Path to the current AST node path: AstPath, // Print a node with the current printer - print: (path: AstPath) => Doc, + print: (selector?: string | number | Array | AstPath) => Doc, // Parse and print some text using a different parser. // You should set `options.parser` to specify which parser to use. textToDoc: (text: string, options: object) => Doc, diff --git a/src/language-css/printer-postcss.js b/src/language-css/printer-postcss.js index 04a444456..11632ceed 100644 --- a/src/language-css/printer-postcss.js +++ b/src/language-css/printer-postcss.js @@ -115,7 +115,7 @@ function genericPrint(path, options, print) { } case "css-rule": { return [ - path.call(print, "selector"), + print("selector"), node.important ? " !important" : "", node.nodes ? [ @@ -143,8 +143,8 @@ function genericPrint(path, options, print) { const isColon = trimmedBetween === ":"; let value = hasComposesNode(node) - ? removeLines(path.call(print, "value")) - : path.call(print, "value"); + ? removeLines(print("value")) + : print("value"); if (!isColon && lastLineHasInlineComment(trimmedBetween)) { value = indent([hardline, dedent(value)]); @@ -157,7 +157,7 @@ function genericPrint(path, options, print) { trimmedBetween, node.extend ? "" : " ", isLessParser(options) && node.extend && node.selector - ? ["extend(", path.call(print, "selector"), ")"] + ? ["extend(", print("selector"), ")"] : "", value, node.raws.important @@ -201,7 +201,7 @@ function genericPrint(path, options, print) { if (isLessParser(options)) { if (node.mixin) { return [ - path.call(print, "selector"), + print("selector"), node.important ? " !important" : "", isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";", ]; @@ -210,7 +210,7 @@ function genericPrint(path, options, print) { if (node.function) { return [ node.name, - path.call(print, "params"), + print("params"), isTemplatePlaceholderNodeWithoutSemiColon ? "" : ";", ]; } @@ -220,7 +220,7 @@ function genericPrint(path, options, print) { "@", node.name, ": ", - node.value ? path.call(print, "value") : "", + node.value ? print("value") : "", node.raws.between.trim() ? node.raws.between.trim() + " " : "", node.nodes ? [ @@ -261,14 +261,14 @@ function genericPrint(path, options, print) { ? hardline : " " : " ", - path.call(print, "params"), + print("params"), ] : "", - node.selector ? indent([" ", path.call(print, "selector")]) : "", + node.selector ? indent([" ", print("selector")]) : "", node.value ? group([ " ", - path.call(print, "value"), + print("value"), isSCSSControlDirectiveNode(node) ? hasParensAroundNode(node) ? " " @@ -312,7 +312,7 @@ function genericPrint(path, options, print) { if (node.type === "media-query" && node.value === "") { return; } - parts.push(print(childPath)); + parts.push(print()); }, "nodes"); return group(indent(join(line, parts))); @@ -505,7 +505,7 @@ function genericPrint(path, options, print) { // postcss-values-parser case "value-value": case "value-root": { - return path.call(print, "group"); + return print("group"); } case "value-comment": { return options.originalText.slice(locStart(node), locEnd(node)); @@ -834,9 +834,9 @@ function genericPrint(path, options, print) { node.groups[0].groups[0].value.startsWith("data:"))) ) { return [ - node.open ? path.call(print, "open") : "", + node.open ? print("open") : "", join(",", path.map(print, "groups")), - node.close ? path.call(print, "close") : "", + node.close ? print("close") : "", ]; } @@ -862,14 +862,14 @@ function genericPrint(path, options, print) { const printed = group( [ - node.open ? path.call(print, "open") : "", + node.open ? print("open") : "", indent([ softline, join( [",", line], path.map((childPath) => { const node = childPath.getValue(); - const printed = print(childPath); + const printed = print(); // Key/Value pair in open paren already indented if ( @@ -899,7 +899,7 @@ function genericPrint(path, options, print) { : "" ), softline, - node.close ? path.call(print, "close") : "", + node.close ? print("close") : "", ], { shouldBreak: isSCSSMapItem && !isKey, @@ -914,7 +914,7 @@ function genericPrint(path, options, print) { insideAtRuleNode(path, "supports") && isMediaAndSupportsKeywords(node) ? " " : "", - path.call(print, "group"), + print("group"), ]; } case "value-paren": { @@ -989,7 +989,7 @@ function printNodeSequence(path, options, print) { options.originalText.slice(locStart(childNode), locEnd(childNode)) ); } else { - parts.push(print(pathChild)); + parts.push(print()); } if (i !== nodes.length - 1) { diff --git a/src/language-graphql/printer-graphql.js b/src/language-graphql/printer-graphql.js index a8bee421f..4e34eab8f 100644 --- a/src/language-graphql/printer-graphql.js +++ b/src/language-graphql/printer-graphql.js @@ -21,7 +21,7 @@ function genericPrint(path, options, print) { case "Document": { const parts = []; path.each((pathChild, index, definitions) => { - parts.push(print(pathChild)); + parts.push(print()); if (index !== definitions.length - 1) { parts.push(hardline); if ( @@ -38,7 +38,7 @@ function genericPrint(path, options, print) { const hasName = Boolean(node.name); return [ hasOperation ? node.operation : "", - hasOperation && hasName ? [" ", path.call(print, "name")] : "", + hasOperation && hasName ? [" ", print("name")] : "", isNonEmptyArray(node.variableDefinitions) ? group([ "(", @@ -55,13 +55,13 @@ function genericPrint(path, options, print) { : "", printDirectives(path, print, node), node.selectionSet ? (!hasOperation && !hasName ? "" : " ") : "", - path.call(print, "selectionSet"), + print("selectionSet"), ]; } case "FragmentDefinition": { return [ "fragment ", - path.call(print, "name"), + print("name"), isNonEmptyArray(node.variableDefinitions) ? group([ "(", @@ -77,10 +77,10 @@ function genericPrint(path, options, print) { ]) : "", " on ", - path.call(print, "typeCondition"), + print("typeCondition"), printDirectives(path, print, node), " ", - path.call(print, "selectionSet"), + print("selectionSet"), ]; } case "SelectionSet": { @@ -102,8 +102,8 @@ function genericPrint(path, options, print) { } case "Field": { return group([ - node.alias ? [path.call(print, "alias"), ": "] : "", - path.call(print, "name"), + node.alias ? [print("alias"), ": "] : "", + print("name"), node.arguments.length > 0 ? group([ "(", @@ -123,7 +123,7 @@ function genericPrint(path, options, print) { : "", printDirectives(path, print, node), node.selectionSet ? " " : "", - path.call(print, "selectionSet"), + print("selectionSet"), ]); } case "Name": { @@ -157,7 +157,7 @@ function genericPrint(path, options, print) { return "null"; } case "Variable": { - return ["$", path.call(print, "name")]; + return ["$", print("name")]; } case "ListValue": { return group([ @@ -188,13 +188,13 @@ function genericPrint(path, options, print) { } case "ObjectField": case "Argument": { - return [path.call(print, "name"), ": ", path.call(print, "value")]; + return [print("name"), ": ", print("value")]; } case "Directive": { return [ "@", - path.call(print, "name"), + print("name"), node.arguments.length > 0 ? group([ "(", @@ -216,15 +216,15 @@ function genericPrint(path, options, print) { } case "NamedType": { - return path.call(print, "name"); + return print("name"); } case "VariableDefinition": { return [ - path.call(print, "variable"), + print("variable"), ": ", - path.call(print, "type"), - node.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", + print("type"), + node.defaultValue ? [" = ", print("defaultValue")] : "", printDirectives(path, print, node), ]; } @@ -232,11 +232,11 @@ function genericPrint(path, options, print) { case "ObjectTypeExtension": case "ObjectTypeDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", - path.call(print, "name"), + print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", @@ -263,9 +263,9 @@ function genericPrint(path, options, print) { case "FieldDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", - path.call(print, "name"), + print("name"), node.arguments.length > 0 ? group([ "(", @@ -284,18 +284,18 @@ function genericPrint(path, options, print) { ]) : "", ": ", - path.call(print, "type"), + print("type"), printDirectives(path, print, node), ]; } case "DirectiveDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", "directive ", "@", - path.call(print, "name"), + print("name"), node.arguments.length > 0 ? group([ "(", @@ -322,11 +322,11 @@ function genericPrint(path, options, print) { case "EnumTypeExtension": case "EnumTypeDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", - path.call(print, "name"), + print("name"), printDirectives(path, print, node), node.values.length > 0 @@ -351,21 +351,21 @@ function genericPrint(path, options, print) { case "EnumValueDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", - path.call(print, "name"), + print("name"), printDirectives(path, print, node), ]; } case "InputValueDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? (node.description.block ? hardline : line) : "", - path.call(print, "name"), + print("name"), ": ", - path.call(print, "type"), - node.defaultValue ? [" = ", path.call(print, "defaultValue")] : "", + print("type"), + node.defaultValue ? [" = ", print("defaultValue")] : "", printDirectives(path, print, node), ]; } @@ -373,11 +373,11 @@ function genericPrint(path, options, print) { case "InputObjectTypeExtension": case "InputObjectTypeDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", - path.call(print, "name"), + print("name"), printDirectives(path, print, node), node.fields.length > 0 ? [ @@ -422,17 +422,17 @@ function genericPrint(path, options, print) { } case "OperationTypeDefinition": { - return [path.call(print, "operation"), ": ", path.call(print, "type")]; + return [print("operation"), ": ", print("type")]; } case "InterfaceTypeExtension": case "InterfaceTypeDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", - path.call(print, "name"), + print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path, options, print)] : "", @@ -458,32 +458,28 @@ function genericPrint(path, options, print) { } case "FragmentSpread": { - return [ - "...", - path.call(print, "name"), - printDirectives(path, print, node), - ]; + return ["...", print("name"), printDirectives(path, print, node)]; } case "InlineFragment": { return [ "...", - node.typeCondition ? [" on ", path.call(print, "typeCondition")] : "", + node.typeCondition ? [" on ", print("typeCondition")] : "", printDirectives(path, print, node), " ", - path.call(print, "selectionSet"), + print("selectionSet"), ]; } case "UnionTypeExtension": case "UnionTypeDefinition": { return group([ - path.call(print, "description"), + print("description"), node.description ? hardline : "", group([ node.kind === "UnionTypeExtension" ? "extend " : "", "union ", - path.call(print, "name"), + print("name"), printDirectives(path, print, node), node.types.length > 0 ? [ @@ -502,21 +498,21 @@ function genericPrint(path, options, print) { case "ScalarTypeExtension": case "ScalarTypeDefinition": { return [ - path.call(print, "description"), + print("description"), node.description ? hardline : "", node.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", - path.call(print, "name"), + print("name"), printDirectives(path, print, node), ]; } case "NonNullType": { - return [path.call(print, "type"), "!"]; + return [print("type"), "!"]; } case "ListType": { - return ["[", path.call(print, "type"), "]"]; + return ["[", print("type"), "]"]; } default: @@ -546,7 +542,7 @@ function printSequence(sequencePath, options, print) { const count = sequencePath.getValue().length; return sequencePath.map((path, i) => { - const printed = print(path); + const printed = print(); if ( isNextLineEmpty(options.originalText, path.getValue(), locEnd) && diff --git a/src/language-handlebars/printer-glimmer.js b/src/language-handlebars/printer-glimmer.js index f15a231ba..b01e12796 100644 --- a/src/language-handlebars/printer-glimmer.js +++ b/src/language-handlebars/printer-glimmer.js @@ -179,7 +179,7 @@ function print(path, options, print) { ).quote : ""; - const valueDoc = path.call(print, "value"); + const valueDoc = print("value"); return [ node.name, @@ -198,7 +198,7 @@ function print(path, options, print) { return join(line, path.map(print, "pairs")); } case "HashPair": { - return [node.key, "=", path.call(print, "value")]; + return [node.key, "=", print("value")]; } case "TextNode": { /* if `{{my-component}}` (or any text containing "{{") @@ -460,7 +460,7 @@ function printChildren(path, options, print) { } return path.map((childPath, childIndex) => { - const printedChild = print(childPath, options, print); + const printedChild = print(); if (childIndex === 0 && options.htmlWhitespaceSensitivity === "ignore") { return [softline, printedChild]; @@ -587,14 +587,14 @@ function printCloseBlock(path, print, options) { return [ escape, printClosingBlockOpeningMustache(node), - path.call(print, "path"), + print("path"), printClosingBlockClosingMustache(node), ]; } return [ printClosingBlockOpeningMustache(node), - path.call(print, "path"), + print("path"), printClosingBlockClosingMustache(node), ]; } @@ -626,7 +626,7 @@ function printProgram(path, print, options) { return ""; } - const program = path.call(print, "program"); + const program = print("program"); if (options.htmlWhitespaceSensitivity === "ignore") { return indent([hardline, program]); @@ -638,7 +638,7 @@ function printProgram(path, print, options) { function printInverse(path, print, options) { const node = path.getValue(); - const inverse = path.call(print, "inverse"); + const inverse = print("inverse"); const printed = options.htmlWhitespaceSensitivity === "ignore" ? [hardline, inverse] @@ -768,7 +768,7 @@ function printPathAndParams(path, print) { } function printPath(path, print) { - return path.call(print, "path"); + return print("path"); } function printParams(path, print) { @@ -781,7 +781,7 @@ function printParams(path, print) { } if (node.hash && node.hash.pairs.length > 0) { - const hash = path.call(print, "hash"); + const hash = print("hash"); parts.push(hash); } diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index fa4930359..553329d0f 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -546,7 +546,7 @@ function printChildren(path, options, print) { ]; } - return print(childPath); + return print(); } function printBetweenLine(prevNode, nextNode) { @@ -666,7 +666,7 @@ function printAttributes(path, options, print) { options.originalText.slice(locStart(attribute), locEnd(attribute)), literalline ) - : print(attributePath); + : print(); }, "attrs"); const forceNotToBreakAttrContent = diff --git a/src/language-js/print/angular.js b/src/language-js/print/angular.js index f4a8bb754..aac03f3ec 100644 --- a/src/language-js/print/angular.js +++ b/src/language-js/print/angular.js @@ -13,7 +13,7 @@ function printAngular(path, options, print) { switch (node.type) { case "NGRoot": return [ - path.call(print, "node"), + print("node"), !hasComment(node.node) ? "" : " //" + getComments(node.node)[0].value.trimEnd(), @@ -26,9 +26,7 @@ function printAngular(path, options, print) { [";", line], path.map( (childPath) => - hasNgSideEffect(childPath) - ? print(childPath) - : ["(", print(childPath), ")"], + hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions" ) ) @@ -45,7 +43,7 @@ function printAngular(path, options, print) { : isNgForOf(childPath.getValue(), index, node) ? " " : [";", line], - print(childPath), + print(), ], "body" ); @@ -55,8 +53,8 @@ function printAngular(path, options, print) { : JSON.stringify(node.name); case "NGMicrosyntaxExpression": return [ - path.call(print, "expression"), - node.alias === null ? "" : [" as ", path.call(print, "alias")], + print("expression"), + node.alias === null ? "" : [" as ", print("alias")], ]; case "NGMicrosyntaxKeyedExpression": { const index = path.getName(); @@ -72,19 +70,19 @@ function printAngular(path, options, print) { parentNode.body[index - 1].key.name === "then")) && parentNode.body[0].type === "NGMicrosyntaxExpression"); return [ - path.call(print, "key"), + print("key"), shouldNotPrintColon ? " " : ": ", - path.call(print, "expression"), + print("expression"), ]; } case "NGMicrosyntaxLet": return [ "let ", - path.call(print, "key"), - node.value === null ? "" : [" = ", path.call(print, "value")], + print("key"), + node.value === null ? "" : [" = ", print("value")], ]; case "NGMicrosyntaxAs": - return [path.call(print, "key"), " as ", path.call(print, "alias")]; + return [print("key"), " as ", print("alias")]; } } diff --git a/src/language-js/print/array.js b/src/language-js/print/array.js index 0f06dae53..5d07163b5 100644 --- a/src/language-js/print/array.js +++ b/src/language-js/print/array.js @@ -147,7 +147,7 @@ function printArrayItems(path, options, printPath, print) { let separatorParts = []; path.each((childPath) => { - printedElements.push(separatorParts, group(print(childPath))); + printedElements.push(separatorParts, group(print())); separatorParts = [",", line]; if ( @@ -167,7 +167,7 @@ function printArrayItemsConcisely(path, options, print, trailingComma) { path.each((childPath, i, elements) => { const isLast = i === elements.length - 1; - parts.push([print(childPath), isLast ? trailingComma : ","]); + parts.push([print(), isLast ? trailingComma : ","]); if (!isLast) { parts.push( diff --git a/src/language-js/print/assignment.js b/src/language-js/print/assignment.js index 139a7e3a7..a72c952ae 100644 --- a/src/language-js/print/assignment.js +++ b/src/language-js/print/assignment.js @@ -27,10 +27,7 @@ function printAssignment( ) { const layout = chooseLayout(path, options, leftDoc, rightPropertyName); - const rightDoc = path.call( - (p) => print(p, { assignmentLayout: layout }), - rightPropertyName - ); + const rightDoc = print(rightPropertyName, { assignmentLayout: layout }); switch (layout) { // First break after operator, then the sides are broken independently on their own lines @@ -74,21 +71,14 @@ function printAssignmentExpression(path, options, print) { path, options, print, - path.call(print, "left"), + print("left"), [" ", node.operator], "right" ); } function printVariableDeclarator(path, options, print) { - return printAssignment( - path, - options, - print, - path.call(print, "id"), - " =", - "init" - ); + return printAssignment(path, options, print, print("id"), " =", "init"); } function chooseLayout(path, options, leftDoc, rightPropertyName) { diff --git a/src/language-js/print/binaryish.js b/src/language-js/print/binaryish.js index 01848d327..632b14829 100644 --- a/src/language-js/print/binaryish.js +++ b/src/language-js/print/binaryish.js @@ -217,7 +217,7 @@ function printBinaryishExpressions( ), ]; } else { - parts.push(group(path.call(print, "left"))); + parts.push(group(print("left"))); } const shouldInline = shouldInlineLogicalExpression(node); @@ -243,12 +243,12 @@ function printBinaryishExpressions( : ""; const right = shouldInline - ? [operator, " ", path.call(print, "right"), rightSuffix] + ? [operator, " ", print("right"), rightSuffix] : [ lineBeforeOperator ? line : "", operator, lineBeforeOperator ? " " : line, - path.call(print, "right"), + print("right"), rightSuffix, ]; @@ -285,7 +285,7 @@ function printBinaryishExpressions( } } else { // Our stopping case. Simply print the node normally. - parts.push(group(print(path))); + parts.push(group(print())); } return parts; diff --git a/src/language-js/print/block.js b/src/language-js/print/block.js index 46c5f714f..d120564a2 100644 --- a/src/language-js/print/block.js +++ b/src/language-js/print/block.js @@ -75,7 +75,7 @@ function printBlockBody(path, options, print) { // Babel 6 if (nodeHasDirectives) { path.each((childPath, index, directives) => { - parts.push(print(childPath)); + parts.push(print()); if (index < directives.length - 1 || nodeHasBody || nodeHasComment) { parts.push(hardline); if (isNextLineEmpty(childPath.getValue(), options)) { diff --git a/src/language-js/print/call-arguments.js b/src/language-js/print/call-arguments.js index 77e5aa492..d87bf8b1b 100644 --- a/src/language-js/print/call-arguments.js +++ b/src/language-js/print/call-arguments.js @@ -48,13 +48,7 @@ function printCallArguments(path, options, print) { // useEffect(() => { ... }, [foo, bar, baz]) if (isReactHookCallWithDepsArray(args)) { - return [ - "(", - path.call(print, "arguments", 0), - ", ", - path.call(print, "arguments", 1), - ")", - ]; + return ["(", print(["arguments", 0]), ", ", print(["arguments", 1]), ")"]; } // func( @@ -76,8 +70,8 @@ function printCallArguments(path, options, print) { } let shouldBreak = false; - iterateFunctionParametersPath(argPath, (parameterPath) => { - shouldBreak = shouldBreak || willBreak(print(parameterPath)); + iterateFunctionParametersPath(argPath, () => { + shouldBreak = shouldBreak || willBreak(print()); }); return shouldBreak; @@ -90,7 +84,7 @@ function printCallArguments(path, options, print) { const printedArguments = []; iterateCallArgumentsPath(path, (argPath, index) => { const arg = argPath.getNode(); - const parts = [print(argPath)]; + const parts = [print()]; if (index === lastArgIndex) { // do nothing @@ -150,7 +144,7 @@ function printCallArguments(path, options, print) { if (shouldGroupFirst && i === 0) { printedExpanded = [ [ - print(argPath, { expandFirstArg: true }), + print([], { expandFirstArg: true }), printedArguments.length > 1 ? "," : "", hasEmptyLineFollowingFirstArg ? hardline : line, hasEmptyLineFollowingFirstArg ? hardline : "", @@ -161,7 +155,7 @@ function printCallArguments(path, options, print) { if (shouldGroupLast && i === args.length - 1) { printedExpanded = [ ...printedArguments.slice(0, -1), - print(argPath, { expandLastArg: true }), + print([], { expandLastArg: true }), ]; } }); diff --git a/src/language-js/print/call-expression.js b/src/language-js/print/call-expression.js index 8146c5b8d..81962434e 100644 --- a/src/language-js/print/call-expression.js +++ b/src/language-js/print/call-expression.js @@ -41,12 +41,12 @@ function printCallExpression(path, options, print) { (!isNew && isTestCall(node, parentNode))) ) { const printed = []; - iterateCallArgumentsPath(path, (argPath) => { - printed.push(print(argPath)); + iterateCallArgumentsPath(path, () => { + printed.push(print()); }); return [ isNew ? "new " : "", - path.call(print, "callee"), + print("callee"), optional, printFunctionTypeParameters(path, options, print), "(", @@ -83,7 +83,7 @@ function printCallExpression(path, options, print) { const contents = [ isNew ? "new " : "", - isDynamicImport ? "import" : path.call(print, "callee"), + isDynamicImport ? "import" : print("callee"), optional, isIdentifierWithFlowAnnotation ? `/*:: ${node.callee.trailingComments[0].value.slice(2).trim()} */` diff --git a/src/language-js/print/class.js b/src/language-js/print/class.js index f7f04dce3..aaaa80fba 100644 --- a/src/language-js/print/class.js +++ b/src/language-js/print/class.js @@ -40,16 +40,16 @@ function printClass(path, options, print) { const extendsParts = []; if (node.id) { - partsGroup.push(" ", path.call(print, "id")); + partsGroup.push(" ", print("id")); } - partsGroup.push(path.call(print, "typeParameters")); + partsGroup.push(print("typeParameters")); if (node.superClass) { const printed = [ "extends ", printSuperClass(path, options, print), - path.call(print, "superTypeParameters"), + print("superTypeParameters"), ]; const printedWithComments = path.call( (superClass) => printComments(superClass, printed, options), @@ -81,7 +81,7 @@ function printClass(path, options, print) { parts.push(...partsGroup, ...extendsParts); } - parts.push(" ", path.call(print, "body")); + parts.push(" ", print("body")); return parts; } @@ -137,7 +137,7 @@ function printList(path, options, print, listName) { } function printSuperClass(path, options, print) { - const printed = path.call(print, "superClass"); + const printed = print("superClass"); const parent = path.getParentNode(); if (parent.type === "AssignmentExpression") { return group( @@ -202,7 +202,7 @@ function printClassProperty(path, options, print) { parts.push("readonly "); } if (node.variance) { - parts.push(path.call(print, "variance")); + parts.push(print("variance")); } parts.push( printPropertyKey(path, options, print), diff --git a/src/language-js/print/flow.js b/src/language-js/print/flow.js index ef0cb40be..a64563810 100644 --- a/src/language-js/print/flow.js +++ b/src/language-js/print/flow.js @@ -27,27 +27,27 @@ function printFlow(path, options, print) { case "DeclareFunction": return printFlowDeclaration(path, [ "function ", - path.call(print, "id"), + print("id"), node.predicate ? " " : "", - path.call(print, "predicate"), + print("predicate"), semi, ]); case "DeclareModule": return printFlowDeclaration(path, [ "module ", - path.call(print, "id"), + print("id"), " ", - path.call(print, "body"), + print("body"), ]); case "DeclareModuleExports": return printFlowDeclaration(path, [ "module.exports", ": ", - path.call(print, "typeAnnotation"), + print("typeAnnotation"), semi, ]); case "DeclareVariable": - return printFlowDeclaration(path, ["var ", path.call(print, "id"), semi]); + return printFlowDeclaration(path, ["var ", print("id"), semi]); case "DeclareOpaqueType": return printFlowDeclaration(path, printOpaqueType(path, options, print)); case "DeclareInterface": @@ -78,13 +78,13 @@ function printFlow(path, options, print) { return printTupleType(path, options, print); case "GenericTypeAnnotation": return [ - path.call(print, "id"), + print("id"), printTypeParameters(path, options, print, "typeParameters"), ]; // Type Annotations for Facebook Flow, typically stripped out or // transformed away before printing. case "TypeAnnotation": - return path.call(print, "typeAnnotation"); + return print("typeAnnotation"); } } diff --git a/src/language-js/print/function-parameters.js b/src/language-js/print/function-parameters.js index d8a6e3c17..e80c7add1 100644 --- a/src/language-js/print/function-parameters.js +++ b/src/language-js/print/function-parameters.js @@ -65,7 +65,7 @@ function printFunctionParameters( if (isLastParameter && functionNode.rest) { printed.push("..."); } - printed.push(print(parameterPath)); + printed.push(print()); if (isLastParameter) { return; } diff --git a/src/language-js/print/function.js b/src/language-js/print/function.js index 9318700b7..0331e6bb8 100644 --- a/src/language-js/print/function.js +++ b/src/language-js/print/function.js @@ -69,7 +69,7 @@ function printFunctionDeclaration(path, print, options, expandArg) { } if (node.id) { - parts.push(path.call(print, "id")); + parts.push(print("id")); } const parametersDoc = printFunctionParameters( @@ -91,7 +91,7 @@ function printFunctionDeclaration(path, print, options, expandArg) { returnTypeDoc, ]), node.body ? " " : "", - path.call(print, "body") + print("body") ); if (options.semi && (node.declare || !node.body)) { @@ -134,7 +134,7 @@ function printMethod(path, options, print) { path.call((path) => printMethodInternal(path, options, print), "value") ); } else { - parts.push(path.call(print, "value")); + parts.push(print("value")); } return parts; @@ -157,7 +157,7 @@ function printMethodInternal(path, options, print) { ]; if (node.body) { - parts.push(" ", path.call(print, "body")); + parts.push(" ", print("body")); } else { parts.push(options.semi ? ";" : ""); } @@ -174,7 +174,7 @@ function printArrowFunctionSignature(path, options, print, args) { } if (shouldPrintParamsWithoutParens(path, options)) { - parts.push(path.call(print, "params", 0)); + parts.push(print(["params", 0])); } else { parts.push( group([ @@ -257,7 +257,7 @@ function printArrowFunctionExpression(path, options, print, args) { const body = []; let chainShouldBreak = false; - (function rec(path) { + (function rec() { const doc = printArrowFunctionSignature(path, options, print, args); if (signatures.length === 0) { signatures.push(doc); @@ -278,12 +278,12 @@ function printArrowFunctionExpression(path, options, print, args) { node.body.type !== "ArrowFunctionExpression" || (args && args.expandLastArg) ) { - body.unshift(path.call((bodyPath) => print(bodyPath, args), "body")); + body.unshift(print("body", args)); } else { node = node.body; path.call(rec, "body"); } - })(path); + })(); if (signatures.length > 1) { return printArrowChain( @@ -390,7 +390,7 @@ function shouldPrintParamsWithoutParens(path, options) { function printReturnType(path, print, options) { const node = path.getValue(); - const returnType = path.call(print, "returnType"); + const returnType = print("returnType"); if ( node.returnType && @@ -409,7 +409,7 @@ function printReturnType(path, print, options) { if (node.predicate) { // The return type will already add the colon, but otherwise we // need to do it ourselves - parts.push(node.returnType ? " " : ": ", path.call(print, "predicate")); + parts.push(node.returnType ? " " : ": ", print("predicate")); } return parts; @@ -423,12 +423,7 @@ function printReturnAndThrowArgument(path, options, print) { if (node.argument) { if (returnArgumentHasLeadingComment(options, node.argument)) { - parts.push([ - " (", - indent([hardline, path.call(print, "argument")]), - hardline, - ")", - ]); + parts.push([" (", indent([hardline, print("argument")]), hardline, ")"]); } else if ( isBinaryish(node.argument) || node.argument.type === "SequenceExpression" @@ -436,13 +431,13 @@ function printReturnAndThrowArgument(path, options, print) { parts.push( group([ ifBreak(" (", " "), - indent([softline, path.call(print, "argument")]), + indent([softline, print("argument")]), softline, ifBreak(")"), ]) ); } else { - parts.push(" ", path.call(print, "argument")); + parts.push(" ", print("argument")); } } diff --git a/src/language-js/print/interface.js b/src/language-js/print/interface.js index 21a887c8b..d8bfcd0d4 100644 --- a/src/language-js/print/interface.js +++ b/src/language-js/print/interface.js @@ -28,11 +28,7 @@ function printInterface(path, options, print) { const extendsParts = []; if (node.type !== "InterfaceTypeAnnotation") { - partsGroup.push( - " ", - path.call(print, "id"), - path.call(print, "typeParameters") - ); + partsGroup.push(" ", print("id"), print("typeParameters")); } const shouldIndentOnlyHeritageClauses = @@ -69,7 +65,7 @@ function printInterface(path, options, print) { parts.push(...partsGroup, ...extendsParts); } - parts.push(" ", path.call(print, "body")); + parts.push(" ", print("body")); return group(parts); } diff --git a/src/language-js/print/jsx.js b/src/language-js/print/jsx.js index ec8b2f4bf..57150c9b2 100644 --- a/src/language-js/print/jsx.js +++ b/src/language-js/print/jsx.js @@ -60,20 +60,17 @@ function printJsxElementInternal(path, options, print) { const node = path.getValue(); if (node.type === "JSXElement" && isEmptyJsxElement(node)) { - return [ - path.call(print, "openingElement"), - path.call(print, "closingElement"), - ]; + return [print("openingElement"), print("closingElement")]; } const openingLines = node.type === "JSXElement" - ? path.call(print, "openingElement") - : path.call(print, "openingFragment"); + ? print("openingElement") + : print("openingFragment"); const closingLines = node.type === "JSXElement" - ? path.call(print, "closingElement") - : path.call(print, "closingFragment"); + ? print("closingElement") + : print("closingFragment"); if ( node.children.length === 1 && @@ -360,7 +357,7 @@ function printJsxChildren( parts.push("", jsxWhitespace); } } else { - const printedChild = print(childPath); + const printedChild = print(); parts.push(printedChild); const next = children[i + 1]; @@ -473,7 +470,7 @@ function maybeWrapJsxElementInParens(path, elem, options) { function printJsxAttribute(path, options, print) { const node = path.getValue(); const parts = []; - parts.push(path.call(print, "name")); + parts.push(print("name")); if (node.value) { let res; @@ -489,7 +486,7 @@ function printJsxAttribute(path, options, print) { final = final.slice(1, -1).replace(new RegExp(quote, "g"), escape); res = [quote, final, quote]; } else { - res = path.call(print, "value"); + res = print("value"); } parts.push("=", res); } @@ -517,17 +514,12 @@ function printJsxExpressionContainer(path, options, print) { isBinaryish(node.expression))))); if (shouldInline) { - return group([ - "{", - path.call(print, "expression"), - lineSuffixBoundary, - "}", - ]); + return group(["{", print("expression"), lineSuffixBoundary, "}"]); } return group([ "{", - indent([softline, path.call(print, "expression")]), + indent([softline, print("expression")]), softline, lineSuffixBoundary, "}", @@ -543,12 +535,7 @@ function printJsxOpeningElement(path, options, print) { // Don't break self-closing elements with no attributes and no comments if (node.selfClosing && node.attributes.length === 0 && !nameHasComments) { - return [ - "<", - path.call(print, "name"), - path.call(print, "typeParameters"), - " />", - ]; + return ["<", print("name"), print("typeParameters"), " />"]; } // don't break up opening elements with a single long text attribute @@ -572,8 +559,8 @@ function printJsxOpeningElement(path, options, print) { ) { return group([ "<", - path.call(print, "name"), - path.call(print, "typeParameters"), + print("name"), + print("typeParameters"), " ", ...path.map(print, "attributes"), node.selfClosing ? " />" : ">", @@ -613,10 +600,9 @@ function printJsxOpeningElement(path, options, print) { return group( [ "<", - path.call(print, "name"), - path.call(print, "typeParameters"), - - indent(path.map((attr) => [line, print(attr)], "attributes")), + print("name"), + print("typeParameters"), + indent(path.map(() => [line, print()], "attributes")), node.selfClosing ? line : bracketSameLine ? ">" : softline, node.selfClosing ? "/>" : bracketSameLine ? "" : ">", ], @@ -630,7 +616,7 @@ function printJsxClosingElement(path, options, print) { parts.push(" { - const printed = ["...", print(p)]; + const printed = ["...", print()]; const node = p.getValue(); if (!hasComment(node) || !willPrintOwnComments(p)) { return printed; @@ -718,15 +704,9 @@ function printJsx(path, options, print) { case "JSXIdentifier": return String(node.name); case "JSXNamespacedName": - return join(":", [ - path.call(print, "namespace"), - path.call(print, "name"), - ]); + return join(":", [print("namespace"), print("name")]); case "JSXMemberExpression": - return join(".", [ - path.call(print, "object"), - path.call(print, "property"), - ]); + return join(".", [print("object"), print("property")]); case "JSXSpreadAttribute": return printJsxSpreadAttribute(path, options, print); case "JSXSpreadChild": { diff --git a/src/language-js/print/member-chain.js b/src/language-js/print/member-chain.js index 6040db191..017d17a59 100644 --- a/src/language-js/print/member-chain.js +++ b/src/language-js/print/member-chain.js @@ -135,7 +135,7 @@ function printMemberChain(path, options, print) { } else { printedNodes.unshift({ node, - printed: print(path), + printed: print(), }); } } diff --git a/src/language-js/print/member.js b/src/language-js/print/member.js index d87339377..93bc9a995 100644 --- a/src/language-js/print/member.js +++ b/src/language-js/print/member.js @@ -33,7 +33,7 @@ function printMemberExpression(path, options, print) { !isMemberExpression(parent)); return [ - path.call(print, "object"), + print("object"), shouldInline ? printMemberLookup(path, options, print) : group(indent([softline, printMemberLookup(path, options, print)])), @@ -41,7 +41,7 @@ function printMemberExpression(path, options, print) { } function printMemberLookup(path, options, print) { - const property = path.call(print, "property"); + const property = print("property"); const node = path.getValue(); const optional = printOptionalToken(path); diff --git a/src/language-js/print/misc.js b/src/language-js/print/misc.js index 6bfd54cff..417f55188 100644 --- a/src/language-js/print/misc.js +++ b/src/language-js/print/misc.js @@ -28,10 +28,10 @@ function printOptionalToken(path) { function printFunctionTypeParameters(path, options, print) { const fun = path.getValue(); if (fun.typeArguments) { - return path.call(print, "typeArguments"); + return print("typeArguments"); } if (fun.typeParameters) { - return path.call(print, "typeParameters"); + return print("typeParameters"); } return ""; } @@ -53,17 +53,17 @@ function printTypeAnnotation(path, options, print) { parentNode.type === "DeclareFunction" && parentNode.id === node; if (isFlowAnnotationComment(options.originalText, node.typeAnnotation)) { - return [" /*: ", path.call(print, "typeAnnotation"), " */"]; + return [" /*: ", print("typeAnnotation"), " */"]; } return [ isFunctionDeclarationIdentifier ? "" : isDefinite ? "!: " : ": ", - path.call(print, "typeAnnotation"), + print("typeAnnotation"), ]; } function printBindExpressionCallee(path, options, print) { - return ["::", path.call(print, "callee")]; + return ["::", print("callee")]; } function printTypeScriptModifiers(path, options, print) { diff --git a/src/language-js/print/module.js b/src/language-js/print/module.js index 4719e3880..a32b495ed 100644 --- a/src/language-js/print/module.js +++ b/src/language-js/print/module.js @@ -78,7 +78,7 @@ function printExportDeclaration(path, options, print) { } if (declaration) { - parts.push(" ", path.call(print, "declaration")); + parts.push(" ", print("declaration")); } else { parts.push( exportKind === "type" ? " type" : "", @@ -112,7 +112,7 @@ function printExportAllDeclaration(path, options, print) { parts.push(" *"); if (exported) { - parts.push(" as ", path.call(print, "exported")); + parts.push(" as ", print("exported")); } parts.push( @@ -163,7 +163,7 @@ function printModuleSource(path, options, print) { if (!shouldNotPrintSpecifiers(node, options)) { parts.push(" from"); } - parts.push(" ", path.call(print, "source")); + parts.push(" ", print("source")); return parts; } @@ -182,7 +182,7 @@ function printModuleSpecifiers(path, options, print) { const standaloneSpecifiers = []; const groupedSpecifiers = []; - path.each((specifierPath) => { + path.each(() => { const specifierType = path.getValue().type; if ( specifierType === "ExportNamespaceSpecifier" || @@ -190,12 +190,12 @@ function printModuleSpecifiers(path, options, print) { specifierType === "ImportNamespaceSpecifier" || specifierType === "ImportDefaultSpecifier" ) { - standaloneSpecifiers.push(print(specifierPath)); + standaloneSpecifiers.push(print()); } else if ( specifierType === "ExportSpecifier" || specifierType === "ImportSpecifier" ) { - groupedSpecifiers.push(print(specifierPath)); + groupedSpecifiers.push(print()); } else { /* istanbul ignore next */ throw new Error( @@ -297,7 +297,7 @@ function printModuleSpecifier(path, options, print) { ) { left = "*"; } else if (node[leftSideProperty]) { - left = path.call(print, leftSideProperty); + left = print(leftSideProperty); } if ( @@ -306,7 +306,7 @@ function printModuleSpecifier(path, options, print) { // import {a as a} from '.' !hasSameLoc(node[leftSideProperty], node[rightSideProperty])) ) { - right = path.call(print, rightSideProperty); + right = print(rightSideProperty); } parts.push(left, left && right ? " as " : "", right); diff --git a/src/language-js/print/object.js b/src/language-js/print/object.js index 61f73a41d..ac66f587d 100644 --- a/src/language-js/print/object.js +++ b/src/language-js/print/object.js @@ -103,7 +103,7 @@ function printObject(path, options, print) { const node = childPath.getValue(); propsAndLoc.push({ node, - printed: print(childPath), + printed: print(), loc: locStart(node), }); }, field); diff --git a/src/language-js/print/property.js b/src/language-js/print/property.js index 9601e6eb2..b598c2c93 100644 --- a/src/language-js/print/property.js +++ b/src/language-js/print/property.js @@ -17,7 +17,7 @@ function printPropertyKey(path, options, print) { const node = path.getNode(); if (node.computed) { - return ["[", path.call(print, "key"), "]"]; + return ["[", print("key"), "]"]; } const parent = path.getParentNode(); @@ -25,7 +25,7 @@ function printPropertyKey(path, options, print) { // flow has `Identifier` key, other parsers use `PrivateIdentifier` (ESTree) or `PrivateName` if (node.type === "ClassPrivateProperty" && key.type === "Identifier") { - return ["#", path.call(print, "key")]; + return ["#", print("key")]; } if (options.quoteProps === "consistent" && !needsQuoteProps.has(parent)) { @@ -86,13 +86,13 @@ function printPropertyKey(path, options, print) { ); } - return path.call(print, "key"); + return print("key"); } function printProperty(path, options, print) { const node = path.getValue(); if (node.shorthand) { - return path.call(print, "value"); + return print("value"); } return printAssignment( diff --git a/src/language-js/print/statement.js b/src/language-js/print/statement.js index a737ed5af..76365ec21 100644 --- a/src/language-js/print/statement.js +++ b/src/language-js/print/statement.js @@ -35,7 +35,7 @@ function printStatementSequence(path, options, print, property) { return; } - const printed = print(path); + const printed = print(); // in no-semi mode, prepend statement with semicolon if it might break ASI // don't prepend the only JSX element in a program with semicolon @@ -46,7 +46,7 @@ function printStatementSequence(path, options, print, property) { statementNeedsASIProtection(path, options) ) { if (hasComment(node, CommentCheckFlags.Leading)) { - parts.push(print(path, { needsSemi: true })); + parts.push(print([], { needsSemi: true })); } else { parts.push(";", printed); } diff --git a/src/language-js/print/template-literal.js b/src/language-js/print/template-literal.js index 9e42c5cf3..cfa61da53 100644 --- a/src/language-js/print/template-literal.js +++ b/src/language-js/print/template-literal.js @@ -61,7 +61,7 @@ function printTemplateLiteral(path, print, options) { path.each((childPath) => { const i = childPath.getName(); - parts.push(print(childPath)); + parts.push(print()); if (i < expressions.length) { // For a template literal of the following form: @@ -202,7 +202,7 @@ function printJestEachTemplateLiteral(path, options, print) { function printTemplateExpression(path, print) { const node = path.getValue(); - let printed = print(path); + let printed = print(); if (hasComment(node)) { printed = group([indent([softline, printed]), softline]); } diff --git a/src/language-js/print/ternary.js b/src/language-js/print/ternary.js index 91202114f..4bd00ade0 100644 --- a/src/language-js/print/ternary.js +++ b/src/language-js/print/ternary.js @@ -116,14 +116,8 @@ function printTernaryTest(path, options, print) { const parent = path.getParentNode(); const printed = isConditionalExpression - ? path.call(print, "test") - : [ - path.call(print, "checkType"), - " ", - "extends", - " ", - path.call(print, "extendsType"), - ]; + ? print("test") + : [print("checkType"), " ", "extends", " ", print("extendsType")]; /** * a * ? b @@ -275,12 +269,12 @@ function printTernary(path, options, print) { parts.push( " ? ", isNil(consequentNode) - ? path.call(print, consequentNodePropertyName) - : wrap(path.call(print, consequentNodePropertyName)), + ? print(consequentNodePropertyName) + : wrap(print(consequentNodePropertyName)), " : ", alternateNode.type === node.type || isNil(alternateNode) - ? path.call(print, alternateNodePropertyName) - : wrap(path.call(print, alternateNodePropertyName)) + ? print(alternateNodePropertyName) + : wrap(print(alternateNodePropertyName)) ); } else { // normal mode @@ -288,13 +282,13 @@ function printTernary(path, options, print) { line, "? ", consequentNode.type === node.type ? ifBreak("", "(") : "", - align(2, path.call(print, consequentNodePropertyName)), + align(2, print(consequentNodePropertyName)), consequentNode.type === node.type ? ifBreak("", ")") : "", line, ": ", alternateNode.type === node.type - ? path.call(print, alternateNodePropertyName) - : align(2, path.call(print, alternateNodePropertyName)), + ? print(alternateNodePropertyName) + : align(2, print(alternateNodePropertyName)), ]; parts.push( parent.type !== node.type || diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js index 0b8972dfa..9f67f3cf9 100644 --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -56,18 +56,14 @@ function printOpaqueType(path, options, print) { const semi = options.semi ? ";" : ""; const node = path.getValue(); const parts = []; - parts.push( - "opaque type ", - path.call(print, "id"), - path.call(print, "typeParameters") - ); + parts.push("opaque type ", print("id"), print("typeParameters")); if (node.supertype) { - parts.push(": ", path.call(print, "supertype")); + parts.push(": ", print("supertype")); } if (node.impltype) { - parts.push(" = ", path.call(print, "impltype")); + parts.push(" = ", print("impltype")); } parts.push(semi); @@ -82,11 +78,7 @@ function printTypeAlias(path, options, print) { if (node.declare) { parts.push("declare "); } - parts.push( - "type ", - path.call(print, "id"), - path.call(print, "typeParameters") - ); + parts.push("type ", print("id"), print("typeParameters")); const rightPropertyName = node.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right"; return [ @@ -169,7 +161,7 @@ function printUnionType(path, options, print) { // // comment // | child2 const printed = path.map((typePath) => { - let printedType = print(typePath); + let printedType = print(); if (!shouldHug) { printedType = align(2, printedType); } @@ -264,9 +256,9 @@ function printFunctionType(path, options, print) { node.returnType || node.predicate || node.typeAnnotation ? [ isArrowFunctionTypeAnnotation ? " => " : ": ", - path.call(print, "returnType"), - path.call(print, "predicate"), - path.call(print, "typeAnnotation"), + print("returnType"), + print("predicate"), + print("typeAnnotation"), ] : ""; diff --git a/src/language-js/print/type-parameters.js b/src/language-js/print/type-parameters.js index 343cef382..f9aeaa334 100644 --- a/src/language-js/print/type-parameters.js +++ b/src/language-js/print/type-parameters.js @@ -26,7 +26,7 @@ function printTypeParameters(path, options, print, paramsKey) { // for TypeParameterDeclaration typeParameters is a single node if (!Array.isArray(node[paramsKey])) { - return path.call(print, paramsKey); + return print(paramsKey); } const grandparent = path.getNode(2); @@ -97,14 +97,14 @@ function printTypeParameter(path, options, print) { const parts = []; const parent = path.getParentNode(); if (parent.type === "TSMappedType") { - parts.push("[", path.call(print, "name")); + parts.push("[", print("name")); if (node.constraint) { - parts.push(" in ", path.call(print, "constraint")); + parts.push(" in ", print("constraint")); } if (parent.nameType) { parts.push( " as ", - path.callParent((path) => path.call(print, "nameType")) + path.callParent(() => print("nameType")) ); } parts.push("]"); @@ -112,21 +112,21 @@ function printTypeParameter(path, options, print) { } if (node.variance) { - parts.push(path.call(print, "variance")); + parts.push(print("variance")); } - parts.push(path.call(print, "name")); + parts.push(print("name")); if (node.bound) { - parts.push(": ", path.call(print, "bound")); + parts.push(": ", print("bound")); } if (node.constraint) { - parts.push(" extends ", path.call(print, "constraint")); + parts.push(" extends ", print("constraint")); } if (node.default) { - parts.push(" = ", path.call(print, "default")); + parts.push(" = ", print("default")); } return parts; diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index c49a818e9..7ed4214e7 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -62,31 +62,31 @@ function printTypescript(path, options, print) { const castGroup = group([ "<", - indent([softline, path.call(print, "typeAnnotation")]), + indent([softline, print("typeAnnotation")]), softline, ">", ]); const exprContents = [ ifBreak("("), - indent([softline, path.call(print, "expression")]), + indent([softline, print("expression")]), softline, ifBreak(")"), ]; if (shouldBreakAfterCast) { return conditionalGroup([ - [castGroup, path.call(print, "expression")], + [castGroup, print("expression")], [castGroup, group(exprContents, { shouldBreak: true })], - [castGroup, path.call(print, "expression")], + [castGroup, print("expression")], ]); } - return group([castGroup, path.call(print, "expression")]); + return group([castGroup, print("expression")]); } case "TSDeclareFunction": return printFunctionDeclaration(path, print, options); case "TSExportAssignment": - return ["export = ", path.call(print, "expression"), semi]; + return ["export = ", print("expression"), semi]; case "TSModuleBlock": return printBlock(path, options, print); case "TSInterfaceBody": @@ -95,7 +95,7 @@ function printTypescript(path, options, print) { case "TSTypeAliasDeclaration": return printTypeAlias(path, options, print); case "TSQualifiedName": - return join(".", [path.call(print, "left"), path.call(print, "right")]); + return join(".", [print("left"), print("right")]); case "TSAbstractMethodDefinition": case "TSDeclareMethod": return printClassMethod(path, options, print); @@ -103,10 +103,10 @@ function printTypescript(path, options, print) { return printClassProperty(path, options, print); case "TSInterfaceHeritage": case "TSExpressionWithTypeArguments": // Babel AST - parts.push(path.call(print, "expression")); + parts.push(print("expression")); if (node.typeParameters) { - parts.push(path.call(print, "typeParameters")); + parts.push(print("typeParameters")); } return parts; @@ -114,22 +114,19 @@ function printTypescript(path, options, print) { return printTemplateLiteral(path, print, options); case "TSNamedTupleMember": return [ - path.call(print, "label"), + print("label"), node.optional ? "?" : "", ": ", - path.call(print, "elementType"), + print("elementType"), ]; case "TSRestType": - return ["...", path.call(print, "typeAnnotation")]; + return ["...", print("typeAnnotation")]; case "TSOptionalType": - return [path.call(print, "typeAnnotation"), "?"]; + return [print("typeAnnotation"), "?"]; case "TSInterfaceDeclaration": return printInterface(path, options, print); case "TSClassImplements": - return [ - path.call(print, "expression"), - path.call(print, "typeParameters"), - ]; + return [print("expression"), print("typeParameters")]; case "TSTypeParameterDeclaration": case "TSTypeParameterInstantiation": return printTypeParameters(path, options, print, "params"); @@ -138,7 +135,7 @@ function printTypescript(path, options, print) { case "TypeParameter": return printTypeParameter(path, options, print); case "TypeofTypeAnnotation": - return ["typeof ", path.call(print, "argument")]; + return ["typeof ", print("argument")]; case "TSAbstractKeyword": return "abstract"; case "TSAsyncKeyword": @@ -168,11 +165,7 @@ function printTypescript(path, options, print) { case "TSIntrinsicKeyword": return "intrinsic"; case "TSAsExpression": { - parts.push( - path.call(print, "expression"), - " as ", - path.call(print, "typeAnnotation") - ); + parts.push(print("expression"), " as ", print("typeAnnotation")); const parent = path.getParentNode(); if ( (isCallExpression(parent) && parent.callee === node) || @@ -183,7 +176,7 @@ function printTypescript(path, options, print) { return parts; } case "TSArrayType": - return [path.call(print, "elementType"), "[]"]; + return [print("elementType"), "[]"]; case "TSPropertySignature": { if (node.export) { parts.push("export "); @@ -204,12 +197,12 @@ function printTypescript(path, options, print) { ); if (node.typeAnnotation) { - parts.push(": ", path.call(print, "typeAnnotation")); + parts.push(": ", print("typeAnnotation")); } // This isn't valid semantically, but it's in the AST so we can print it. if (node.initializer) { - parts.push(" = ", path.call(print, "initializer")); + parts.push(" = ", print("initializer")); } return parts; @@ -228,11 +221,11 @@ function printTypescript(path, options, print) { parts.push("readonly "); } - parts.push(path.call(print, "parameter")); + parts.push(print("parameter")); return parts; case "TSTypeQuery": - return ["typeof ", path.call(print, "exprName")]; + return ["typeof ", print("exprName")]; case "TSIndexSignature": { const parent = path.getParentNode(); @@ -263,36 +256,31 @@ function printTypescript(path, options, print) { "[", node.parameters ? parametersGroup : "", node.typeAnnotation ? "]: " : "]", - node.typeAnnotation ? path.call(print, "typeAnnotation") : "", + node.typeAnnotation ? print("typeAnnotation") : "", parent.type === "ClassBody" ? semi : "", ]; } case "TSTypePredicate": return [ node.asserts ? "asserts " : "", - path.call(print, "parameterName"), - node.typeAnnotation ? [" is ", path.call(print, "typeAnnotation")] : "", + print("parameterName"), + node.typeAnnotation ? [" is ", print("typeAnnotation")] : "", ]; case "TSNonNullExpression": - return [path.call(print, "expression"), "!"]; + return [print("expression"), "!"]; case "TSImportType": return [ !node.isTypeOf ? "" : "typeof ", "import(", - path.call(print, node.parameter ? "parameter" : "argument"), + print(node.parameter ? "parameter" : "argument"), ")", - !node.qualifier ? "" : [".", path.call(print, "qualifier")], + !node.qualifier ? "" : [".", print("qualifier")], printTypeParameters(path, options, print, "typeParameters"), ]; case "TSLiteralType": - return path.call(print, "literal"); + return print("literal"); case "TSIndexedAccessType": - return [ - path.call(print, "objectType"), - "[", - path.call(print, "indexType"), - "]", - ]; + return [print("objectType"), "[", print("indexType"), "]"]; case "TSConstructSignatureDeclaration": case "TSCallSignatureDeclaration": case "TSConstructorType": { @@ -319,14 +307,14 @@ function printTypescript(path, options, print) { const isType = node.type === "TSConstructorType"; parts.push( isType ? " => " : ": ", - path.call(print, "returnType"), - path.call(print, "typeAnnotation") + print("returnType"), + print("typeAnnotation") ); } return parts; } case "TSTypeOperator": - return [node.operator, " ", path.call(print, "typeAnnotation")]; + return [node.operator, " ", print("typeAnnotation")]; case "TSMappedType": { const shouldBreak = hasNewlineInRange( options.originalText, @@ -345,12 +333,12 @@ function printTypescript(path, options, print) { ] : "", printTypeScriptModifiers(path, options, print), - path.call(print, "typeParameter"), + print("typeParameter"), node.optional ? getTypeScriptMappedTypeModifier(node.optional, "?") : "", node.typeAnnotation ? ": " : "", - path.call(print, "typeAnnotation"), + print("typeAnnotation"), ifBreak(semi), ]), printDanglingComments(path, options, /* sameIndent */ true), @@ -371,7 +359,7 @@ function printTypescript(path, options, print) { node.abstract ? "abstract " : "", node.declare ? "declare " : "", node.computed ? "[" : "", - path.call(print, "key"), + print("key"), node.computed ? "]" : "", printOptionalToken(path) ); @@ -388,9 +376,7 @@ function printTypescript(path, options, print) { ? "returnType" : "typeAnnotation"; const returnTypeNode = node[returnTypePropertyName]; - const returnTypeDoc = returnTypeNode - ? path.call(print, returnTypePropertyName) - : ""; + const returnTypeDoc = returnTypeNode ? print(returnTypePropertyName) : ""; const shouldGroupParameters = shouldGroupFunctionParameters( node, returnTypeDoc @@ -405,7 +391,7 @@ function printTypescript(path, options, print) { return group(parts); } case "TSNamespaceExportDeclaration": - parts.push("export as namespace ", path.call(print, "id")); + parts.push("export as namespace ", print("id")); if (options.semi) { parts.push(";"); @@ -424,7 +410,7 @@ function printTypescript(path, options, print) { parts.push("const "); } - parts.push("enum ", path.call(print, "id"), " "); + parts.push("enum ", print("id"), " "); if (node.members.length === 0) { parts.push( @@ -448,9 +434,9 @@ function printTypescript(path, options, print) { return parts; case "TSEnumMember": - parts.push(path.call(print, "id")); + parts.push(print("id")); if (node.initializer) { - parts.push(" = ", path.call(print, "initializer")); + parts.push(" = ", print("initializer")); } return parts; case "TSImportEqualsDeclaration": @@ -464,11 +450,7 @@ function printTypescript(path, options, print) { parts.push(node.importKind, " "); } - parts.push( - path.call(print, "id"), - " = ", - path.call(print, "moduleReference") - ); + parts.push(print("id"), " = ", print("moduleReference")); if (options.semi) { parts.push(";"); @@ -476,7 +458,7 @@ function printTypescript(path, options, print) { return group(parts); case "TSExternalModuleReference": - return ["require(", path.call(print, "expression"), ")"]; + return ["require(", print("expression"), ")"]; case "TSModuleDeclaration": { const parent = path.getParentNode(); const isExternalModule = isLiteral(node.id); @@ -514,12 +496,12 @@ function printTypescript(path, options, print) { } } - parts.push(path.call(print, "id")); + parts.push(print("id")); if (bodyIsDeclaration) { - parts.push(path.call(print, "body")); + parts.push(print("body")); } else if (node.body) { - parts.push(" ", group(path.call(print, "body"))); + parts.push(" ", group(print("body"))); } else { parts.push(semi); } @@ -534,7 +516,7 @@ function printTypescript(path, options, print) { return printTernary(path, options, print); case "TSInferType": - return ["infer", " ", path.call(print, "typeParameter")]; + return ["infer", " ", print("typeParameter")]; case "TSIntersectionType": return printIntersectionType(path, options, print); case "TSUnionType": @@ -545,11 +527,11 @@ function printTypescript(path, options, print) { return printTupleType(path, options, print); case "TSTypeReference": return [ - path.call(print, "typeName"), + print("typeName"), printTypeParameters(path, options, print, "typeParameters"), ]; case "TSTypeAnnotation": - return path.call(print, "typeAnnotation"); + return print("typeAnnotation"); case "TSEmptyBodyFunctionExpression": return printMethodInternal(path, options, print); @@ -559,15 +541,15 @@ function printTypescript(path, options, print) { case "TSJSDocUnknownType": return "?"; case "TSJSDocNullableType": - return ["?", path.call(print, "typeAnnotation")]; + return ["?", print("typeAnnotation")]; case "TSJSDocNonNullableType": - return ["!", path.call(print, "typeAnnotation")]; + return ["!", print("typeAnnotation")]; case "TSJSDocFunctionType": return [ "function(", // The parameters could be here, but typescript-estree doesn't convert them anyway (throws an error). "): ", - path.call(print, "typeAnnotation"), + print("typeAnnotation"), ]; } } diff --git a/src/language-js/printer-estree-json.js b/src/language-js/printer-estree-json.js index 105c2ad28..5fa591948 100644 --- a/src/language-js/printer-estree-json.js +++ b/src/language-js/printer-estree-json.js @@ -9,15 +9,14 @@ function genericPrint(path, options, print) { const node = path.getValue(); switch (node.type) { case "JsonRoot": - return [path.call(print, "node"), hardline]; + return [print("node"), hardline]; case "ArrayExpression": { if (node.elements.length === 0) { return "[]"; } const printed = path.map( - (elementPath) => - path.getValue() === null ? "null" : print(elementPath), + () => (path.getValue() === null ? "null" : print()), "elements" ); @@ -41,12 +40,9 @@ function genericPrint(path, options, print) { "}", ]; case "ObjectProperty": - return [path.call(print, "key"), ": ", path.call(print, "value")]; + return [print("key"), ": ", print("value")]; case "UnaryExpression": - return [ - node.operator === "+" ? "" : node.operator, - path.call(print, "argument"), - ]; + return [node.operator === "+" ? "" : node.operator, print("argument")]; case "NullLiteral": return "null"; case "BooleanLiteral": @@ -63,7 +59,7 @@ function genericPrint(path, options, print) { } case "TemplateLiteral": // There is only one `TemplateElement` - return path.call(print, "quasis", 0); + return print(["quasis", 0]); case "TemplateElement": return JSON.stringify(node.value.cooked); default: diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index f8503baf3..47c2864c9 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -168,17 +168,17 @@ function printPathNoParens(path, options, print, args) { switch (node.type) { case "JsExpressionRoot": - return path.call(print, "node"); + return print("node"); case "JsonRoot": - return [path.call(print, "node"), hardline]; + return [print("node"), hardline]; case "File": // Print @babel/parser's InterpreterDirective here so that // leading comments on the `Program` node get printed after the hashbang. if (node.program && node.program.interpreter) { - parts.push(path.call(print, "program", "interpreter")); + parts.push(print(["program", "interpreter"])); } - parts.push(path.call(print, "program")); + parts.push(print("program")); return parts; @@ -201,7 +201,7 @@ function printPathNoParens(path, options, print, args) { parent.body[0] === node ) { return [ - path.call(print, "expression"), + print("expression"), isVueEventBindingExpression(node.expression) ? ";" : "", ]; } @@ -209,7 +209,7 @@ function printPathNoParens(path, options, print, args) { // Do not append semicolon after the only JSX element in a program return [ - path.call(print, "expression"), + print("expression"), isTheOnlyJsxElementInMarkdown(options, path) ? "" : semi, ]; // Babel non-standard node. Used for Closure-style type casts. See postprocess.js. @@ -219,11 +219,11 @@ function printPathNoParens(path, options, print, args) { (node.expression.type === "ObjectExpression" || node.expression.type === "ArrayExpression"); if (shouldHug) { - return ["(", path.call(print, "expression"), ")"]; + return ["(", print("expression"), ")"]; } return group([ "(", - indent([softline, path.call(print, "expression")]), + indent([softline, print("expression")]), softline, ")", ]); @@ -236,16 +236,16 @@ function printPathNoParens(path, options, print, args) { case "LogicalExpression": return printBinaryishExpression(path, options, print); case "AssignmentPattern": - return [path.call(print, "left"), " = ", path.call(print, "right")]; + return [print("left"), " = ", print("right")]; case "OptionalMemberExpression": case "MemberExpression": { return printMemberExpression(path, options, print); } case "MetaProperty": - return [path.call(print, "meta"), ".", path.call(print, "property")]; + return [print("meta"), ".", print("property")]; case "BindExpression": if (node.object) { - parts.push(path.call(print, "object")); + parts.push(print("object")); } parts.push( @@ -272,7 +272,7 @@ function printPathNoParens(path, options, print, args) { case "ObjectTypeSpreadProperty": return [ "...", - path.call(print, "argument"), + print("argument"), printTypeAnnotation(path, options, print), ]; case "FunctionDeclaration": @@ -295,14 +295,14 @@ function printPathNoParens(path, options, print, args) { parts.push("*"); } if (node.argument) { - parts.push(" ", path.call(print, "argument")); + parts.push(" ", print("argument")); } return parts; case "AwaitExpression": { parts.push("await"); if (node.argument) { - parts.push(" ", path.call(print, "argument")); + parts.push(" ", print("argument")); const parent = path.getParentNode(); if ( (isCallExpression(parent) && parent.callee === node) || @@ -338,7 +338,7 @@ function printPathNoParens(path, options, print, args) { case "ExportDefaultSpecifier": return printModuleSpecifier(path, options, print); case "ImportAttribute": - return [path.call(print, "key"), ": ", path.call(print, "value")]; + return [print("key"), ": ", print("value")]; case "Import": return "import"; case "BlockStatement": @@ -358,11 +358,11 @@ function printPathNoParens(path, options, print, args) { return [ node.static ? "static " : "", "[[", - path.call(print, "id"), + print("id"), "]]", printOptionalToken(path), node.method ? "" : ": ", - path.call(print, "value"), + print("value"), ]; case "ObjectExpression": @@ -380,7 +380,7 @@ function printPathNoParens(path, options, print, args) { case "ObjectMethod": return printMethod(path, options, print); case "Decorator": - return ["@", path.call(print, "expression")]; + return ["@", print("expression")]; case "ArrayExpression": case "ArrayPattern": case "TupleExpression": @@ -397,9 +397,9 @@ function printPathNoParens(path, options, print, args) { const parts = []; path.each((expressionPath, index) => { if (index === 0) { - parts.push(print(expressionPath)); + parts.push(print()); } else { - parts.push(",", indent([line, print(expressionPath)])); + parts.push(",", indent([line, print()])); } }, "expressions"); return group(parts); @@ -411,7 +411,7 @@ function printPathNoParens(path, options, print, args) { case "Super": return "super"; case "Directive": - return [path.call(print, "value"), semi]; // Babel 6 + return [print("value"), semi]; // Babel 6 case "DirectiveLiteral": return printDirective(node, options); case "UnaryExpression": @@ -423,20 +423,15 @@ function printPathNoParens(path, options, print, args) { if (hasComment(node.argument)) { parts.push( - group([ - "(", - indent([softline, path.call(print, "argument")]), - softline, - ")", - ]) + group(["(", indent([softline, print("argument")]), softline, ")"]) ); } else { - parts.push(path.call(print, "argument")); + parts.push(print("argument")); } return parts; case "UpdateExpression": - parts.push(path.call(print, "argument"), node.operator); + parts.push(print("argument"), node.operator); if (node.prefix) { parts.reverse(); @@ -446,7 +441,7 @@ function printPathNoParens(path, options, print, args) { case "ConditionalExpression": return printTernary(path, options, print); case "VariableDeclaration": { - const printed = path.map((childPath) => print(childPath), "declarations"); + const printed = path.map(print, "declarations"); // We generally want to terminate all variable declarations with a // semicolon, except when they in the () part of for loops. @@ -491,15 +486,15 @@ function printPathNoParens(path, options, print, args) { case "WithStatement": return group([ "with (", - path.call(print, "object"), + print("object"), ")", - adjustClause(node.body, path.call(print, "body")), + adjustClause(node.body, print("body")), ]); case "IfStatement": { - const con = adjustClause(node.consequent, path.call(print, "consequent")); + const con = adjustClause(node.consequent, print("consequent")); const opening = group([ "if (", - group([indent([softline, path.call(print, "test")]), softline]), + group([indent([softline, print("test")]), softline]), ")", con, ]); @@ -528,7 +523,7 @@ function printPathNoParens(path, options, print, args) { group( adjustClause( node.alternate, - path.call(print, "alternate"), + print("alternate"), node.alternate.type === "IfStatement" ) ) @@ -538,7 +533,7 @@ function printPathNoParens(path, options, print, args) { return parts; } case "ForStatement": { - const body = adjustClause(node.body, path.call(print, "body")); + const body = adjustClause(node.body, print("body")); // We want to keep dangling comments above the loop to stay consistent. // Any comment positioned between the for statement and the parentheses @@ -561,13 +556,13 @@ function printPathNoParens(path, options, print, args) { group([ indent([ softline, - path.call(print, "init"), + print("init"), ";", line, - path.call(print, "test"), + print("test"), ";", line, - path.call(print, "update"), + print("update"), ]), softline, ]), @@ -579,18 +574,18 @@ function printPathNoParens(path, options, print, args) { case "WhileStatement": return group([ "while (", - group([indent([softline, path.call(print, "test")]), softline]), + group([indent([softline, print("test")]), softline]), ")", - adjustClause(node.body, path.call(print, "body")), + adjustClause(node.body, print("body")), ]); case "ForInStatement": return group([ "for (", - path.call(print, "left"), + print("left"), " in ", - path.call(print, "right"), + print("right"), ")", - adjustClause(node.body, path.call(print, "body")), + adjustClause(node.body, print("body")), ]); case "ForOfStatement": @@ -598,15 +593,15 @@ function printPathNoParens(path, options, print, args) { "for", node.await ? " await" : "", " (", - path.call(print, "left"), + print("left"), " of ", - path.call(print, "right"), + print("right"), ")", - adjustClause(node.body, path.call(print, "body")), + adjustClause(node.body, print("body")), ]); case "DoWhileStatement": { - const clause = adjustClause(node.body, path.call(print, "body")); + const clause = adjustClause(node.body, print("body")); const doBody = group(["do", clause]); parts = [doBody]; @@ -617,7 +612,7 @@ function printPathNoParens(path, options, print, args) { } parts.push( "while (", - group([indent([softline, path.call(print, "test")]), softline]), + group([indent([softline, print("test")]), softline]), ")", semi ); @@ -625,12 +620,12 @@ function printPathNoParens(path, options, print, args) { return parts; } case "DoExpression": - return ["do ", path.call(print, "body")]; + return ["do ", print("body")]; case "BreakStatement": parts.push("break"); if (node.label) { - parts.push(" ", path.call(print, "label")); + parts.push(" ", print("label")); } parts.push(semi); @@ -640,7 +635,7 @@ function printPathNoParens(path, options, print, args) { parts.push("continue"); if (node.label) { - parts.push(" ", path.call(print, "label")); + parts.push(" ", print("label")); } parts.push(semi); @@ -648,16 +643,16 @@ function printPathNoParens(path, options, print, args) { return parts; case "LabeledStatement": if (node.body.type === "EmptyStatement") { - return [path.call(print, "label"), ":;"]; + return [print("label"), ":;"]; } - return [path.call(print, "label"), ": ", path.call(print, "body")]; + return [print("label"), ": ", print("body")]; case "TryStatement": return [ "try ", - path.call(print, "block"), - node.handler ? [" ", path.call(print, "handler")] : "", - node.finalizer ? [" finally ", path.call(print, "finalizer")] : "", + print("block"), + node.handler ? [" ", print("handler")] : "", + node.finalizer ? [" finally ", print("finalizer")] : "", ]; case "CatchClause": if (node.param) { @@ -672,24 +667,24 @@ function printPathNoParens(path, options, print, args) { backwards: true, })) ); - const param = path.call(print, "param"); + const param = print("param"); return [ "catch ", parameterHasComments ? ["(", indent([softline, param]), softline, ") "] : ["(", param, ") "], - path.call(print, "body"), + print("body"), ]; } - return ["catch ", path.call(print, "body")]; + return ["catch ", print("body")]; // Note: ignoring n.lexical because it has no printing consequences. case "SwitchStatement": return [ group([ "switch (", - indent([softline, path.call(print, "discriminant")]), + indent([softline, print("discriminant")]), softline, ")", ]), @@ -702,7 +697,7 @@ function printPathNoParens(path, options, print, args) { path.map((casePath, index, cases) => { const caseNode = casePath.getValue(); return [ - print(casePath), + print(), index !== cases.length - 1 && isNextLineEmpty(caseNode, options) ? hardline @@ -717,7 +712,7 @@ function printPathNoParens(path, options, print, args) { ]; case "SwitchCase": { if (node.test) { - parts.push("case ", path.call(print, "test"), ":"); + parts.push("case ", print("test"), ":"); } else { parts.push("default:"); } @@ -758,11 +753,7 @@ function printPathNoParens(path, options, print, args) { case "TemplateLiteral": return printTemplateLiteral(path, print, options); case "TaggedTemplateExpression": - return [ - path.call(print, "tag"), - path.call(print, "typeParameters"), - path.call(print, "quasi"), - ]; + return [print("tag"), print("typeParameters"), print("quasi")]; // These types are unprintable because they serve as abstract // supertypes for other (printable) types. case "Node": @@ -788,12 +779,12 @@ function printPathNoParens(path, options, print, args) { case "MixedTypeAnnotation": return "mixed"; case "ArrayTypeAnnotation": - return [path.call(print, "elementType"), "[]"]; + return [print("elementType"), "[]"]; case "BooleanLiteralTypeAnnotation": return String(node.value); case "EnumDeclaration": - return ["enum ", path.call(print, "id"), " ", path.call(print, "body")]; + return ["enum ", print("id"), " ", print("body")]; case "EnumBooleanBody": case "EnumNumberBody": case "EnumStringBody": @@ -849,17 +840,15 @@ function printPathNoParens(path, options, print, args) { case "EnumNumberMember": case "EnumStringMember": return [ - path.call(print, "id"), + print("id"), " = ", - typeof node.init === "object" - ? path.call(print, "init") - : String(node.init), + typeof node.init === "object" ? print("init") : String(node.init), ]; case "EnumDefaultedMember": - return path.call(print, "id"); + return print("id"); case "FunctionTypeParam": { const name = node.name - ? path.call(print, "name") + ? print("name") : path.getParentNode().this === node ? "this" : ""; @@ -867,7 +856,7 @@ function printPathNoParens(path, options, print, args) { name, printOptionalToken(path), name ? ": " : "", - path.call(print, "typeAnnotation"), + print("typeAnnotation"), ]; } @@ -876,9 +865,9 @@ function printPathNoParens(path, options, print, args) { return printInterface(path, options, print); case "ClassImplements": case "InterfaceExtends": - return [path.call(print, "id"), path.call(print, "typeParameters")]; + return [print("id"), print("typeParameters")]; case "NullableTypeAnnotation": - return ["?", path.call(print, "typeAnnotation")]; + return ["?", print("typeAnnotation")]; case "Variance": { const { kind } = node; assert.ok(kind === "plus" || kind === "minus"); @@ -889,18 +878,18 @@ function printPathNoParens(path, options, print, args) { parts.push("static "); } - parts.push(path.call(print, "value")); + parts.push(print("value")); return parts; case "ObjectTypeIndexer": { return [ - node.variance ? path.call(print, "variance") : "", + node.variance ? print("variance") : "", "[", - path.call(print, "id"), + print("id"), node.id ? ": " : "", - path.call(print, "key"), + print("key"), "]: ", - path.call(print, "value"), + print("value"), ]; } case "ObjectTypeProperty": { @@ -915,15 +904,15 @@ function printPathNoParens(path, options, print, args) { return [ modifier, isGetterOrSetter(node) ? node.kind + " " : "", - node.variance ? path.call(print, "variance") : "", + node.variance ? print("variance") : "", printPropertyKey(path, options, print), printOptionalToken(path), isFunctionNotation(node) ? "" : ": ", - path.call(print, "value"), + print("value"), ]; } case "QualifiedTypeIdentifier": - return [path.call(print, "qualification"), ".", path.call(print, "id")]; + return [print("qualification"), ".", print("id")]; case "StringLiteralTypeAnnotation": return printString(rawText(node), options); case "NumberLiteralTypeAnnotation": @@ -937,7 +926,7 @@ function printPathNoParens(path, options, print, args) { case "TypeCastExpression": { return [ "(", - path.call(print, "expression"), + print("expression"), printTypeAnnotation(path, options, print), ")", ]; @@ -975,7 +964,7 @@ function printPathNoParens(path, options, print, args) { // be either left alone or desugared into AST types that are fully // supported by the pretty-printer. case "DeclaredPredicate": - return ["%checks(", path.call(print, "value"), ")"]; + return ["%checks(", print("value"), ")"]; case "AnyTypeAnnotation": case "TSAnyKeyword": return "any"; @@ -1007,9 +996,9 @@ function printPathNoParens(path, options, print, args) { return "this"; case "PrivateIdentifier": - return ["#", path.call(print, "name")]; + return ["#", print("name")]; case "PrivateName": - return ["#", path.call(print, "id")]; + return ["#", print("id")]; case "InterpreterDirective": parts.push("#!", node.value, hardline); @@ -1021,9 +1010,9 @@ function printPathNoParens(path, options, print, args) { return parts; case "PipelineBareFunction": - return path.call(print, "callee"); + return print("callee"); case "PipelineTopicExpression": - return path.call(print, "expression"); + return print("expression"); case "PipelinePrimaryTopicReference": { parts.push("#"); return parts; diff --git a/src/language-markdown/printer-markdown.js b/src/language-markdown/printer-markdown.js index 677a05829..6fe7c254c 100644 --- a/src/language-markdown/printer-markdown.js +++ b/src/language-markdown/printer-markdown.js @@ -410,9 +410,7 @@ function genericPrint(path, options, print) { " ".repeat(4), printChildren(path, options, print, { processor: (childPath, index) => - index === 0 - ? group([softline, print(childPath)]) - : print(childPath), + index === 0 ? group([softline, print()]) : print(), }) ), nextNode && nextNode.type === "footnoteDefinition" @@ -469,13 +467,13 @@ function printListItem(path, options, print, listPrefix) { printChildren(path, options, print, { processor: (childPath, index) => { if (index === 0 && childPath.getValue().type !== "list") { - return align(" ".repeat(prefix.length), print(childPath)); + return align(" ".repeat(prefix.length), print()); } const alignment = " ".repeat( clamp(options.tabWidth - listPrefix.length, 0, 3) // 4+ will cause indented code block ); - return [alignment, align(alignment, print(childPath))]; + return [alignment, align(alignment, print())]; }, }), ]; @@ -565,7 +563,7 @@ function printTable(path, options, print) { const contents = path.map( (rowPath) => rowPath.map((cellPath, columnIndex) => { - const text = printDocToString(print(cellPath), options).formatted; + const text = printDocToString(print(), options).formatted; const width = getStringWidth(text); columnMaxWidths[columnIndex] = Math.max( columnMaxWidths[columnIndex] || 3, // minimum width = 3 (---, :--, :-:, --:) @@ -691,14 +689,14 @@ function printRoot(path, options, print) { } } - return print(childPath); + return print(); }, }); } function printChildren(path, options, print, events = {}) { const { postprocessor } = events; - const processor = events.processor || ((childPath) => print(childPath)); + const processor = events.processor || (() => print()); const node = path.getValue(); const parts = []; diff --git a/src/language-yaml/print/block.js b/src/language-yaml/print/block.js index fcb603908..9e8e8e615 100644 --- a/src/language-yaml/print/block.js +++ b/src/language-yaml/print/block.js @@ -41,7 +41,7 @@ function printBlock(path, print, options) { } if (hasIndicatorComment(node)) { - parts.push(" ", path.call(print, "indicatorComment")); + parts.push(" ", print("indicatorComment")); } const lineContents = getBlockValueLineContents(node, { diff --git a/src/language-yaml/print/flow-mapping-sequence.js b/src/language-yaml/print/flow-mapping-sequence.js index b5d8152eb..7b7e234ef 100644 --- a/src/language-yaml/print/flow-mapping-sequence.js +++ b/src/language-yaml/print/flow-mapping-sequence.js @@ -43,7 +43,7 @@ function printChildren(path, print, options) { const node = path.getValue(); const parts = path.map( (childPath, index) => [ - print(childPath), + print(), index === node.children.length - 1 ? "" : [ diff --git a/src/language-yaml/print/mapping-item.js b/src/language-yaml/print/mapping-item.js index 8b43bbfe2..7a23e14fc 100644 --- a/src/language-yaml/print/mapping-item.js +++ b/src/language-yaml/print/mapping-item.js @@ -26,7 +26,7 @@ function printMappingItem(node, parentNode, path, print, options) { return ": "; } - const printedKey = path.call(print, "key"); + const printedKey = print("key"); const spaceBeforeColon = needsSpaceInFrontOfMappingValue(node) ? " " : ""; if (isEmptyMappingValue) { @@ -46,7 +46,7 @@ function printMappingItem(node, parentNode, path, print, options) { return ["? ", alignWithSpaces(2, printedKey)]; } - const printedValue = path.call(print, "value"); + const printedValue = print("value"); if (isEmptyMappingKey) { return [": ", alignWithSpaces(2, printedValue)]; } diff --git a/src/language-yaml/printer-yaml.js b/src/language-yaml/printer-yaml.js index 36949d49c..ed60df141 100644 --- a/src/language-yaml/printer-yaml.js +++ b/src/language-yaml/printer-yaml.js @@ -55,13 +55,13 @@ function genericPrint(path, options, print) { const { tag, anchor } = node; if (tag) { - parts.push(path.call(print, "tag")); + parts.push(print("tag")); } if (tag && anchor) { parts.push(" "); } if (anchor) { - parts.push(path.call(print, "anchor")); + parts.push(print("anchor")); } /** @type {Doc} */ @@ -120,7 +120,7 @@ function genericPrint(path, options, print) { isInlineNode(node) ? "" : breakParent, - path.call(print, "trailingComment"), + print("trailingComment"), ]) ); } @@ -140,7 +140,7 @@ function genericPrint(path, options, print) { ) ? hardline : "", - print(path), + print(), ], "endComments" ) @@ -163,11 +163,11 @@ function printNode(node, parentNode, path, options, print) { if (index !== 0) { parts.push(hardline); } - parts.push(print(childPath)); + parts.push(print()); if (shouldPrintDocumentEndMarker(document, nextDocument)) { parts.push(hardline, "..."); if (hasTrailingComment(document)) { - parts.push(" ", path.call(print, "trailingComment")); + parts.push(" ", print("trailingComment")); } } else if (nextDocument && !hasTrailingComment(nextDocument.head)) { parts.push(hardline, "---"); @@ -195,18 +195,18 @@ function printNode(node, parentNode, path, options, print) { ) === "head" ) { if (node.head.children.length > 0 || node.head.endComments.length > 0) { - parts.push(path.call(print, "head")); + parts.push(print("head")); } if (hasTrailingComment(node.head)) { - parts.push(["---", " ", path.call(print, "head", "trailingComment")]); + parts.push(["---", " ", print(["head", "trailingComment"])]); } else { parts.push("---"); } } if (shouldPrintDocumentBody(node)) { - parts.push(path.call(print, "body")); + parts.push(print("body")); } return join(hardline, parts); @@ -325,19 +325,14 @@ function printNode(node, parentNode, path, options, print) { case "blockLiteral": { return printBlock(path, print, options); } + case "mapping": case "sequence": return join(hardline, path.map(print, "children")); case "sequenceItem": - return [ - "- ", - alignWithSpaces(2, !node.content ? "" : path.call(print, "content")), - ]; + return ["- ", alignWithSpaces(2, !node.content ? "" : print("content"))]; case "mappingKey": - return !node.content ? "" : path.call(print, "content"); case "mappingValue": - return !node.content ? "" : path.call(print, "content"); - case "mapping": - return join(hardline, path.map(print, "children")); + return !node.content ? "" : print("content"); case "mappingItem": case "flowMappingItem": { return printMappingItem(node, parentNode, path, print, options); @@ -347,7 +342,7 @@ function printNode(node, parentNode, path, options, print) { case "flowSequence": return printFlowSequence(path, print, options); case "flowSequenceItem": - return path.call(print, "content"); + return print("content"); // istanbul ignore next default: throw new Error(`Unexpected node type ${node.type}`); diff --git a/src/main/ast-to-doc.js b/src/main/ast-to-doc.js index 366628086..eb41c581f 100644 --- a/src/main/ast-to-doc.js +++ b/src/main/ast-to-doc.js @@ -1,6 +1,5 @@ "use strict"; -const assert = require("assert"); const AstPath = require("../common/ast-path"); const { builders: { hardline, addAlignmentToDoc }, @@ -16,14 +15,14 @@ const multiparser = require("./multiparser"); * This is done by descending down the AST recursively. The recursion * involves two functions that call each other: * - * 1. printGenerically(), which is defined as an inner function here. + * 1. mainPrint(), which is defined as an inner function here. * It basically takes care of node caching. * 2. callPluginPrintFunction(), which checks for some options, and * ultimately calls the print() function provided by the plugin. * - * The plugin function will call printGenerically() again for child nodes - * of the current node, which will do its housekeeping, then call the - * plugin function again, and so on. + * The plugin function will call mainPrint() again for child nodes + * of the current node. mainPrint() will do its housekeeping, then call + * the plugin function again, and so on. * * All the while, these functions pass a "path" variable around, which * is a stack-like data structure (AstPath) that maintains the current @@ -38,44 +37,50 @@ function printAstToDoc(ast, options, alignmentSize = 0) { } const cache = new Map(); + const path = new AstPath(ast); - function printGenerically(path, args) { - const node = path.getValue(); + let doc = mainPrint(); - const shouldCache = node && typeof node === "object" && args === undefined; - if (shouldCache && cache.has(node)) { - return cache.get(node); - } - - let doc = callPluginPrintFunction(path, options, printGenerically, args); - - // We let JSXElement print its comments itself because it adds () around - // UnionTypeAnnotation has to align the child without the comments - if ( - !printer.willPrintOwnComments || - !printer.willPrintOwnComments(path, options) - ) { - // printComments will call the plugin print function and check for - // comments to print - doc = printComments(path, doc, options); - } - - if (shouldCache) { - cache.set(node, doc); - } - - return doc; - } - - let doc = printGenerically(new AstPath(ast)); if (alignmentSize > 0) { // Add a hardline to make the indents take effect // It should be removed in index.js format() doc = addAlignmentToDoc([hardline, doc], alignmentSize, options.tabWidth); } + propagateBreaks(doc); return doc; + + function mainPrint(selector, args) { + if (selector === undefined || selector === path) { + return mainPrintInternal(args); + } + + if (Array.isArray(selector)) { + return path.call(() => mainPrintInternal(args), ...selector); + } + + return path.call(() => mainPrintInternal(args), selector); + } + + function mainPrintInternal(args) { + const value = path.getValue(); + + const shouldCache = + value && typeof value === "object" && args === undefined; + + if (shouldCache && cache.has(value)) { + return cache.get(value); + } + + const doc = callPluginPrintFunction(path, options, mainPrint, args); + + if (shouldCache) { + cache.set(value, doc); + } + + return doc; + } } function printPrettierIgnoredNode(node, options) { @@ -99,38 +104,45 @@ function printPrettierIgnoredNode(node, options) { } function callPluginPrintFunction(path, options, printPath, args) { - assert.ok(path instanceof AstPath); - const node = path.getValue(); const { printer } = options; + let doc; + // Escape hatch if (printer.hasPrettierIgnore && printer.hasPrettierIgnore(path)) { - return printPrettierIgnoredNode(node, options); - } + doc = printPrettierIgnoredNode(node, options); + } else { + if (node) { + try { + // Potentially switch to a different parser + doc = multiparser.printSubtree(path, printPath, options, printAstToDoc); + } catch (error) { + /* istanbul ignore if */ + if (process.env.PRETTIER_DEBUG) { + throw error; + } + // Continue with current parser + } + } - if (node) { - try { - // Potentially switch to a different parser - const sub = multiparser.printSubtree( - path, - printPath, - options, - printAstToDoc - ); - if (sub) { - return sub; - } - } catch (error) { - /* istanbul ignore if */ - if (process.env.PRETTIER_DEBUG) { - throw error; - } - // Continue with current parser + if (!doc) { + doc = printer.print(path, options, printPath, args); } } - return printer.print(path, options, printPath, args); + // We let JSXElement print its comments itself because it adds () around + // UnionTypeAnnotation has to align the child without the comments + if ( + !printer.willPrintOwnComments || + !printer.willPrintOwnComments(path, options) + ) { + // printComments will call the plugin print function and check for + // comments to print + doc = printComments(path, doc, options); + } + + return doc; } module.exports = printAstToDoc; From ae1d29c1cee00883fdbe9ef808ec6ec6f66ff009 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 17:11:35 +0200 Subject: [PATCH 54/89] Build(deps-dev): Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0 (#10578) * Build(deps-dev): Bump eslint-plugin-unicorn from 28.0.2 to 29.0.0 Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 28.0.2 to 29.0.0. - [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases) - [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v28.0.2...v29.0.0) Signed-off-by: dependabot[bot] * Apply fix Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung --- package.json | 2 +- src/main/options-normalizer.js | 2 +- website/playground/panels.js | 2 +- yarn.lock | 20 ++++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 6d637bbc1..6eabf3f39 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "eslint-plugin-jest": "24.3.2", "eslint-plugin-prettier-internal-rules": "link:scripts/tools/eslint-plugin-prettier-internal-rules", "eslint-plugin-react": "7.22.0", - "eslint-plugin-unicorn": "28.0.2", + "eslint-plugin-unicorn": "29.0.0", "execa": "5.0.0", "jest": "26.6.3", "jest-snapshot-serializer-ansi": "1.0.0", diff --git a/src/main/options-normalizer.js b/src/main/options-normalizer.js index eb54905e9..00ddea466 100644 --- a/src/main/options-normalizer.js +++ b/src/main/options-normalizer.js @@ -22,7 +22,7 @@ const cliDescriptor = { class FlagSchema extends vnopts.ChoiceSchema { constructor({ name, flags }) { super({ name, choices: flags }); - this._flags = flags.slice().sort(); + this._flags = [...flags].sort(); } preprocess(value, utils) { if ( diff --git a/website/playground/panels.js b/website/playground/panels.js index ea7bd8f2a..aed97d5ca 100644 --- a/website/playground/panels.js +++ b/website/playground/panels.js @@ -122,7 +122,7 @@ class CodeMirrorPanel extends React.Component { } function getIndexPosition(text, indexes) { - indexes = indexes.slice(); + indexes = [...indexes]; let line = 0; let count = 0; let lineStart = 0; diff --git a/yarn.lock b/yarn.lock index b46f56b8d..58eabb41b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2319,7 +2319,7 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -ci-info@3.1.1: +ci-info@3.1.1, ci-info@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== @@ -3057,21 +3057,21 @@ eslint-plugin-react@7.22.0: resolve "^1.18.1" string.prototype.matchall "^4.0.2" -eslint-plugin-unicorn@28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-28.0.2.tgz#ab9884ebae04590ecd9c1c294330d889a74b7c37" - integrity sha512-k4AoFP7n8/oq6lBXkdc9Flid6vw2B8j7aXFCxgzJCyKvmaKrCUFb1TFPhG9eSJQFZowqmymMPRtl8oo9NKLUbw== +eslint-plugin-unicorn@29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-29.0.0.tgz#7c97cdb5afe932e9f8dc34108e4a5a2a2fbb1906" + integrity sha512-R9jGLKb2p6LuOixviByGlH2mkfY72EBELXAPeUufveebN0M2Woa7B7dUO3gN2xPn/+eGjrIm4I2u7dDtr9G4iA== dependencies: - ci-info "^2.0.0" + ci-info "^3.1.1" clean-regexp "^1.0.0" - eslint-template-visitor "^2.2.2" + eslint-template-visitor "^2.3.2" eslint-utils "^2.1.0" eslint-visitor-keys "^2.0.0" import-modules "^2.1.0" lodash "^4.17.20" pluralize "^8.0.0" read-pkg-up "^7.0.1" - regexp-tree "^0.1.22" + regexp-tree "^0.1.23" reserved-words "^0.1.2" safe-regex "^2.1.1" semver "^7.3.4" @@ -3092,7 +3092,7 @@ eslint-scope@^5.0.0, eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-template-visitor@^2.2.2: +eslint-template-visitor@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/eslint-template-visitor/-/eslint-template-visitor-2.3.2.tgz#b52f96ff311e773a345d79053ccc78275bbc463d" integrity sha512-3ydhqFpuV7x1M9EK52BPNj6V0Kwu0KKkcIAfpUhwHbR8ocRln/oUHgfxQupY8O1h4Qv/POHDumb/BwwNfxbtnA== @@ -5795,7 +5795,7 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp-tree@^0.1.22, regexp-tree@~0.1.1: +regexp-tree@^0.1.23, regexp-tree@~0.1.1: version "0.1.23" resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.23.tgz#8a8ce1cc5e971acef62213a7ecdb1f6e18a1f1b2" integrity sha512-+7HWfb4Bvu8Rs2eQTUIpX9I/PlQkYOuTNbRpKLJlQpSgwSkzFYh+pUj0gtvglnOZLKB6YgnIgRuJ2/IlpL48qw== From 2a253828b79c07a8ce5c64cc09208d89df37701c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 18:15:38 +0200 Subject: [PATCH 55/89] Build(deps): Bump flow-parser from 0.145.0 to 0.147.0 (#10473) * Build(deps): Bump flow-parser from 0.145.0 to 0.146.0 Bumps [flow-parser](https://github.com/facebook/flow) from 0.145.0 to 0.146.0. - [Release notes](https://github.com/facebook/flow/releases) - [Changelog](https://github.com/facebook/flow/blob/master/Changelog.md) - [Commits](https://github.com/facebook/flow/compare/v0.145.0...v0.146.0) Signed-off-by: dependabot[bot] * Show more details about unexpected global objects * Use `Object.prototype.toString` to show `type` * Workaround * Spellcheck * Update to `v0.147.0` * Revert "Workaround" This reverts commit 5d6d53ba0653f7126a747e84e032c96c0df30788. * Revert "Spellcheck" This reverts commit 180db1ae1c3639cfdbab40463dfe15bca9926dbd. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung --- package.json | 2 +- tests_config/require_standalone.js | 18 ++++++++++++++---- yarn.lock | 9 +++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 6eabf3f39..34836f659 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "fast-glob": "3.2.5", "fast-json-stable-stringify": "2.1.0", "find-parent-dir": "0.3.0", - "flow-parser": "0.145.0", + "flow-parser": "0.147.0", "get-stdin": "8.0.0", "globby": "11.0.2", "graphql": "15.5.0", diff --git a/tests_config/require_standalone.js b/tests_config/require_standalone.js index 310dbb4b6..a7ee4e6a5 100644 --- a/tests_config/require_standalone.js +++ b/tests_config/require_standalone.js @@ -17,10 +17,20 @@ const source = globby vm.runInContext(source, sandbox); const allowedGlobalObjects = new Set(["prettier", "prettierPlugins"]); -for (const property of Object.keys(sandbox)) { - if (!allowedGlobalObjects.has(property)) { - throw new Error(`Global "${property}" object should not be exposed.`); - } +const globalObjects = Object.keys(sandbox).filter( + (property) => !allowedGlobalObjects.has(property) +); +if (globalObjects.length > 0) { + throw new Error( + `Global ${globalObjects + .map( + (property) => + `"${property}"(${Object.prototype.toString + .call(sandbox[property]) + .slice(8, -1)})` + ) + .join(", ")} should not be exposed.` + ); } // TODO: maybe expose (and write tests) for `format`, `utils`, and diff --git a/yarn.lock b/yarn.lock index 58eabb41b..3b9c1c1c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3039,6 +3039,7 @@ eslint-plugin-jest@24.3.2: "eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules": version "0.0.0" + uid "" eslint-plugin-react@7.22.0: version "7.22.0" @@ -3455,10 +3456,10 @@ flatten@^1.0.2: resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== -flow-parser@0.145.0: - version "0.145.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.145.0.tgz#e39af5f3470211cf21a50eb589da4d5cc5f71f39" - integrity sha512-dqpYiE0rZopmex5FR6pi/HTia8i+q/euc9WUWH6fTLt6sQgXjnAcsOwgMMLHCxwCSqPrvi/XFmBiicKitLNrKA== +flow-parser@0.147.0: + version "0.147.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.147.0.tgz#747f67611e731c89927dd5d368bf7f616d1e51be" + integrity sha512-z+b/pgp2QLvsWJkzhKXU8yC5TmaNyXGRmHac3x0Swmn9uQESRXhNIJq9TPHKPPeWgFym33OLO+5BlIdy/tXRCQ== for-in@^1.0.2: version "1.0.2" From a17d3fb21f3dc45774f41a313d384ea156ae5b92 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 23 Mar 2021 09:48:29 +0800 Subject: [PATCH 56/89] =?UTF-8?q?Disallow=20`import`=20without=20argument?= =?UTF-8?q?=20and=20`new=20import(=E2=80=A6)`=20(#10584)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/language-js/parser-babel.js | 2 - .../__snapshots__/jsfmt.spec.js.snap | 48 ----- tests/js/call/no-argument/import.js | 2 - tests/js/call/no-argument/jsfmt.spec.js | 9 +- .../import/__snapshots__/jsfmt.spec.js.snap | 169 ++++++++++++++++++ tests/misc/errors/js/import/jsfmt.spec.js | 12 ++ 6 files changed, 182 insertions(+), 60 deletions(-) delete mode 100644 tests/js/call/no-argument/import.js create mode 100644 tests/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/import/jsfmt.spec.js diff --git a/src/language-js/parser-babel.js b/src/language-js/parser-babel.js index 40164d728..31013d3e0 100644 --- a/src/language-js/parser-babel.js +++ b/src/language-js/parser-babel.js @@ -180,7 +180,6 @@ const allowedMessages = new Set([ "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", "Argument name clash", - "import() requires exactly one or two arguments", "Invalid decimal", "Unexpected trailing comma after rest element", "Decorators cannot be used to decorate parameters", @@ -190,7 +189,6 @@ const allowedMessages = new Set([ "Unexpected token :", "Unexpected reserved word 'package'", 'Duplicate key "type" is not allowed in module attributes', - "Cannot use new with import(...)", "No line break is allowed before '=>'", "Invalid escape sequence in template", "Abstract methods can only appear within an abstract class.", 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 439b8891e..b0240dd49 100644 --- a/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/call/no-argument/__snapshots__/jsfmt.spec.js.snap @@ -1,53 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`import.js [espree] format 1`] = ` -"Unexpected token ) (1:21) -> 1 | import(/* comment */) - | ^ - 2 | new import(/* comment */) - 3 |" -`; - -exports[`import.js [flow] format 1`] = ` -"Unexpected token \`)\` (1:21) -> 1 | import(/* comment */) - | ^ - 2 | new import(/* comment */) - 3 |" -`; - -exports[`import.js [meriyah] format 1`] = ` -"[1:21]: Unexpected token: ')' (1:21) -> 1 | import(/* comment */) - | ^ - 2 | new import(/* comment */) - 3 |" -`; - -exports[`import.js [typescript] format 1`] = ` -"Expression expected. (2:5) - 1 | import(/* comment */) -> 2 | new import(/* comment */) - | ^ - 3 |" -`; - -exports[`import.js format 1`] = ` -====================================options===================================== -parsers: ["babel", "flow", "typescript"] -printWidth: 80 - | printWidth -=====================================input====================================== -import(/* comment */) -new import(/* comment */) - -=====================================output===================================== -import(/* comment */); -new import(/* comment */); - -================================================================================ -`; - exports[`special-cases.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"] diff --git a/tests/js/call/no-argument/import.js b/tests/js/call/no-argument/import.js deleted file mode 100644 index 05c1f508b..000000000 --- a/tests/js/call/no-argument/import.js +++ /dev/null @@ -1,2 +0,0 @@ -import(/* comment */) -new import(/* comment */) diff --git a/tests/js/call/no-argument/jsfmt.spec.js b/tests/js/call/no-argument/jsfmt.spec.js index 7fa97b7ad..eb85eda6b 100644 --- a/tests/js/call/no-argument/jsfmt.spec.js +++ b/tests/js/call/no-argument/jsfmt.spec.js @@ -1,8 +1 @@ -run_spec(__dirname, ["babel", "flow", "typescript"], { - errors: { - espree: ["import.js"], - meriyah: ["import.js"], - flow: ["import.js"], - typescript: ["import.js"], - }, -}); +run_spec(__dirname, ["babel", "flow", "typescript"]); diff --git a/tests/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..6ebbb7135 --- /dev/null +++ b/tests/misc/errors/js/import/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [babel-flow] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [babel-ts] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [espree] format 1`] = ` +"Unexpected token ) (1:8) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [flow] format 1`] = ` +"Unexpected token \`)\` (1:8) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [meriyah] format 1`] = ` +"[1:8]: Unexpected token: ')' (1:8) +> 1 | import(); + | ^" +`; + +exports[`snippet: #0 [typescript] format 1`] = ` +"Dynamic import must have one specifier as an argument. (1:8) +> 1 | import(); + | ^" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [babel-flow] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [babel-ts] format 1`] = ` +"import() requires exactly one or two arguments (1:1) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [espree] format 1`] = ` +"Unexpected token ) (1:21) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [flow] format 1`] = ` +"Unexpected token \`)\` (1:21) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [meriyah] format 1`] = ` +"[1:21]: Unexpected token: ')' (1:21) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #1 [typescript] format 1`] = ` +"Dynamic import must have one specifier as an argument. (1:8) +> 1 | import(/* comment */); + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #2 [babel-flow] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #2 [babel-ts] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #2 [espree] format 1`] = ` +"Cannot use new with import() (1:5) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #2 [flow] format 1`] = ` +"Unexpected token \`import\` (1:5) +> 1 | new import('./a.mjs'); + | ^^^^^^" +`; + +exports[`snippet: #2 [meriyah] format 1`] = ` +"[1:11]: Cannot use new with import(...) (1:11) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #2 [typescript] format 1`] = ` +"Expression expected. (1:5) +> 1 | new import('./a.mjs'); + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import(); + | ^" +`; + +exports[`snippet: #3 [babel-flow] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import(); + | ^" +`; + +exports[`snippet: #3 [babel-ts] format 1`] = ` +"Cannot use new with import(...) (1:5) +> 1 | new import(); + | ^" +`; + +exports[`snippet: #3 [espree] format 1`] = ` +"Unexpected token ) (1:12) +> 1 | new import(); + | ^" +`; + +exports[`snippet: #3 [flow] format 1`] = ` +"Unexpected token \`import\` (1:5) +> 1 | new import(); + | ^^^^^^" +`; + +exports[`snippet: #3 [meriyah] format 1`] = ` +"[1:11]: Cannot use new with import(...) (1:11) +> 1 | new import(); + | ^" +`; + +exports[`snippet: #3 [typescript] format 1`] = ` +"Expression expected. (1:5) +> 1 | new import(); + | ^" +`; diff --git a/tests/misc/errors/js/import/jsfmt.spec.js b/tests/misc/errors/js/import/jsfmt.spec.js new file mode 100644 index 000000000..2bfa89216 --- /dev/null +++ b/tests/misc/errors/js/import/jsfmt.spec.js @@ -0,0 +1,12 @@ +run_spec( + { + dirname: __dirname, + snippets: [ + "import();", + "import(/* comment */);", + "new import('./a.mjs');", + "new import();", + ], + }, + ["babel", "espree", "meriyah", "flow", "typescript", "babel-flow", "babel-ts"] +); From f0a612a3029b53ffc4ef130fe40b92b519231f8b Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 24 Mar 2021 19:39:00 +0900 Subject: [PATCH 57/89] Update @typescript-eslint/typescript-estree (#10589) --- package.json | 2 +- .../__snapshots__/jsfmt.spec.js.snap | 40 ------------------- .../__snapshots__/jsfmt.spec.js.snap | 40 +++++++++++++++++++ .../import-require/type-imports.ts} | 0 yarn.lock | 26 ++++++++++++ 5 files changed, 67 insertions(+), 41 deletions(-) rename tests/{misc/typescript-babel-only/type-import-equals-declaration.ts => typescript/import-require/type-imports.ts} (100%) diff --git a/package.json b/package.json index 34836f659..a88f57a27 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@babel/parser": "7.13.11", "@glimmer/syntax": "0.77.3", "@iarna/toml": "2.2.5", - "@typescript-eslint/typescript-estree": "4.16.1", + "@typescript-eslint/typescript-estree": "4.19.0", "angular-estree-parser": "2.3.0", "angular-html-parser": "1.7.1", "camelcase": "6.2.0", diff --git a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap index 61aa2f761..45f2edd13 100644 --- a/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/typescript-babel-only/__snapshots__/jsfmt.spec.js.snap @@ -81,43 +81,3 @@ type T = [x: A]; ================================================================================ `; - -exports[`type-import-equals-declaration.ts format 1`] = ` -====================================options===================================== -parsers: ["babel-ts"] -printWidth: 80 - | printWidth -=====================================input====================================== -import type A = require("foo"); -export import type = require("A"); - -import type -A = require("A"); - -import -type -a = require("a"); - -export import -type -B = require("B"); - -export -import -type -b = require("b"); - -=====================================output===================================== -import type A = require("foo"); -export import type = require("A"); - -import type A = require("A"); - -import type a = require("a"); - -export import type B = require("B"); - -export import type b = require("b"); - -================================================================================ -`; diff --git a/tests/typescript/import-require/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/import-require/__snapshots__/jsfmt.spec.js.snap index ba7d45dca..c7ee86a32 100644 --- a/tests/typescript/import-require/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/import-require/__snapshots__/jsfmt.spec.js.snap @@ -15,3 +15,43 @@ import JSONContributionRegistry = require("vs/platform/jsonschemas/common/jsonCo ================================================================================ `; + +exports[`type-imports.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +import type A = require("foo"); +export import type = require("A"); + +import type +A = require("A"); + +import +type +a = require("a"); + +export import +type +B = require("B"); + +export +import +type +b = require("b"); + +=====================================output===================================== +import type A = require("foo"); +export import type = require("A"); + +import type A = require("A"); + +import type a = require("a"); + +export import type B = require("B"); + +export import type b = require("b"); + +================================================================================ +`; diff --git a/tests/misc/typescript-babel-only/type-import-equals-declaration.ts b/tests/typescript/import-require/type-imports.ts similarity index 100% rename from tests/misc/typescript-babel-only/type-import-equals-declaration.ts rename to tests/typescript/import-require/type-imports.ts diff --git a/yarn.lock b/yarn.lock index 3b9c1c1c4..9616322ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1602,6 +1602,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.16.1.tgz#5ba2d3e38b1a67420d2487519e193163054d9c15" integrity sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA== +"@typescript-eslint/types@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.19.0.tgz#5181d5d2afd02e5b8f149ebb37ffc8bd7b07a568" + integrity sha512-A4iAlexVvd4IBsSTNxdvdepW0D4uR/fwxDrKUa+iEY9UWvGREu2ZyB8ylTENM1SH8F7bVC9ac9+si3LWNxcBuA== + "@typescript-eslint/typescript-estree@4.16.1": version "4.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz#c2fc46b05a48fbf8bbe8b66a63f0a9ba04b356f1" @@ -1615,6 +1620,19 @@ semver "^7.3.2" tsutils "^3.17.1" +"@typescript-eslint/typescript-estree@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.19.0.tgz#8a709ffa400284ab72df33376df085e2e2f61147" + integrity sha512-3xqArJ/A62smaQYRv2ZFyTA+XxGGWmlDYrsfZG68zJeNbeqRScnhf81rUVa6QG4UgzHnXw5VnMT5cg75dQGDkA== + dependencies: + "@typescript-eslint/types" "4.19.0" + "@typescript-eslint/visitor-keys" "4.19.0" + debug "^4.1.1" + globby "^11.0.1" + is-glob "^4.0.1" + semver "^7.3.2" + tsutils "^3.17.1" + "@typescript-eslint/visitor-keys@4.16.1": version "4.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz#d7571fb580749fae621520deeb134370bbfc7293" @@ -1623,6 +1641,14 @@ "@typescript-eslint/types" "4.16.1" eslint-visitor-keys "^2.0.0" +"@typescript-eslint/visitor-keys@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.19.0.tgz#cbea35109cbd9b26e597644556be4546465d8f7f" + integrity sha512-aGPS6kz//j7XLSlgpzU2SeTqHPsmRYxFztj2vPuMMFJXZudpRSehE3WCV+BaxwZFvfAqMoSd86TEuM0PQ59E/A== + dependencies: + "@typescript-eslint/types" "4.19.0" + eslint-visitor-keys "^2.0.0" + "@webassemblyjs/ast@1.11.0": version "1.11.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.0.tgz#a5aa679efdc9e51707a4207139da57920555961f" From 45188c6396258e3aa7c1f71656e6f844006290e5 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Wed, 24 Mar 2021 18:09:09 +0200 Subject: [PATCH 58/89] docs: improve example for printer print function (#10587) --- docs/plugins.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 201d386b1..2562c3329 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -189,16 +189,35 @@ The `print` function is passed the following parameters: Here’s a simplified example to give an idea of what a typical implementation of `print` looks like: ```js -const { join } = require("prettier").doc.builders; +const { + builders: { group, indent, join, line, softline }, +} = require("prettier").doc; function print(path, options, print) { const node = path.getValue(); - if (Array.isArray(node)) { - return join(", ", path.map(print)); + switch (node.type) { + case "list": + return group([ + "(", + indent([softline, join(line, path.map(print, "elements"))]), + softline, + ")", + ]); + + case "pair": + return group([ + "(", + indent([softline, print("left"), line, ". ", print("right")]), + softline, + ")", + ]); + + case "symbol": + return node.name; } - return node.value; + throw new Error(`Unknown node type: ${node.type}`); } ``` From a49942c1baf453e5fcf6861f8f60c9ae11a83fd1 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 25 Mar 2021 01:19:11 +0900 Subject: [PATCH 59/89] Support module blocks proposal (#10417) Co-authored-by: Georgii Dolzhykov --- changelog_unreleased/javascript/10417.md | 18 ++ src/language-js/comments.js | 19 +- src/language-js/parser-babel.js | 1 + src/language-js/print/block.js | 5 +- src/language-js/printer-estree.js | 10 +- src/main/range-util.js | 37 ++- .../__snapshots__/jsfmt.spec.js.snap | 38 +++ tests/js/babel-plugins/jsfmt.spec.js | 2 + tests/js/babel-plugins/module-blocks.js | 4 + .../__snapshots__/jsfmt.spec.js.snap | 241 ++++++++++++++++++ tests/js/module-blocks/comments.js | 10 + tests/js/module-blocks/jsfmt.spec.js | 6 + tests/js/module-blocks/module-blocks.js | 38 +++ tests/js/module-blocks/non-module-blocks.js | 2 + tests/js/module-blocks/range.js | 4 + 15 files changed, 419 insertions(+), 16 deletions(-) create mode 100644 changelog_unreleased/javascript/10417.md create mode 100644 tests/js/babel-plugins/module-blocks.js create mode 100644 tests/js/module-blocks/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/js/module-blocks/comments.js create mode 100644 tests/js/module-blocks/jsfmt.spec.js create mode 100644 tests/js/module-blocks/module-blocks.js create mode 100644 tests/js/module-blocks/non-module-blocks.js create mode 100644 tests/js/module-blocks/range.js diff --git a/changelog_unreleased/javascript/10417.md b/changelog_unreleased/javascript/10417.md new file mode 100644 index 000000000..bba771b86 --- /dev/null +++ b/changelog_unreleased/javascript/10417.md @@ -0,0 +1,18 @@ +#### Support Module Blocks proposal (#10417 by @sosukesuzuki, @thorn0) + +Support formatting for [Module Blocks Stage 2 proposal](https://github.com/tc39/proposal-js-module-blocks). + + +```js +// Input +module { export let foo = "foo"; }; + +// Prettier main +SyntaxError: Unexpected token, expected ";" + +// Prettier stable +module { + export let foo = "foo"; +}; + +``` diff --git a/src/language-js/comments.js b/src/language-js/comments.js index b3fc525e3..cc2767f70 100644 --- a/src/language-js/comments.js +++ b/src/language-js/comments.js @@ -699,7 +699,13 @@ function handlePropertyComments({ comment, enclosingNode }) { return false; } -function handleOnlyComments({ comment, enclosingNode, ast, isLastComment }) { +function handleOnlyComments({ + comment, + enclosingNode, + followingNode, + ast, + isLastComment, +}) { // With Flow the enclosingNode is undefined so use the AST instead. if (ast && ast.body && ast.body.length === 0) { if (isLastComment) { @@ -725,6 +731,17 @@ function handleOnlyComments({ comment, enclosingNode, ast, isLastComment }) { return true; } + if ( + followingNode && + followingNode.type === "Program" && + followingNode.body.length === 0 && + enclosingNode && + enclosingNode.type === "ModuleExpression" + ) { + addDanglingComment(followingNode, comment); + return true; + } + return false; } diff --git a/src/language-js/parser-babel.js b/src/language-js/parser-babel.js index 31013d3e0..0d503c83c 100644 --- a/src/language-js/parser-babel.js +++ b/src/language-js/parser-babel.js @@ -40,6 +40,7 @@ const parseOptions = { "decimal", "moduleStringNames", "classStaticBlock", + "moduleBlocks", ], tokens: true, ranges: true, diff --git a/src/language-js/print/block.js b/src/language-js/print/block.js index d120564a2..28ff518a8 100644 --- a/src/language-js/print/block.js +++ b/src/language-js/print/block.js @@ -94,7 +94,10 @@ function printBlockBody(path, options, print) { } if (node.type === "Program") { - parts.push(hardline); + const parent = path.getParentNode(); + if (!parent || parent.type !== "ModuleExpression") { + parts.push(hardline); + } } return parts; diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 47c2864c9..3f8605e65 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -1017,9 +1017,17 @@ function printPathNoParens(path, options, print, args) { parts.push("#"); return parts; } - case "ArgumentPlaceholder": return "?"; + case "ModuleExpression": { + parts.push("module {"); + const printed = print("body"); + if (printed) { + parts.push(indent([hardline, printed]), hardline); + } + parts.push("}"); + return parts; + } default: /* istanbul ignore next */ diff --git a/src/main/range-util.js b/src/main/range-util.js index 6e27aff84..71b503512 100644 --- a/src/main/range-util.js +++ b/src/main/range-util.js @@ -20,7 +20,24 @@ function findCommonAncestor(startNodeAndParents, endNodeAndParents) { ); } -function findSiblingAncestors(startNodeAndParents, endNodeAndParents, opts) { +function dropRootParents(parents) { + let lastParentIndex = parents.length - 1; + for (;;) { + const parent = parents[lastParentIndex]; + if (parent && (parent.type === "Program" || parent.type === "File")) { + lastParentIndex--; + } else { + break; + } + } + return parents.slice(0, lastParentIndex + 1); +} + +function findSiblingAncestors( + startNodeAndParents, + endNodeAndParents, + { locStart, locEnd } +) { let resultStartNode = startNodeAndParents.node; let resultEndNode = endNodeAndParents.node; @@ -31,24 +48,18 @@ function findSiblingAncestors(startNodeAndParents, endNodeAndParents, opts) { }; } - for (const endParent of endNodeAndParents.parentNodes) { - if ( - endParent.type !== "Program" && - endParent.type !== "File" && - opts.locStart(endParent) >= opts.locStart(startNodeAndParents.node) - ) { + const startNodeStart = locStart(startNodeAndParents.node); + for (const endParent of dropRootParents(endNodeAndParents.parentNodes)) { + if (locStart(endParent) >= startNodeStart) { resultEndNode = endParent; } else { break; } } - for (const startParent of startNodeAndParents.parentNodes) { - if ( - startParent.type !== "Program" && - startParent.type !== "File" && - opts.locEnd(startParent) <= opts.locEnd(endNodeAndParents.node) - ) { + const endNodeEnd = locEnd(endNodeAndParents.node); + for (const startParent of dropRootParents(startNodeAndParents.parentNodes)) { + if (locEnd(startParent) <= endNodeEnd) { resultStartNode = startParent; } else { break; diff --git a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap index ad289cce9..919e06844 100644 --- a/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/babel-plugins/__snapshots__/jsfmt.spec.js.snap @@ -1040,6 +1040,44 @@ obj.a.b &&= c; ================================================================================ `; +exports[`module-blocks.js [espree] format 1`] = ` +"Unexpected token { (1:16) +> 1 | let m = module { + | ^ + 2 | export let m = 2; + 3 | export let n = 3; + 4 | };" +`; + +exports[`module-blocks.js [meriyah] format 1`] = ` +"[1:16]: Unexpected token: '{' (1:16) +> 1 | let m = module { + | ^ + 2 | export let m = 2; + 3 | export let n = 3; + 4 | };" +`; + +exports[`module-blocks.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "babel-ts", "babel-flow"] +printWidth: 80 + | printWidth +=====================================input====================================== +let m = module { + export let m = 2; + export let n = 3; +}; + +=====================================output===================================== +let m = module { + export let m = 2; + export let n = 3; +}; + +================================================================================ +`; + exports[`module-string-names.js [espree] format 1`] = ` "Unexpected token \\"😄\\" (1:10) > 1 | import { \\"😄\\" as smile } from \\"./emojis.js\\"; diff --git a/tests/js/babel-plugins/jsfmt.spec.js b/tests/js/babel-plugins/jsfmt.spec.js index 230016e7d..c86bffb3f 100644 --- a/tests/js/babel-plugins/jsfmt.spec.js +++ b/tests/js/babel-plugins/jsfmt.spec.js @@ -27,6 +27,7 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "v8intrinsic.js", "module-string-names.js", "class-static-block.js", + "module-blocks.js", ], meriyah: [ "decimal.js", @@ -50,6 +51,7 @@ run_spec(__dirname, ["babel", "babel-ts", "babel-flow"], { "import-assertions-dynamic.js", "import-assertions-static.js", "module-string-names.js", + "module-blocks.js", ], }, }); diff --git a/tests/js/babel-plugins/module-blocks.js b/tests/js/babel-plugins/module-blocks.js new file mode 100644 index 000000000..fe2336a23 --- /dev/null +++ b/tests/js/babel-plugins/module-blocks.js @@ -0,0 +1,4 @@ +let m = module { + export let m = 2; + export let n = 3; +}; diff --git a/tests/js/module-blocks/__snapshots__/jsfmt.spec.js.snap b/tests/js/module-blocks/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..4ba2587e1 --- /dev/null +++ b/tests/js/module-blocks/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,241 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`comments.js [espree] format 1`] = ` +"Unexpected token { (1:32) +> 1 | const m = /*A1*/ module /*A2*/ { /*A3*/ + | ^ + 2 | /*A4*/ + 3 | export const foo = \\"foo\\"; + 4 | export { foo }; /*A5*/" +`; + +exports[`comments.js [meriyah] format 1`] = ` +"[1:32]: Unexpected token: '{' (1:32) +> 1 | const m = /*A1*/ module /*A2*/ { /*A3*/ + | ^ + 2 | /*A4*/ + 3 | export const foo = \\"foo\\"; + 4 | export { foo }; /*A5*/" +`; + +exports[`comments.js format 1`] = ` +====================================options===================================== +parsers: ["babel"] +printWidth: 80 + | printWidth +=====================================input====================================== +const m = /*A1*/ module /*A2*/ { /*A3*/ + /*A4*/ + export const foo = "foo"; + export { foo }; /*A5*/ + /*A6*/ +}/*A7*/;/*A8*/ + +const m2 = module/* B1 */{ + /* B2 */ +}; + +=====================================output===================================== +const m = /*A1*/ module { + /*A2*/ /*A3*/ + /*A4*/ + export const foo = "foo"; + export { foo }; /*A5*/ + /*A6*/ +}; /*A7*/ /*A8*/ + +const m2 = module { + /* B1 */ + /* B2 */ +}; + +================================================================================ +`; + +exports[`module-blocks.js [espree] format 1`] = ` +"Unexpected token { (1:8) +> 1 | module { await 3 }; + | ^ + 2 | + 3 | class B { + 4 | #p() {" +`; + +exports[`module-blocks.js [meriyah] format 1`] = ` +"[1:8]: Unexpected token: '{' (1:8) +> 1 | module { await 3 }; + | ^ + 2 | + 3 | class B { + 4 | #p() {" +`; + +exports[`module-blocks.js format 1`] = ` +====================================options===================================== +parsers: ["babel"] +printWidth: 80 + | printWidth +=====================================input====================================== +module { await 3 }; + +class B { + #p() { + module { + class C { [this.#p]; } + }; + } +} + +const m = module { + export const foo = "foo"; + export { foo }; +}; + +module { + export { foo } +}; + +const m = module {}; + +const worker = new Worker(module { + export const foo = "foo"; +}); + +let m = module { + module { + export let foo = "foo"; + }; +}; + +const m = module { export const foo = "foo" }; + +let moduleBlock = module { export let y = 1; }; + +foo(module { export let foo = "foo"; }); + +let m = module { /* foo */ }; + +=====================================output===================================== +module { + await 3; +}; + +class B { + #p() { + module { + class C { + [this.#p]; + } + }; + } +} + +const m = module { + export const foo = "foo"; + export { foo }; +}; + +module { + export { foo }; +}; + +const m = module {}; + +const worker = new Worker( + module { + export const foo = "foo"; + } +); + +let m = module { + module { + export let foo = "foo"; + }; +}; + +const m = module { + export const foo = "foo"; +}; + +let moduleBlock = module { + export let y = 1; +}; + +foo( + module { + export let foo = "foo"; + } +); + +let m = module { + /* foo */ +}; + +================================================================================ +`; + +exports[`non-module-blocks.js format 1`] = ` +====================================options===================================== +parsers: ["babel"] +printWidth: 80 + | printWidth +=====================================input====================================== +const m = module +{} + +=====================================output===================================== +const m = module; +{ +} + +================================================================================ +`; + +exports[`range.js [espree] format 1`] = ` +"Unexpected token { (1:26) +> 1 | let moduleBlock = module { export let y = 1; + | ^ + 2 | }; + 3 | + 4 | foo(module { export let foo = \\"foo\\"; })" +`; + +exports[`range.js [meriyah] format 1`] = ` +"[1:26]: Unexpected token: '{' (1:26) +> 1 | let moduleBlock = module { export let y = 1; + | ^ + 2 | }; + 3 | + 4 | foo(module { export let foo = \\"foo\\"; })" +`; + +exports[`range.js format 1`] = ` +====================================options===================================== +parsers: ["babel"] +printWidth: 80 +rangeEnd: 52 +rangeStart: 28 + | | printWidth +=====================================input====================================== +> 1 | let moduleBlock = module { export let y = 1; + | ^^^^^^^^^^^^^^^^^ +> 2 | }; + | ^^ +> 3 | + | ^^ +> 4 | foo(module { export let foo = "foo"; }) + | ^^ + 5 | +=====================================output===================================== +let moduleBlock = module { + export let y = 1; +}; + +foo( + module { + export let foo = "foo"; + } +); + +================================================================================ +`; diff --git a/tests/js/module-blocks/comments.js b/tests/js/module-blocks/comments.js new file mode 100644 index 000000000..897ce0c74 --- /dev/null +++ b/tests/js/module-blocks/comments.js @@ -0,0 +1,10 @@ +const m = /*A1*/ module /*A2*/ { /*A3*/ + /*A4*/ + export const foo = "foo"; + export { foo }; /*A5*/ + /*A6*/ +}/*A7*/;/*A8*/ + +const m2 = module/* B1 */{ + /* B2 */ +}; diff --git a/tests/js/module-blocks/jsfmt.spec.js b/tests/js/module-blocks/jsfmt.spec.js new file mode 100644 index 000000000..bde7edd68 --- /dev/null +++ b/tests/js/module-blocks/jsfmt.spec.js @@ -0,0 +1,6 @@ +run_spec(__dirname, ["babel"], { + errors: { + espree: ["module-blocks.js", "range.js", "comments.js"], + meriyah: ["module-blocks.js", "range.js", "comments.js"], + }, +}); diff --git a/tests/js/module-blocks/module-blocks.js b/tests/js/module-blocks/module-blocks.js new file mode 100644 index 000000000..cb3bc2a9e --- /dev/null +++ b/tests/js/module-blocks/module-blocks.js @@ -0,0 +1,38 @@ +module { await 3 }; + +class B { + #p() { + module { + class C { [this.#p]; } + }; + } +} + +const m = module { + export const foo = "foo"; + export { foo }; +}; + +module { + export { foo } +}; + +const m = module {}; + +const worker = new Worker(module { + export const foo = "foo"; +}); + +let m = module { + module { + export let foo = "foo"; + }; +}; + +const m = module { export const foo = "foo" }; + +let moduleBlock = module { export let y = 1; }; + +foo(module { export let foo = "foo"; }); + +let m = module { /* foo */ }; diff --git a/tests/js/module-blocks/non-module-blocks.js b/tests/js/module-blocks/non-module-blocks.js new file mode 100644 index 000000000..b52c515ad --- /dev/null +++ b/tests/js/module-blocks/non-module-blocks.js @@ -0,0 +1,2 @@ +const m = module +{} diff --git a/tests/js/module-blocks/range.js b/tests/js/module-blocks/range.js new file mode 100644 index 000000000..6b19276b9 --- /dev/null +++ b/tests/js/module-blocks/range.js @@ -0,0 +1,4 @@ +let moduleBlock = module { <<>>export let y = 1; +}; + +fo<<>>o(module { export let foo = "foo"; }) From 99ac66b73a34a8c0e7f30caef30fad0fb13fd4a4 Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Wed, 24 Mar 2021 15:32:53 -0700 Subject: [PATCH 60/89] Support for Flow's Indexed Access type (#10594) --- changelog_unreleased/flow/10594.md | 15 +++++++++++++++ src/language-js/print/flow.js | 3 +++ src/language-js/print/type-annotation.js | 6 ++++++ src/language-js/print/typescript.js | 3 ++- .../__snapshots__/jsfmt.spec.js.snap | 16 ++++++++++++++++ tests/flow/indexed-access/indexed-access.js | 1 + tests/flow/indexed-access/jsfmt.spec.js | 1 + 7 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 changelog_unreleased/flow/10594.md create mode 100644 tests/flow/indexed-access/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/flow/indexed-access/indexed-access.js create mode 100644 tests/flow/indexed-access/jsfmt.spec.js diff --git a/changelog_unreleased/flow/10594.md b/changelog_unreleased/flow/10594.md new file mode 100644 index 000000000..6915326b8 --- /dev/null +++ b/changelog_unreleased/flow/10594.md @@ -0,0 +1,15 @@ +#### Support for Flow's indexed access type (#10594 by @gkz) + +Support for Flow's indexed access type. + + +```js +// Input +const x: Obj['foo'] = 1; + +// Prettier stable +// Error: unsupported node type "IndexedAccessType" + +// Prettier main +const x: Obj["foo"] = 1; +``` diff --git a/src/language-js/print/flow.js b/src/language-js/print/flow.js index a64563810..1a23adbae 100644 --- a/src/language-js/print/flow.js +++ b/src/language-js/print/flow.js @@ -10,6 +10,7 @@ const { printUnionType, printFunctionType, printTupleType, + printIndexedAccessType, } = require("./type-annotation"); const { printInterface } = require("./interface"); const { printTypeParameters } = require("./type-parameters"); @@ -81,6 +82,8 @@ function printFlow(path, options, print) { print("id"), printTypeParameters(path, options, print, "typeParameters"), ]; + case "IndexedAccessType": + return printIndexedAccessType(path, options, print); // Type Annotations for Facebook Flow, typically stripped out or // transformed away before printing. case "TypeAnnotation": diff --git a/src/language-js/print/type-annotation.js b/src/language-js/print/type-annotation.js index 9f67f3cf9..ce176da79 100644 --- a/src/language-js/print/type-annotation.js +++ b/src/language-js/print/type-annotation.js @@ -297,6 +297,11 @@ function printTupleType(path, options, print) { ]); } +// `TSIndexedAccessType` and `IndexedAccessType` +function printIndexedAccessType(path, options, print) { + return [print("objectType"), "[", print("indexType"), "]"]; +} + module.exports = { printOpaqueType, printTypeAlias, @@ -304,5 +309,6 @@ module.exports = { printUnionType, printFunctionType, printTupleType, + printIndexedAccessType, shouldHugType, }; diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index 7ed4214e7..498bba446 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -47,6 +47,7 @@ const { printUnionType, printFunctionType, printTupleType, + printIndexedAccessType, } = require("./type-annotation"); function printTypescript(path, options, print) { @@ -280,7 +281,7 @@ function printTypescript(path, options, print) { case "TSLiteralType": return print("literal"); case "TSIndexedAccessType": - return [print("objectType"), "[", print("indexType"), "]"]; + return printIndexedAccessType(path, options, print); case "TSConstructSignatureDeclaration": case "TSCallSignatureDeclaration": case "TSConstructorType": { diff --git a/tests/flow/indexed-access/__snapshots__/jsfmt.spec.js.snap b/tests/flow/indexed-access/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..e86dd7b6f --- /dev/null +++ b/tests/flow/indexed-access/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`indexed-access.js - {"trailingComma":"all"} format 1`] = ` +====================================options===================================== +parsers: ["flow"] +printWidth: 80 +trailingComma: "all" + | printWidth +=====================================input====================================== +const x: Obj['bar'] = 1; + +=====================================output===================================== +const x: Obj["bar"] = 1; + +================================================================================ +`; diff --git a/tests/flow/indexed-access/indexed-access.js b/tests/flow/indexed-access/indexed-access.js new file mode 100644 index 000000000..7bbfcdf11 --- /dev/null +++ b/tests/flow/indexed-access/indexed-access.js @@ -0,0 +1 @@ +const x: Obj['bar'] = 1; diff --git a/tests/flow/indexed-access/jsfmt.spec.js b/tests/flow/indexed-access/jsfmt.spec.js new file mode 100644 index 000000000..d61f17d01 --- /dev/null +++ b/tests/flow/indexed-access/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["flow"], { trailingComma: "all" }); From 34cff1095a4b1f300241c2422a0c0661fae9a12a Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Thu, 25 Mar 2021 15:36:21 +0900 Subject: [PATCH 61/89] Fix changelog for support TypeScript 4.2 (#10595) --- changelog_unreleased/typescript/10418.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/changelog_unreleased/typescript/10418.md b/changelog_unreleased/typescript/10418.md index c7c8cfaf2..2873d1c8e 100644 --- a/changelog_unreleased/typescript/10418.md +++ b/changelog_unreleased/typescript/10418.md @@ -1,6 +1,6 @@ -#### Support TypeScript 4.2 `abstract` Construct Signatures (#10418, #10466 by @sosukesuzuki) +#### Support TypeScript 4.2 (#10418, #10466, #10546, #10589 by @sosukesuzuki) -Support [`abstract` Construct Signatures](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/#abstract-construct-signatures). +##### [`abstract` Construct Signatures](https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/#abstract-construct-signatures) ```ts @@ -14,3 +14,18 @@ SyntaxError: Unexpected token, expected ";" (1:19) type T = abstract new () => void; ``` + +##### [Type imports in import require declaration](https://github.com/microsoft/TypeScript/pull/41573) + + +```ts +// Input +import type A = require("A"); + +// Prettier main +SyntaxError: Only ECMAScript imports may use 'import type'. + +// Prettier stable +import type A = require("A"); + +``` From 4bdff2d47fe0517fc800d92cc463d118397d3fe7 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Fri, 26 Mar 2021 00:48:07 +0100 Subject: [PATCH 62/89] =?UTF-8?q?Build(deps):=20Deduplicate=20`@typescript?= =?UTF-8?q?=E2=80=91eslint/typescript=E2=80=91estree`=20(#10598)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yarn.lock | 50 ++++++++++++-------------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9616322ce..cdae95bad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1578,48 +1578,30 @@ "@types/yargs-parser" "*" "@typescript-eslint/experimental-utils@^4.0.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.16.1.tgz#da7a396dc7d0e01922acf102b76efff17320b328" - integrity sha512-0Hm3LSlMYFK17jO4iY3un1Ve9x1zLNn4EM50Lia+0EV99NdbK+cn0er7HC7IvBA23mBg3P+8dUkMXy4leL33UQ== + version "4.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.19.0.tgz#9ca379919906dc72cb0fcd817d6cb5aa2d2054c6" + integrity sha512-9/23F1nnyzbHKuoTqFN1iXwN3bvOm/PRIXSBR3qFAYotK/0LveEOHr5JT1WZSzcD6BESl8kPOG3OoDRKO84bHA== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.16.1" - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/typescript-estree" "4.16.1" + "@typescript-eslint/scope-manager" "4.19.0" + "@typescript-eslint/types" "4.19.0" + "@typescript-eslint/typescript-estree" "4.19.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/scope-manager@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.16.1.tgz#244e2006bc60cfe46987e9987f4ff49c9e3f00d5" - integrity sha512-6IlZv9JaurqV0jkEg923cV49aAn8V6+1H1DRfhRcvZUrptQ+UtSKHb5kwTayzOYTJJ/RsYZdcvhOEKiBLyc0Cw== +"@typescript-eslint/scope-manager@4.19.0": + version "4.19.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.19.0.tgz#5e0b49eca4df7684205d957c9856f4e720717a4f" + integrity sha512-GGy4Ba/hLXwJXygkXqMzduqOMc+Na6LrJTZXJWVhRrSuZeXmu8TAnniQVKgj8uTRKe4igO2ysYzH+Np879G75g== dependencies: - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/visitor-keys" "4.16.1" - -"@typescript-eslint/types@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.16.1.tgz#5ba2d3e38b1a67420d2487519e193163054d9c15" - integrity sha512-nnKqBwMgRlhzmJQF8tnFDZWfunXmJyuXj55xc8Kbfup4PbkzdoDXZvzN8//EiKR27J6vUSU8j4t37yUuYPiLqA== + "@typescript-eslint/types" "4.19.0" + "@typescript-eslint/visitor-keys" "4.19.0" "@typescript-eslint/types@4.19.0": version "4.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.19.0.tgz#5181d5d2afd02e5b8f149ebb37ffc8bd7b07a568" integrity sha512-A4iAlexVvd4IBsSTNxdvdepW0D4uR/fwxDrKUa+iEY9UWvGREu2ZyB8ylTENM1SH8F7bVC9ac9+si3LWNxcBuA== -"@typescript-eslint/typescript-estree@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.16.1.tgz#c2fc46b05a48fbf8bbe8b66a63f0a9ba04b356f1" - integrity sha512-m8I/DKHa8YbeHt31T+UGd/l8Kwr0XCTCZL3H4HMvvLCT7HU9V7yYdinTOv1gf/zfqNeDcCgaFH2BMsS8x6NvJg== - dependencies: - "@typescript-eslint/types" "4.16.1" - "@typescript-eslint/visitor-keys" "4.16.1" - debug "^4.1.1" - globby "^11.0.1" - is-glob "^4.0.1" - semver "^7.3.2" - tsutils "^3.17.1" - "@typescript-eslint/typescript-estree@4.19.0": version "4.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.19.0.tgz#8a709ffa400284ab72df33376df085e2e2f61147" @@ -1633,14 +1615,6 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.16.1": - version "4.16.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.16.1.tgz#d7571fb580749fae621520deeb134370bbfc7293" - integrity sha512-s/aIP1XcMkEqCNcPQtl60ogUYjSM8FU2mq1O7y5cFf3Xcob1z1iXWNB6cC43Op+NGRTFgGolri6s8z/efA9i1w== - dependencies: - "@typescript-eslint/types" "4.16.1" - eslint-visitor-keys "^2.0.0" - "@typescript-eslint/visitor-keys@4.19.0": version "4.19.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.19.0.tgz#cbea35109cbd9b26e597644556be4546465d8f7f" From dfd471f3348b264ac620dbd08a782e760503e492 Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Fri, 26 Mar 2021 01:48:36 +0200 Subject: [PATCH 63/89] Playground: autofold more AST properties (#10596) --- website/playground/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/playground/util.js b/website/playground/util.js index b41bde90e..96edd8ebd 100644 --- a/website/playground/util.js +++ b/website/playground/util.js @@ -53,7 +53,7 @@ export function getCodemirrorMode(parser) { } const astAutoFold = { - estree: /^\s*"(loc|start|end)":/, + estree: /^\s*"(loc|start|end|tokens|leadingComments|trailingComments|innerComments)":/, postcss: /^\s*"(source|input|raws|file)":/, html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/, mdast: /^\s*"position":/, From cc5981227a823533017219adc9c4df667ef8245f Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 26 Mar 2021 16:19:00 +0800 Subject: [PATCH 64/89] Add parens for `yield` in `pipeline` (#10446) --- changelog_unreleased/javascript/10446.md | 19 ++++++ src/language-js/needs-parens.js | 11 ++++ src/language-js/printer-estree.js | 8 +-- .../__snapshots__/jsfmt.spec.js.snap | 26 ++++++++ .../smart_pipeline_operator.js | 12 ++++ .../__snapshots__/jsfmt.spec.js.snap | 61 +++++++++++++++++++ .../errors/js/smart-pipeline/jsfmt.spec.js | 18 ++++++ 7 files changed, 151 insertions(+), 4 deletions(-) create mode 100644 changelog_unreleased/javascript/10446.md create mode 100644 tests/misc/errors/js/smart-pipeline/__snapshots__/jsfmt.spec.js.snap create mode 100644 tests/misc/errors/js/smart-pipeline/jsfmt.spec.js diff --git a/changelog_unreleased/javascript/10446.md b/changelog_unreleased/javascript/10446.md new file mode 100644 index 000000000..9ee1f7a94 --- /dev/null +++ b/changelog_unreleased/javascript/10446.md @@ -0,0 +1,19 @@ +#### Fix missing parentheses for `yield` in `pipeline` (#10446 by @fisker) + + +```jsx +// Input +function* f() { + return x |> (yield #); +} + +// Prettier stable +function* f() { + return x |> yield #; +} + +// Prettier main +function* f() { + return x |> (yield #); +} +``` diff --git a/src/language-js/needs-parens.js b/src/language-js/needs-parens.js index ac63bba0b..147629dad 100644 --- a/src/language-js/needs-parens.js +++ b/src/language-js/needs-parens.js @@ -355,6 +355,16 @@ function needsParens(path, options) { ) { return true; } + + if ( + name === "expression" && + node.argument && + node.argument.type === "PipelinePrimaryTopicReference" && + parent.type === "PipelineTopicExpression" + ) { + return true; + } + // else fallthrough case "AwaitExpression": switch (parent.type) { @@ -384,6 +394,7 @@ function needsParens(path, options) { if (!node.argument && parent.operator === "|>") { return false; } + return true; } diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 3f8605e65..f30f93e04 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -1013,12 +1013,12 @@ function printPathNoParens(path, options, print, args) { return print("callee"); case "PipelineTopicExpression": return print("expression"); - case "PipelinePrimaryTopicReference": { - parts.push("#"); - return parts; - } + case "PipelinePrimaryTopicReference": + return "#"; + case "ArgumentPlaceholder": return "?"; + case "ModuleExpression": { parts.push("module {"); const printed = print("body"); diff --git a/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap b/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap index 7dcac40c0..ac20d6f79 100644 --- a/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap +++ b/tests/js/pipeline-operator/__snapshots__/jsfmt.spec.js.snap @@ -353,6 +353,18 @@ const searchResults$ = fromEvent(document.querySelector('input'), 'input') v |> #.method() |> f; +async function * f () { + return x + |> (yield #) + |> (await #) + |> y + |> a.b + |> (a.b(#)) + |> a.b(#) + |> (a.b?.(#)) + |> a.b?.(#); +} + =====================================output===================================== a |> await # |> # * 3; @@ -391,5 +403,19 @@ const searchResults$ = v |> #.method() |> f; +async function* f() { + return ( + x + |> (yield #) + |> await # + |> y + |> a.b + |> a.b(#) + |> a.b(#) + |> a.b?.(#) + |> a.b?.(#) + ); +} + ================================================================================ `; diff --git a/tests/js/pipeline-operator/smart_pipeline_operator.js b/tests/js/pipeline-operator/smart_pipeline_operator.js index 5ed861905..47cfe5b9b 100644 --- a/tests/js/pipeline-operator/smart_pipeline_operator.js +++ b/tests/js/pipeline-operator/smart_pipeline_operator.js @@ -38,3 +38,15 @@ const searchResults$ = fromEvent(document.querySelector('input'), 'input') |> share; v |> #.method() |> f; + +async function * f () { + return x + |> (yield #) + |> (await #) + |> y + |> a.b + |> (a.b(#)) + |> a.b(#) + |> (a.b?.(#)) + |> a.b?.(#); +} diff --git a/tests/misc/errors/js/smart-pipeline/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/smart-pipeline/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..cab697b39 --- /dev/null +++ b/tests/misc/errors/js/smart-pipeline/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`snippet: #0 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (yield y)} + | ^" +`; + +exports[`snippet: #1 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (yield)} + | ^" +`; + +exports[`snippet: #2 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (await y)} + | ^" +`; + +exports[`snippet: #3 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (a?.b)} + | ^" +`; + +exports[`snippet: #4 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> a?.b} + | ^" +`; + +exports[`snippet: #5 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (a.b())} + | ^" +`; + +exports[`snippet: #6 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> a.b()} + | ^" +`; + +exports[`snippet: #7 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> (a.b?.())} + | ^" +`; + +exports[`snippet: #8 [babel] format 1`] = ` +"Pipeline is in topic style but does not use topic reference (1:39) +> 1 | async function * a() { a |> foo(#) |> a.b?.()} + | ^" +`; + +exports[`snippet: #9 [babel] format 1`] = ` +"Can not use 'yield' as identifier inside a generator (1:39) +> 1 | async function * a() { a |> foo(#) |> yield} + | ^" +`; diff --git a/tests/misc/errors/js/smart-pipeline/jsfmt.spec.js b/tests/misc/errors/js/smart-pipeline/jsfmt.spec.js new file mode 100644 index 000000000..5a8dd0bfb --- /dev/null +++ b/tests/misc/errors/js/smart-pipeline/jsfmt.spec.js @@ -0,0 +1,18 @@ +run_spec( + { + dirname: __dirname, + snippets: [ + "(yield y)", + "(yield)", + "(await y)", + "(a?.b)", + "a?.b", + "(a.b())", + "a.b()", + "(a.b?.())", + "a.b?.()", + "yield", + ].map((code) => `async function * a() { a |> foo(#) |> ${code}}`), + }, + ["babel"] +); From 76780338559ef585c3e993404b2e319f3714683b Mon Sep 17 00:00:00 2001 From: Mikhail Gorbunov Date: Sat, 27 Mar 2021 04:08:24 +0500 Subject: [PATCH 65/89] husky -> simple-git-hooks (#10601) `Lint staged` along with `mrm` recently migrated from `husky` to `simple-git-hooks`. It is reflected in their [docs](https://github.com/okonet/lint-staged): > It will install and configure simple-git-hooks and lint-staged depending on code quality tools from package.json dependencies so please make sure you install (npm install --save-dev) and configure all code quality tools like Prettier, ESlint prior that. Migration brought these benefits for users: * lighter `node_modules` `simple-git-hooks` (10 kb) is lighter then husky4 (1mb) and husky5 (25kb) * Out of the box `Yarn 2` support * No worry for licensing. Simple git hooks has MIT license, like husky 4 --- docs/precommit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/precommit.md b/docs/precommit.md index 66f32326a..d755ce658 100644 --- a/docs/precommit.md +++ b/docs/precommit.md @@ -15,7 +15,7 @@ _Make sure Prettier is installed and is in your [`devDependencies`](https://docs npx mrm lint-staged ``` -This will install [husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged), then add a configuration to the project’s `package.json` that will automatically format supported files in a pre-commit hook. +This will install [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) and [lint-staged](https://github.com/okonet/lint-staged), then add a configuration to the project’s `package.json` that will automatically format supported files in a pre-commit hook. Read more at the [lint-staged](https://github.com/okonet/lint-staged#configuration) repo. From 5f8bad8275a589ec903bddeacd484123c7db54ab Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Sat, 27 Mar 2021 23:04:55 +0200 Subject: [PATCH 66/89] chore: add plugins to issue template --- .github/ISSUE_TEMPLATE/integration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/integration.md b/.github/ISSUE_TEMPLATE/integration.md index d443f6cbf..6b291bf06 100644 --- a/.github/ISSUE_TEMPLATE/integration.md +++ b/.github/ISSUE_TEMPLATE/integration.md @@ -13,7 +13,7 @@ BEFORE SUBMITTING AN ISSUE: you do not need to open a new issue — please add a 👍 reaction to the existing issue instead. -2. If your issue is with a prettier editor extension or add-on, please open the +2. If your issue is with a Prettier editor extension or add-on, please open the issue in the repo for that extension or add-on, instead of this repo. --> @@ -24,6 +24,7 @@ BEFORE SUBMITTING AN ISSUE: - Running Prettier via: - Runtime: - Operating System: +- Prettier plugins (if any): **Steps to reproduce:** From f550578c4a92129b0a625c59bb222bcce179a77a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:02:57 +0000 Subject: [PATCH 67/89] Build(deps-dev): Bump @glimmer/reference from 0.77.3 to 0.77.6 (#10607) --- package.json | 2 +- yarn.lock | 51 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index a88f57a27..d328885d1 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "@babel/core": "7.13.10", "@babel/preset-env": "7.13.10", "@babel/types": "7.13.0", - "@glimmer/reference": "0.77.3", + "@glimmer/reference": "0.77.6", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.3.0", "@rollup/plugin-commonjs": "16.0.0", diff --git a/yarn.lock b/yarn.lock index cdae95bad..2d38b8e8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1066,10 +1066,10 @@ resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07" integrity sha1-/S0rVakCnGs3psk16MiHGucN+gc= -"@glimmer/global-context@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.3.tgz#b83f2c9d2d0720fdbd49d1ecf33d6836d06c3af2" - integrity sha512-bNPwdoW0/+bwSAR3Ek5C+xo+xkIlUxR4LljfRuwDOXlTebm7YPVDNLN+Vb2XUGNZfMgyNDRPkMO9P3CxW1wDTA== +"@glimmer/global-context@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/global-context/-/global-context-0.77.6.tgz#8b2c62bf31996dea8659c5128f8c05a96bc73e65" + integrity sha512-ev2ZH5Qz35mh6GAanM758ghZisGRIPbf6vmZuZbn/xiR2zDZIVRN5vMqSOsGs2lI+UKZ1qZWnTPa04wDS+lybQ== dependencies: "@glimmer/env" "^0.1.7" @@ -1080,16 +1080,23 @@ dependencies: "@simple-dom/interface" "^1.4.0" -"@glimmer/reference@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.3.tgz#8bf252da20aacd444ab8b7fd4b35d3d56d71a235" - integrity sha512-g9XsW/ZqJ2/6htZYegYoSY4vl43E5KsN2xSNw2sy4Hk901tzvsvjsiLtdH7CvzxZI+s5AUJNQNc2D+/WSppQIQ== +"@glimmer/interfaces@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.6.tgz#e11715bcdc5c5133cbb52db9a53b16c49ee611e5" + integrity sha512-VVsi6Z8BgV9Y42FSybiImb6BR00ILr5m5M0B2VbDFytuKR0scRf0xUzKQV+EgLXOwgu/L5XVQJMWElYxTh6xBw== + dependencies: + "@simple-dom/interface" "^1.4.0" + +"@glimmer/reference@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.77.6.tgz#377780f35dd63861c083e9038c2715651e6fd8cc" + integrity sha512-AHkccjgI/oa0YZkl4WMIjgvVM4fFmK8mZtXFaH48P/LSluE2QBIZvMINxUJ5qC7B5JASSacwxf7MsaePVSzDpA== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.3" - "@glimmer/interfaces" "0.77.3" - "@glimmer/util" "0.77.3" - "@glimmer/validator" "0.77.3" + "@glimmer/global-context" "0.77.6" + "@glimmer/interfaces" "0.77.6" + "@glimmer/util" "0.77.6" + "@glimmer/validator" "0.77.6" "@glimmer/syntax@0.77.3": version "0.77.3" @@ -1110,13 +1117,22 @@ "@glimmer/interfaces" "0.77.3" "@simple-dom/interface" "^1.4.0" -"@glimmer/validator@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.3.tgz#bbbd802742983ad5deed66c02d636e0faa520c65" - integrity sha512-e/eUJszfBrr0wQkW1+vsiP8Sa+S7oBuSa1XPh1b7maGUNkWpk49THERfyULsWYGzrl5iYHWmM+Cl6proAXdI6g== +"@glimmer/util@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.6.tgz#4997f9a066aab915f50c344b2aedab8108b4658b" + integrity sha512-IjrVvSv8fPCroyWHFaJO4q0iIy5s8Zge0PgghrI7Z4Ne5bKHifODy/6yAnA1EjE1NhHAVlZbHjI/pE17a+VjoA== + dependencies: + "@glimmer/env" "0.1.7" + "@glimmer/interfaces" "0.77.6" + "@simple-dom/interface" "^1.4.0" + +"@glimmer/validator@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/validator/-/validator-0.77.6.tgz#1271a344f2249e2835869dc3cacd91aaa9a7dda0" + integrity sha512-ZybFdN3Oc/qzwPNsu7GOf+9FylJyVv+QqGcXeE+eN5wkwv5RxhUZxpo+vdag47r6MVfsZvQlsbmGndwr5LkGjw== dependencies: "@glimmer/env" "^0.1.7" - "@glimmer/global-context" "0.77.3" + "@glimmer/global-context" "0.77.6" "@handlebars/parser@~2.0.0": version "2.0.0" @@ -3039,7 +3055,6 @@ eslint-plugin-jest@24.3.2: "eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules": version "0.0.0" - uid "" eslint-plugin-react@7.22.0: version "7.22.0" From 8c839feb059ac73723e834ee72c85b099c784cdd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:20:53 +0000 Subject: [PATCH 68/89] Build(deps-dev): Bump @babel/preset-react in /website (#10613) --- website/package.json | 2 +- website/yarn.lock | 62 ++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/website/package.json b/website/package.json index 3c75d5aef..e3ea2ba87 100644 --- a/website/package.json +++ b/website/package.json @@ -14,7 +14,7 @@ "react-dom": "17.0.1" }, "devDependencies": { - "@babel/preset-react": "7.12.13", + "@babel/preset-react": "7.13.13", "@sandhose/prettier-animated-logo": "1.0.3", "babel-loader": "8.2.2", "concurrently": "6.0.0", diff --git a/website/yarn.lock b/website/yarn.lock index 5a20edc63..760edd0a8 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -178,6 +178,13 @@ dependencies: "@babel/types" "^7.12.13" +"@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== + dependencies: + "@babel/types" "^7.13.12" + "@babel/helper-module-transforms@^7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz#42eb4bd8eea68bab46751212c357bfed8b40f6f1" @@ -200,12 +207,7 @@ dependencies: "@babel/types" "^7.12.13" -"@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-plugin-utils@^7.13.0": +"@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.13.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af" integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ== @@ -720,23 +722,23 @@ dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@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== +"@babel/plugin-transform-react-jsx-development@^7.12.17": + version "7.12.17" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.17.tgz#f510c0fa7cd7234153539f9a362ced41a5ca1447" + integrity sha512-BPjYV86SVuOaudFhsJR1zjgxxOhJDt6JHNoD48DxWEIxUCAMjV1ys6DYw4SDYZh0b1QsS2vfIA9t/ZsQGsDOUQ== dependencies: - "@babel/plugin-transform-react-jsx" "^7.12.12" + "@babel/plugin-transform-react-jsx" "^7.12.17" -"@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== +"@babel/plugin-transform-react-jsx@^7.12.17", "@babel/plugin-transform-react-jsx@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.13.12.tgz#1df5dfaf0f4b784b43e96da6f28d630e775f68b3" + integrity sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA== dependencies: "@babel/helper-annotate-as-pure" "^7.12.13" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-jsx" "^7.12.13" - "@babel/types" "^7.12.13" + "@babel/types" "^7.13.12" "@babel/plugin-transform-react-pure-annotations@^7.12.1": version "7.12.1" @@ -904,15 +906,16 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@7.12.13", "@babel/preset-react@^7.12.5": - 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== +"@babel/preset-react@7.13.13", "@babel/preset-react@^7.12.5": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.13.13.tgz#fa6895a96c50763fe693f9148568458d5a839761" + integrity sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA== dependencies: - "@babel/helper-plugin-utils" "^7.12.13" + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-validator-option" "^7.12.17" "@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-jsx" "^7.13.12" + "@babel/plugin-transform-react-jsx-development" "^7.12.17" "@babel/plugin-transform-react-pure-annotations" "^7.12.1" "@babel/register@^7.12.1": @@ -966,6 +969,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.13.12": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.13.tgz#dcd8b815b38f537a3697ce84c8e3cc62197df96f" + integrity sha512-kt+EpC6qDfIaqlP+DIbIJOclYy/A1YXs9dAf/ljbi+39Bcbc073H6jKVpXEr/EoIh5anGn5xq/yRVzKl+uIc9w== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@discoveryjs/json-ext@^0.5.0": version "0.5.2" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz#8f03a22a04de437254e8ce8cc84ba39689288752" From b765adeec9bc65d03c020435ff29947fdcd2aac7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 18:21:30 +0000 Subject: [PATCH 69/89] Build(deps-dev): Bump webpack-cli from 4.5.0 to 4.6.0 in /website (#10614) --- website/package.json | 2 +- website/yarn.lock | 38 +++++++++++++++++++------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/website/package.json b/website/package.json index e3ea2ba87..363e230d9 100644 --- a/website/package.json +++ b/website/package.json @@ -21,6 +21,6 @@ "docusaurus": "1.14.7", "js-yaml": "4.0.0", "webpack": "5.27.1", - "webpack-cli": "4.5.0" + "webpack-cli": "4.6.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index 760edd0a8..294f1dfca 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -1200,22 +1200,22 @@ "@webassemblyjs/ast" "1.11.0" "@xtuc/long" "4.2.2" -"@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/configtest@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.2.tgz#2a20812bfb3a2ebb0b27ee26a52eeb3e3f000836" + integrity sha512-3OBzV2fBGZ5TBfdW50cha1lHDVf9vlvRXnjpVbJBa20pSZQaSkMJZiwA8V2vD9ogyeXn8nU5s5A6mHyf5jhMzA== -"@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== +"@webpack-cli/info@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.3.tgz#ef819d10ace2976b6d134c7c823a3e79ee31a92c" + integrity sha512-lLek3/T7u40lTqzCGpC6CAbY6+vXhdhmwFRxZLMnRm6/sIF/7qMpT8MocXCRQfz0JAh63wpbXLMnsQ5162WS7Q== dependencies: envinfo "^7.7.3" -"@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== +"@webpack-cli/serve@^1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.3.1.tgz#911d1b3ff4a843304b9c3bacf67bb34672418441" + integrity sha512-0qXvpeYO6vaNoRBI52/UsbcaBydJCggoBBnIo/ovQQdn6fug0BgwsjorV1hVS7fMqGVTZGcVxv8334gjmbj5hw== "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -7628,15 +7628,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.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== +webpack-cli@4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.6.0.tgz#27ae86bfaec0cf393fcfd58abdc5a229ad32fd16" + integrity sha512-9YV+qTcGMjQFiY7Nb1kmnupvb1x40lfpj8pwdO/bom+sQiP4OBMKjHq29YQrlDWDPZO9r/qWaRRywKaRDKqBTA== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.0.1" - "@webpack-cli/info" "^1.2.2" - "@webpack-cli/serve" "^1.3.0" + "@webpack-cli/configtest" "^1.0.2" + "@webpack-cli/info" "^1.2.3" + "@webpack-cli/serve" "^1.3.1" colorette "^1.2.1" commander "^7.0.0" enquirer "^2.3.6" From 89952795cf9529212c4eeab9fbd2bc0461ba90d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 20:22:15 +0000 Subject: [PATCH 70/89] Build(deps): Bump react and react-dom in /website (#10611) --- website/package.json | 4 ++-- website/yarn.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/website/package.json b/website/package.json index 363e230d9..3b90125c6 100644 --- a/website/package.json +++ b/website/package.json @@ -10,8 +10,8 @@ "codemirror-graphql": "1.0.0", "lz-string": "1.4.4", "prop-types": "15.7.2", - "react": "17.0.1", - "react-dom": "17.0.1" + "react": "17.0.2", + "react-dom": "17.0.2" }, "devDependencies": { "@babel/preset-react": "7.13.13", diff --git a/website/yarn.lock b/website/yarn.lock index 294f1dfca..5416f210d 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -6216,14 +6216,14 @@ react-dev-utils@^11.0.1: strip-ansi "6.0.0" text-table "0.2.0" -react-dom@17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.1.tgz#1de2560474ec9f0e334285662ede52dbc5426fc6" - integrity sha512-6eV150oJZ9U2t9svnsspTMrWNyHc6chX0KzDeAOXftRa8bNeOKTTfCJ7KorIwenkHd2xqVTBTCZd79yk/lx/Ug== +react-dom@17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" - scheduler "^0.20.1" + scheduler "^0.20.2" react-dom@^16.2.0, react-dom@^16.8.4: version "16.14.0" @@ -6260,10 +6260,10 @@ react-test-renderer@^16.0.0-0: react-is "^16.8.6" scheduler "^0.19.1" -react@17.0.1: - version "17.0.1" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.1.tgz#6e0600416bd57574e3f86d92edba3d9008726127" - integrity sha512-lG9c9UuMHdcAexXtigOZLX8exLWkW0Ku29qPRU8uhF2R9BN96dLCt0psvzPLlHc5OWkgymP3qwTRgbnw5BKx3w== +react@17.0.2: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -6634,10 +6634,10 @@ scheduler@^0.19.1: loose-envify "^1.1.0" object-assign "^4.1.1" -scheduler@^0.20.1: - version "0.20.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" - integrity sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw== +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" From 028cac139faec2ae2946b5db2dc35a8d235f5da4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 20:34:09 +0000 Subject: [PATCH 71/89] Build(deps-dev): Bump webpack from 5.27.1 to 5.28.0 in /website (#10608) --- website/package.json | 2 +- website/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/website/package.json b/website/package.json index 3b90125c6..fe4c14255 100644 --- a/website/package.json +++ b/website/package.json @@ -20,7 +20,7 @@ "concurrently": "6.0.0", "docusaurus": "1.14.7", "js-yaml": "4.0.0", - "webpack": "5.27.1", + "webpack": "5.28.0", "webpack-cli": "4.6.0" } } diff --git a/website/yarn.lock b/website/yarn.lock index 5416f210d..9cb6629ed 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -7664,10 +7664,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.27.1: - version "5.27.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.27.1.tgz#6808fb6e45e35290cdb8ae43c7a10884839a3079" - integrity sha512-rxIDsPZ3Apl3JcqiemiLmWH+hAq04YeOXqvCxNZOnTp8ZgM9NEPtbu4CaMfMEf9KShnx/Ym8uLGmM6P4XnwCoA== +webpack@5.28.0: + version "5.28.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.28.0.tgz#0de8bcd706186b26da09d4d1e8cbd3e4025a7c2f" + integrity sha512-1xllYVmA4dIvRjHzwELgW4KjIU1fW4PEuEnjsylz7k7H5HgPOctIq7W1jrt3sKH9yG5d72//XWzsHhfoWvsQVg== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From 7153104b65aa14a36e2ab3cacbd324b1a60b1f92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 21:36:07 +0000 Subject: [PATCH 72/89] Build(deps-dev): Bump @babel/core from 7.13.10 to 7.13.13 (#10609) --- package.json | 2 +- yarn.lock | 116 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 83 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index d328885d1..1fbfc3937 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "yaml-unist-parser": "1.3.1" }, "devDependencies": { - "@babel/core": "7.13.10", + "@babel/core": "7.13.13", "@babel/preset-env": "7.13.10", "@babel/types": "7.13.0", "@glimmer/reference": "0.77.6", diff --git a/yarn.lock b/yarn.lock index 2d38b8e8f..b20539ac2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,20 +35,25 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.8.tgz#5b783b9808f15cef71547f1b691f34f8ff6003a6" integrity sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== -"@babel/core@7.13.10", "@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.7.5": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.10.tgz#07de050bbd8193fcd8a3c27918c0890613a94559" - integrity sha512-bfIYcT0BdKeAZrovpMqX2Mx5NrgAckGbwT982AkdS5GNfn3KMGiprlBAtmBcFZRUmpaufS6WZFP8trvx8ptFDw== +"@babel/compat-data@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.12.tgz#a8a5ccac19c200f9dd49624cac6e19d7be1236a1" + integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ== + +"@babel/core@7.13.13", "@babel/core@^7.1.0", "@babel/core@^7.12.16", "@babel/core@^7.7.5": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.13.tgz#bc44c4a2be2288ec4ddf56b66fc718019c76ac29" + integrity sha512-1xEs9jZAyKIouOoCmpsgk/I26PoKyvzQ2ixdRpRzfbcp1fL+ozw7TUgdDgwonbTovqRaTfRh50IXuw4QrWO0GA== dependencies: "@babel/code-frame" "^7.12.13" "@babel/generator" "^7.13.9" - "@babel/helper-compilation-targets" "^7.13.10" - "@babel/helper-module-transforms" "^7.13.0" + "@babel/helper-compilation-targets" "^7.13.13" + "@babel/helper-module-transforms" "^7.13.12" "@babel/helpers" "^7.13.10" - "@babel/parser" "^7.13.10" + "@babel/parser" "^7.13.13" "@babel/template" "^7.12.13" - "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" + "@babel/traverse" "^7.13.13" + "@babel/types" "^7.13.13" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -66,7 +71,7 @@ eslint-visitor-keys "^1.3.0" semver "^6.3.0" -"@babel/generator@^7.13.0", "@babel/generator@^7.13.9": +"@babel/generator@^7.13.9": version "7.13.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.13.9.tgz#3a7aa96f9efb8e2be42d38d80e2ceb4c64d8de39" integrity sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw== @@ -90,12 +95,12 @@ "@babel/helper-explode-assignable-expression" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.10", "@babel/helper-compilation-targets@^7.13.8": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.10.tgz#1310a1678cb8427c07a753750da4f8ce442bdd0c" - integrity sha512-/Xju7Qg1GQO4mHZ/Kcs6Au7gfafgZnwm+a7sy/ow/tV1sHeraRUHbjdat8/UvDor4Tez+siGKDk6zIKtCPKVJA== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.13.10", "@babel/helper-compilation-targets@^7.13.13", "@babel/helper-compilation-targets@^7.13.8": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz#2b2972a0926474853f41e4adbc69338f520600e5" + integrity sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ== dependencies: - "@babel/compat-data" "^7.13.8" + "@babel/compat-data" "^7.13.12" "@babel/helper-validator-option" "^7.12.17" browserslist "^4.14.5" semver "^6.3.0" @@ -171,6 +176,13 @@ dependencies: "@babel/types" "^7.13.0" +"@babel/helper-member-expression-to-functions@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz#dfe368f26d426a07299d8d6513821768216e6d72" + integrity sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw== + dependencies: + "@babel/types" "^7.13.12" + "@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" @@ -178,20 +190,26 @@ dependencies: "@babel/types" "^7.12.13" -"@babel/helper-module-transforms@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz#42eb4bd8eea68bab46751212c357bfed8b40f6f1" - integrity sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw== +"@babel/helper-module-imports@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977" + integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA== dependencies: - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-replace-supers" "^7.13.0" - "@babel/helper-simple-access" "^7.12.13" + "@babel/types" "^7.13.12" + +"@babel/helper-module-transforms@^7.13.0", "@babel/helper-module-transforms@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.12.tgz#600e58350490828d82282631a1422268e982ba96" + integrity sha512-7zVQqMO3V+K4JOOj40kxiCrMf6xlQAkewBB0eu2b03OO/Q21ZutOzjpfD79A5gtE/2OWi1nv625MrDlGlkbknQ== + dependencies: + "@babel/helper-module-imports" "^7.13.12" + "@babel/helper-replace-supers" "^7.13.12" + "@babel/helper-simple-access" "^7.13.12" "@babel/helper-split-export-declaration" "^7.12.13" "@babel/helper-validator-identifier" "^7.12.11" "@babel/template" "^7.12.13" "@babel/traverse" "^7.13.0" - "@babel/types" "^7.13.0" - lodash "^4.17.19" + "@babel/types" "^7.13.12" "@babel/helper-optimise-call-expression@^7.12.13": version "7.12.13" @@ -224,6 +242,16 @@ "@babel/traverse" "^7.13.0" "@babel/types" "^7.13.0" +"@babel/helper-replace-supers@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz#6442f4c1ad912502481a564a7386de0c77ff3804" + integrity sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.13.12" + "@babel/helper-optimise-call-expression" "^7.12.13" + "@babel/traverse" "^7.13.0" + "@babel/types" "^7.13.12" + "@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" @@ -231,6 +259,13 @@ dependencies: "@babel/types" "^7.12.13" +"@babel/helper-simple-access@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz#dd6c538afb61819d205a012c31792a39c7a5eaf6" + integrity sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA== + dependencies: + "@babel/types" "^7.13.12" + "@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" @@ -283,11 +318,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.13.11", "@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.0", "@babel/parser@^7.13.10": +"@babel/parser@7.13.11": version "7.13.11" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.11.tgz#f93ebfc99d21c1772afbbaa153f47e7ce2f50b88" integrity sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q== +"@babel/parser@^7.1.0", "@babel/parser@^7.12.13", "@babel/parser@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" + integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw== + "@babel/plugin-proposal-async-generator-functions@^7.13.8": version "7.13.8" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz#87aacb574b3bc4b5603f6fe41458d72a5a2ec4b1" @@ -844,22 +884,21 @@ "@babel/parser" "^7.12.13" "@babel/types" "^7.12.13" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.0.tgz#6d95752475f86ee7ded06536de309a65fc8966cc" - integrity sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.13.13": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.13.13.tgz#39aa9c21aab69f74d948a486dd28a2dbdbf5114d" + integrity sha512-CblEcwmXKR6eP43oQGG++0QMTtCjAsa3frUuzHoiIJWpaIIi8dwMyEFUJoXRLxagGqCK+jALRwIO+o3R9p/uUg== dependencies: "@babel/code-frame" "^7.12.13" - "@babel/generator" "^7.13.0" + "@babel/generator" "^7.13.9" "@babel/helper-function-name" "^7.12.13" "@babel/helper-split-export-declaration" "^7.12.13" - "@babel/parser" "^7.13.0" - "@babel/types" "^7.13.0" + "@babel/parser" "^7.13.13" + "@babel/types" "^7.13.13" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.19" -"@babel/types@7.13.0", "@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@7.13.0": version "7.13.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== @@ -868,6 +907,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.13.13" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.13.tgz#dcd8b815b38f537a3697ce84c8e3cc62197df96f" + integrity sha512-kt+EpC6qDfIaqlP+DIbIJOclYy/A1YXs9dAf/ljbi+39Bcbc073H6jKVpXEr/EoIh5anGn5xq/yRVzKl+uIc9w== + 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" From 0fce802016012011ae0e90807f873ea2d9ed54ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 28 Mar 2021 23:01:34 +0000 Subject: [PATCH 73/89] Build(deps): Bump @glimmer/syntax from 0.77.3 to 0.77.6 (#10619) --- package.json | 2 +- yarn.lock | 28 ++++++---------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 1fbfc3937..8a6baf983 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@angular/compiler": "11.2.6", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.11", - "@glimmer/syntax": "0.77.3", + "@glimmer/syntax": "0.77.6", "@iarna/toml": "2.2.5", "@typescript-eslint/typescript-estree": "4.19.0", "angular-estree-parser": "2.3.0", diff --git a/yarn.lock b/yarn.lock index b20539ac2..dc4021119 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1121,13 +1121,6 @@ dependencies: "@glimmer/env" "^0.1.7" -"@glimmer/interfaces@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.3.tgz#cd0523147da72d8901950a24c3be7aa4e38d8d09" - integrity sha512-i/2YmyjFKhKNheEfvajQbbQr9AWbahNV71oakipz8b+qWx0nni5cjM/m/Z0nhnwrsa2cNFIt5kNknD6rh18AHg== - dependencies: - "@simple-dom/interface" "^1.4.0" - "@glimmer/interfaces@0.77.6": version "0.77.6" resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.77.6.tgz#e11715bcdc5c5133cbb52db9a53b16c49ee611e5" @@ -1146,25 +1139,16 @@ "@glimmer/util" "0.77.6" "@glimmer/validator" "0.77.6" -"@glimmer/syntax@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.3.tgz#219bd46687147f10cf3893f81ebfd6ac7733ac07" - integrity sha512-C5sMmRyiDnhYHkdogcEpBuSbiFrClAwGg1tBk61dMkYmXlInjlwpAj5SfgtSzcgXjUM/60uZo+DvMacyZsx9Nw== +"@glimmer/syntax@0.77.6": + version "0.77.6" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.77.6.tgz#31142ba914ee123f9b5e5c70bd92272cb6258bca" + integrity sha512-Nh5D/IGpY7LQ5fmNEIeU9UdwIb9xaRfEefsSbIiBcHw13mauFVz7K+ZKIn3p1Qur6xWmUIKcYgXCAsOFFiOyQg== dependencies: - "@glimmer/interfaces" "0.77.3" - "@glimmer/util" "0.77.3" + "@glimmer/interfaces" "0.77.6" + "@glimmer/util" "0.77.6" "@handlebars/parser" "~2.0.0" simple-html-tokenizer "^0.5.10" -"@glimmer/util@0.77.3": - version "0.77.3" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.3.tgz#c91fc3b61743ddea3e4470cf1ed8378f88cc863f" - integrity sha512-pqkU2b4BOkmSehRPSbS4bIw1zk8K6dVkVbXdXRqVz4oKqM7c0zYR/5fV2Sjayd3gEElt71lAef5uBr+7WddDlA== - dependencies: - "@glimmer/env" "0.1.7" - "@glimmer/interfaces" "0.77.3" - "@simple-dom/interface" "^1.4.0" - "@glimmer/util@0.77.6": version "0.77.6" resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.77.6.tgz#4997f9a066aab915f50c344b2aedab8108b4658b" From 96d9d2802a5ad03efe76117d678ff62286010dd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:29:08 +0800 Subject: [PATCH 74/89] Build(deps): Bump semver from 7.3.4 to 7.3.5 (#10620) Bumps [semver](https://github.com/npm/node-semver) from 7.3.4 to 7.3.5. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/master/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.3.4...v7.3.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 8a6baf983..5309228e7 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "remark-math": "3.0.1", "remark-parse": "8.0.3", "resolve": "1.20.0", - "semver": "7.3.4", + "semver": "7.3.5", "string-width": "4.2.2", "strip-ansi": "6.0.0", "typescript": "4.2.3", diff --git a/yarn.lock b/yarn.lock index dc4021119..fbb2e3d93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6175,10 +6175,10 @@ semver@7.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== -semver@7.3.4, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: - version "7.3.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== +semver@7.3.5, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== dependencies: lru-cache "^6.0.0" From 487ad60695bfc2c147c763706886bb250358033d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:30:00 +0800 Subject: [PATCH 75/89] Build(deps-dev): Bump rollup from 2.42.1 to 2.43.1 (#10618) Bumps [rollup](https://github.com/rollup/rollup) from 2.42.1 to 2.43.1. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.42.1...v2.43.1) 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 5309228e7..b1379586b 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "prettier": "2.2.1", "pretty-bytes": "5.6.0", "rimraf": "3.0.2", - "rollup": "2.42.1", + "rollup": "2.43.1", "rollup-plugin-polyfill-node": "0.6.2", "rollup-plugin-terser": "7.0.2", "shelljs": "0.8.4", diff --git a/yarn.lock b/yarn.lock index fbb2e3d93..46962c2e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6072,10 +6072,10 @@ rollup-plugin-terser@7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@2.42.1: - version "2.42.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.42.1.tgz#6d675b7971e3bee510935326a0f7e556bb7d43de" - integrity sha512-/y7M2ULg06JOXmMpPzhTeQroJSchy8lX8q6qrjqil0jmLz6ejCWbQzVnWTsdmMQRhfU0QcwtiW8iZlmrGXWV4g== +rollup@2.43.1: + version "2.43.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.43.1.tgz#9e5c9208c2011de227ac6c93101e11dc12e88e04" + integrity sha512-kvRE6VJbiv4d8m2nGeccc3qRpzOMghAhu2KeITjyZVCjneIFLPQ3zm2Wmqnl0LcUg3FvDaV0MfKnG4NCMbiSfw== optionalDependencies: fsevents "~2.3.1" From 1c11322643ec76db808d6fde4164dda1958f9a4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:30:23 +0800 Subject: [PATCH 76/89] Build(deps-dev): Bump @rollup/plugin-replace from 2.4.1 to 2.4.2 (#10606) Bumps [@rollup/plugin-replace](https://github.com/rollup/plugins) from 2.4.1 to 2.4.2. - [Release notes](https://github.com/rollup/plugins/releases) - [Commits](https://github.com/rollup/plugins/compare/replace-v2.4.1...replace-v2.4.2) 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 b1379586b..54c97cc27 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "@rollup/plugin-commonjs": "16.0.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "11.2.0", - "@rollup/plugin-replace": "2.4.1", + "@rollup/plugin-replace": "2.4.2", "@types/estree": "0.0.46", "@types/node": "14.14.0", "babel-jest": "26.6.3", diff --git a/yarn.lock b/yarn.lock index 46962c2e5..507596396 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1440,10 +1440,10 @@ is-module "^1.0.0" resolve "^1.19.0" -"@rollup/plugin-replace@2.4.1": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.1.tgz#c411b5ab72809fb1bfc8b487d8d02eef661460d3" - integrity sha512-XwC1oK5rrtRJ0tn1ioLHS6OV5JTluJF7QE1J/q1hN3bquwjnVxjtMyY9iCnoyH9DQbf92CxajB3o98wZbP3oAQ== +"@rollup/plugin-replace@2.4.2": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" + integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== dependencies: "@rollup/pluginutils" "^3.1.0" magic-string "^0.25.7" From bc83708d51a93c0c074bc8f437cf59a6414ec3bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 10:31:34 +0800 Subject: [PATCH 77/89] Build(deps): Bump actions-cool/issues-helper from v2.1.2 to v2.2.1 (#10605) Bumps [actions-cool/issues-helper](https://github.com/actions-cool/issues-helper) from v2.1.2 to v2.2.1. - [Release notes](https://github.com/actions-cool/issues-helper/releases) - [Changelog](https://github.com/actions-cool/issues-helper/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions-cool/issues-helper/compare/v2.1.2...d82909b31d2bf2ebfc74306b249ef7060169ebc5) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/mark-issue-duplicate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mark-issue-duplicate.yml b/.github/workflows/mark-issue-duplicate.yml index 53e203c00..eacddb855 100644 --- a/.github/workflows/mark-issue-duplicate.yml +++ b/.github/workflows/mark-issue-duplicate.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, 'Duplicate of ') }} steps: - - uses: actions-cool/issues-helper@v2.1.2 + - uses: actions-cool/issues-helper@v2.2.1 with: actions: "mark-duplicate" token: ${{ secrets.GITHUB_TOKEN }} From a49df3fc0b11a4a5f56573437cff615a6ad2491c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 29 Mar 2021 10:45:03 +0800 Subject: [PATCH 78/89] Increase dependabot open-pull-requests-limit (#10626) --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2fe37ab61..0a2a8c897 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,7 @@ updates: interval: weekly day: sunday time: "01:00" + open-pull-requests-limit: 20 - package-ecosystem: "npm" directory: "/website" From 188477505ce7d70bcf1087fe0b9af0ee67a9a0d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 14:10:15 +0800 Subject: [PATCH 79/89] Build(deps-dev): Bump @babel/preset-env from 7.13.10 to 7.13.12 (#10628) Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.10 to 7.13.12. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.12/packages/babel-preset-env) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 39 ++++++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 54c97cc27..d339f9ee3 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ }, "devDependencies": { "@babel/core": "7.13.13", - "@babel/preset-env": "7.13.10", + "@babel/preset-env": "7.13.12", "@babel/types": "7.13.0", "@glimmer/reference": "0.77.6", "@rollup/plugin-alias": "3.1.2", diff --git a/yarn.lock b/yarn.lock index 507596396..5c5e138a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,12 +30,7 @@ dependencies: "@babel/highlight" "^7.12.13" -"@babel/compat-data@^7.13.0", "@babel/compat-data@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.8.tgz#5b783b9808f15cef71547f1b691f34f8ff6003a6" - integrity sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog== - -"@babel/compat-data@^7.13.12": +"@babel/compat-data@^7.13.0", "@babel/compat-data@^7.13.12", "@babel/compat-data@^7.13.8": version "7.13.12" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.12.tgz#a8a5ccac19c200f9dd49624cac6e19d7be1236a1" integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ== @@ -328,6 +323,15 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.13.tgz#42f03862f4aed50461e543270916b47dd501f0df" integrity sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz#a3484d84d0b549f3fc916b99ee4783f26fabad2a" + integrity sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ== + dependencies: + "@babel/helper-plugin-utils" "^7.13.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" + "@babel/plugin-proposal-async-generator-functions@^7.13.8": version "7.13.8" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz#87aacb574b3bc4b5603f6fe41458d72a5a2ec4b1" @@ -412,10 +416,10 @@ "@babel/helper-plugin-utils" "^7.13.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.13.8": - version "7.13.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.8.tgz#e39df93efe7e7e621841babc197982e140e90756" - integrity sha512-hpbBwbTgd7Cz1QryvwJZRo1U0k1q8uyBmeXOSQUjdg/A2TASkhR/rz7AyqZ/kS8kbpsNA80rOYbxySBJAqmhhQ== +"@babel/plugin-proposal-optional-chaining@^7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz#ba9feb601d422e0adea6760c2bd6bbb7bfec4866" + integrity sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ== dependencies: "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" @@ -783,15 +787,16 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.13" "@babel/helper-plugin-utils" "^7.12.13" -"@babel/preset-env@7.13.10": - version "7.13.10" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.10.tgz#b5cde31d5fe77ab2a6ab3d453b59041a1b3a5252" - integrity sha512-nOsTScuoRghRtUsRr/c69d042ysfPHcu+KOB4A9aAO9eJYqrkat+LF8G1yp1HD18QiwixT2CisZTr/0b3YZPXQ== +"@babel/preset-env@7.13.12": + version "7.13.12" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.13.12.tgz#6dff470478290582ac282fb77780eadf32480237" + integrity sha512-JzElc6jk3Ko6zuZgBtjOd01pf9yYDEIH8BcqVuYIuOkzOwDesoa/Nz4gIo4lBG6K861KTV9TvIgmFuT6ytOaAA== dependencies: - "@babel/compat-data" "^7.13.8" + "@babel/compat-data" "^7.13.12" "@babel/helper-compilation-targets" "^7.13.10" "@babel/helper-plugin-utils" "^7.13.0" "@babel/helper-validator-option" "^7.12.17" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.13.12" "@babel/plugin-proposal-async-generator-functions" "^7.13.8" "@babel/plugin-proposal-class-properties" "^7.13.0" "@babel/plugin-proposal-dynamic-import" "^7.13.8" @@ -802,7 +807,7 @@ "@babel/plugin-proposal-numeric-separator" "^7.12.13" "@babel/plugin-proposal-object-rest-spread" "^7.13.8" "@babel/plugin-proposal-optional-catch-binding" "^7.13.8" - "@babel/plugin-proposal-optional-chaining" "^7.13.8" + "@babel/plugin-proposal-optional-chaining" "^7.13.12" "@babel/plugin-proposal-private-methods" "^7.13.0" "@babel/plugin-proposal-unicode-property-regex" "^7.12.13" "@babel/plugin-syntax-async-generators" "^7.8.4" @@ -850,7 +855,7 @@ "@babel/plugin-transform-unicode-escapes" "^7.12.13" "@babel/plugin-transform-unicode-regex" "^7.12.13" "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.13.0" + "@babel/types" "^7.13.12" babel-plugin-polyfill-corejs2 "^0.1.4" babel-plugin-polyfill-corejs3 "^0.1.3" babel-plugin-polyfill-regenerator "^0.1.2" From 5b87e9a197785818a48aff33042f8be4b33d1dff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 07:08:10 +0000 Subject: [PATCH 80/89] Build(deps-dev): Bump eslint from 7.22.0 to 7.23.0 (#10633) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d339f9ee3..a1eb31bbf 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "builtin-modules": "3.2.0", "cross-env": "7.0.3", "cspell": "4.2.8", - "eslint": "7.22.0", + "eslint": "7.23.0", "eslint-config-prettier": "8.1.0", "eslint-formatter-friendly": "7.0.0", "eslint-plugin-import": "2.22.1", diff --git a/yarn.lock b/yarn.lock index 5c5e138a3..0190bb352 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3173,10 +3173,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@7.22.0: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f" - integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg== +eslint@7.23.0: + version "7.23.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325" + integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q== dependencies: "@babel/code-frame" "7.12.11" "@eslint/eslintrc" "^0.4.0" From 08200f049db51eaf581a72123580c3cfdec42b5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 15:51:58 +0800 Subject: [PATCH 81/89] Build(deps-dev): Bump eslint-plugin-react from 7.22.0 to 7.23.1 (#10625) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index a1eb31bbf..9f08132f2 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "eslint-plugin-import": "2.22.1", "eslint-plugin-jest": "24.3.2", "eslint-plugin-prettier-internal-rules": "link:scripts/tools/eslint-plugin-prettier-internal-rules", - "eslint-plugin-react": "7.22.0", + "eslint-plugin-react": "7.23.1", "eslint-plugin-unicorn": "29.0.0", "execa": "5.0.0", "jest": "26.6.3", diff --git a/yarn.lock b/yarn.lock index 0190bb352..081dda562 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1967,7 +1967,7 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-includes@^3.1.1, array-includes@^3.1.2: +array-includes@^3.1.1, array-includes@^3.1.2, array-includes@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== @@ -2002,7 +2002,7 @@ array.prototype.flat@^1.2.3: define-properties "^1.1.3" es-abstract "^1.18.0-next.1" -array.prototype.flatmap@^1.2.3: +array.prototype.flatmap@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz#94cfd47cc1556ec0747d97f7c7738c58122004c9" integrity sha512-r9Z0zYoxqHz60vvQbWEdXIEtCwHF0yxaWfno9qzXeNHvfyl3BZqygmGzb84dsubyaXLH4husF+NFgMSdpZhk2Q== @@ -3093,22 +3093,23 @@ eslint-plugin-jest@24.3.2: "eslint-plugin-prettier-internal-rules@link:scripts/tools/eslint-plugin-prettier-internal-rules": version "0.0.0" -eslint-plugin-react@7.22.0: - version "7.22.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz#3d1c542d1d3169c45421c1215d9470e341707269" - integrity sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA== +eslint-plugin-react@7.23.1: + version "7.23.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.23.1.tgz#f1a2e844c0d1967c822388204a8bc4dee8415b11" + integrity sha512-MvFGhZjI8Z4HusajmSw0ougGrq3Gs4vT/0WgwksZgf5RrLrRa2oYAw56okU4tZJl8+j7IYNuTM+2RnFEuTSdRQ== dependencies: - array-includes "^3.1.1" - array.prototype.flatmap "^1.2.3" + array-includes "^3.1.3" + array.prototype.flatmap "^1.2.4" doctrine "^2.1.0" has "^1.0.3" jsx-ast-utils "^2.4.1 || ^3.0.0" - object.entries "^1.1.2" - object.fromentries "^2.0.2" - object.values "^1.1.1" + minimatch "^3.0.4" + object.entries "^1.1.3" + object.fromentries "^2.0.4" + object.values "^1.1.3" prop-types "^15.7.2" - resolve "^1.18.1" - string.prototype.matchall "^4.0.2" + resolve "^2.0.0-next.3" + string.prototype.matchall "^4.0.4" eslint-plugin-unicorn@29.0.0: version "29.0.0" @@ -5289,7 +5290,7 @@ object.assign@^4.1.0, object.assign@^4.1.2: has-symbols "^1.0.1" object-keys "^1.1.1" -object.entries@^1.1.2: +object.entries@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.3.tgz#c601c7f168b62374541a07ddbd3e2d5e4f7711a6" integrity sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg== @@ -5299,7 +5300,7 @@ object.entries@^1.1.2: es-abstract "^1.18.0-next.1" has "^1.0.3" -object.fromentries@^2.0.2: +object.fromentries@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.4.tgz#26e1ba5c4571c5c6f0890cef4473066456a120b8" integrity sha512-EsFBshs5RUUpQEY1D4q/m59kMfz4YJvxuNCJcv/jWwOJr34EaVnG11ZrZa0UHB3wnzV1wx8m58T4hQL8IuNXlQ== @@ -5316,7 +5317,7 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -object.values@^1.1.1: +object.values@^1.1.1, object.values@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.3.tgz#eaa8b1e17589f02f698db093f7c62ee1699742ee" integrity sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw== @@ -6043,6 +6044,14 @@ resolve@1.20.0, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14. is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@^2.0.0-next.3: + version "2.0.0-next.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" + integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q== + dependencies: + is-core-module "^2.2.0" + path-parse "^1.0.6" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -6490,7 +6499,7 @@ string-width@4.2.2, string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string.prototype.matchall@^4.0.2: +string.prototype.matchall@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.4.tgz#608f255e93e072107f5de066f81a2dfb78cf6b29" integrity sha512-pknFIWVachNcyqRfaQSeu/FUfpvJTe4uskUSZ9Wc1RijsPuzbZ8TyYT8WCNnntCjUEqQ3vUHMAfVj2+wLAisPQ== From b2a7662e1007a237bf6a76f0bb906e993384dfea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 15:52:41 +0800 Subject: [PATCH 82/89] Build(deps-dev): Bump webpack from 5.27.1 to 5.28.0 (#10631) Bumps [webpack](https://github.com/webpack/webpack) from 5.27.1 to 5.28.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.27.1...v5.28.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 9f08132f2..89ee2f1f6 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "synchronous-promise": "2.0.15", "tempy": "1.0.1", "terser-webpack-plugin": "5.1.1", - "webpack": "5.27.1" + "webpack": "5.28.0" }, "scripts": { "prepublishOnly": "echo \"Error: must publish from dist/\" && exit 1", diff --git a/yarn.lock b/yarn.lock index 081dda562..3f34c4fb0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7154,10 +7154,10 @@ webpack-sources@^2.1.1: source-list-map "^2.0.1" source-map "^0.6.1" -webpack@5.27.1: - version "5.27.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.27.1.tgz#6808fb6e45e35290cdb8ae43c7a10884839a3079" - integrity sha512-rxIDsPZ3Apl3JcqiemiLmWH+hAq04YeOXqvCxNZOnTp8ZgM9NEPtbu4CaMfMEf9KShnx/Ym8uLGmM6P4XnwCoA== +webpack@5.28.0: + version "5.28.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.28.0.tgz#0de8bcd706186b26da09d4d1e8cbd3e4025a7c2f" + integrity sha512-1xllYVmA4dIvRjHzwELgW4KjIU1fW4PEuEnjsylz7k7H5HgPOctIq7W1jrt3sKH9yG5d72//XWzsHhfoWvsQVg== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.46" From 0edb7547c27fda8e29035bfd672ecc38765a4f9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 15:53:36 +0800 Subject: [PATCH 83/89] Build(deps-dev): Bump @rollup/plugin-node-resolve from 11.2.0 to 11.2.1 (#10632) Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 11.2.0 to 11.2.1. - [Release notes](https://github.com/rollup/plugins/releases) - [Commits](https://github.com/rollup/plugins/compare/node-resolve-v11.2.0...node-resolve-v11.2.1) 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 89ee2f1f6..73500cfb0 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@rollup/plugin-babel": "5.3.0", "@rollup/plugin-commonjs": "16.0.0", "@rollup/plugin-json": "4.1.0", - "@rollup/plugin-node-resolve": "11.2.0", + "@rollup/plugin-node-resolve": "11.2.1", "@rollup/plugin-replace": "2.4.2", "@types/estree": "0.0.46", "@types/node": "14.14.0", diff --git a/yarn.lock b/yarn.lock index 3f34c4fb0..15d2dbf65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1433,10 +1433,10 @@ dependencies: "@rollup/pluginutils" "^3.0.8" -"@rollup/plugin-node-resolve@11.2.0": - version "11.2.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.0.tgz#a5ab88c35bb7622d115f44984dee305112b6f714" - integrity sha512-qHjNIKYt5pCcn+5RUBQxK8krhRvf1HnyVgUCcFFcweDS7fhkOLZeYh0mhHK6Ery8/bb9tvN/ubPzmfF0qjDCTA== +"@rollup/plugin-node-resolve@11.2.1": + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" From bf3b11a4f03c82900571e960e7bfba28d80818e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 08:55:49 +0000 Subject: [PATCH 84/89] Build(deps): Bump @angular/compiler from 11.2.6 to 11.2.7 (#10629) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 73500cfb0..edd6db1a5 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "bin" ], "dependencies": { - "@angular/compiler": "11.2.6", + "@angular/compiler": "11.2.7", "@babel/code-frame": "7.12.13", "@babel/parser": "7.13.11", "@glimmer/syntax": "0.77.6", diff --git a/yarn.lock b/yarn.lock index 15d2dbf65..b934d1d26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@angular/compiler@11.2.6": - version "11.2.6" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.6.tgz#8b69cd2f2c3bb0fbc6f95ded1ccbe20e6858daed" - integrity sha512-3ijsCxnCLU1V1hy4UMf9qtMz5LR+wCdVFDqktEQccN9YEkN0cNtOc8Nu9EV9/mc2tqd1Q4xSBpb2o2mvpy7AhQ== +"@angular/compiler@11.2.7": + version "11.2.7" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-11.2.7.tgz#aeeed88bed201691559271dc9b9eb54d9eba8234" + integrity sha512-VikD6d33TjBYqLfECzVSbD/T7DFmNRx9rA4b2R2RNrQ3efW7zUJjJMsYwuQEWhYe0dFsBfMKCb/+yCjH9DYTFg== dependencies: tslib "^2.0.0" From f524867216ad368956446a5d9fdd3282503f4e12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 08:56:26 +0000 Subject: [PATCH 85/89] Build(deps): Bump globby from 11.0.2 to 11.0.3 (#10630) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index edd6db1a5..50330de8e 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "find-parent-dir": "0.3.0", "flow-parser": "0.147.0", "get-stdin": "8.0.0", - "globby": "11.0.2", + "globby": "11.0.3", "graphql": "15.5.0", "html-element-attributes": "2.3.0", "html-styles": "1.0.0", diff --git a/yarn.lock b/yarn.lock index b934d1d26..093f61772 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3685,10 +3685,10 @@ globals@^13.6.0: dependencies: type-fest "^0.20.2" -globby@11.0.2, globby@^11.0.1: - version "11.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.2.tgz#1af538b766a3b540ebfb58a32b2e2d5897321d83" - integrity sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og== +globby@11.0.3, globby@^11.0.1: + version "11.0.3" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb" + integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" From fd29bfc7c57afedfa17ad078d715c1300fb2e0d4 Mon Sep 17 00:00:00 2001 From: Jonas DOREL Date: Mon, 29 Mar 2021 12:50:36 +0200 Subject: [PATCH 86/89] docs(precommit): Ignore unknown files (#10634) Without `--ignore-unknown`, files without an extension or with an unknown extension would trigger the following error : ``` .gitignore[error] No parser could be inferred for file: ansible.cfg ``` --- docs/precommit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/precommit.md b/docs/precommit.md index d755ce658..7bfa3c39d 100644 --- a/docs/precommit.md +++ b/docs/precommit.md @@ -119,11 +119,11 @@ Alternately you can save this script as `.git/hooks/pre-commit` and give it exec ```sh #!/bin/sh -FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.js" "*.jsx" | sed 's| |\\ |g') +FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') [ -z "$FILES" ] && exit 0 # Prettify all selected files -echo "$FILES" | xargs ./node_modules/.bin/prettier --write +echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write # Add back the modified/prettified files to staging echo "$FILES" | xargs git add From 9ae302fd3021af3a12f9d067db47d67e212a5df4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:12:06 +0000 Subject: [PATCH 87/89] Build(deps-dev): Bump @babel/types from 7.13.0 to 7.13.13 (#10621) --- package.json | 2 +- yarn.lock | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 50330de8e..7d5e632a8 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "devDependencies": { "@babel/core": "7.13.13", "@babel/preset-env": "7.13.12", - "@babel/types": "7.13.0", + "@babel/types": "7.13.13", "@glimmer/reference": "0.77.6", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.3.0", diff --git a/yarn.lock b/yarn.lock index 093f61772..6474460f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -903,16 +903,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.13.0": - version "7.13.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.0.tgz#74424d2816f0171b4100f0ab34e9a374efdf7f80" - integrity sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA== - 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.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@7.13.13", "@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.13.13", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.13.13" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.13.tgz#dcd8b815b38f537a3697ce84c8e3cc62197df96f" integrity sha512-kt+EpC6qDfIaqlP+DIbIJOclYy/A1YXs9dAf/ljbi+39Bcbc073H6jKVpXEr/EoIh5anGn5xq/yRVzKl+uIc9w== From b58f0cab93a0db737c6f660446bc4d809f9fab82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 19:20:56 +0800 Subject: [PATCH 88/89] Build(deps-dev): Bump @rollup/plugin-commonjs from 16.0.0 to 18.0.0 (#10624) 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 7d5e632a8..fbe058fc9 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@glimmer/reference": "0.77.6", "@rollup/plugin-alias": "3.1.2", "@rollup/plugin-babel": "5.3.0", - "@rollup/plugin-commonjs": "16.0.0", + "@rollup/plugin-commonjs": "18.0.0", "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "11.2.1", "@rollup/plugin-replace": "2.4.2", diff --git a/yarn.lock b/yarn.lock index 6474460f6..279a34825 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1395,10 +1395,10 @@ "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" -"@rollup/plugin-commonjs@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-16.0.0.tgz#169004d56cd0f0a1d0f35915d31a036b0efe281f" - integrity sha512-LuNyypCP3msCGVQJ7ki8PqYdpjfEkE/xtFa5DqlF+7IBD0JsfMZ87C58heSwIMint58sAUZbt3ITqOmdQv/dXw== +"@rollup/plugin-commonjs@18.0.0": + version "18.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-18.0.0.tgz#50dc7518b5aa9e66a270e529ea85115d269825c4" + integrity sha512-fj92shhg8luw7XbA0HowAqz90oo7qtLGwqTKbyZ8pmOyH8ui5e+u0wPEgeHLH3djcVma6gUCUrjY6w5R2o1u6g== dependencies: "@rollup/pluginutils" "^3.1.0" commondir "^1.0.1" From 8f42492ca63b813b0e42f8c90e4e48c5eff2ad78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Mar 2021 11:25:47 +0000 Subject: [PATCH 89/89] Build(deps-dev): Bump @types/estree from 0.0.46 to 0.0.47 (#10627) --- package.json | 2 +- yarn.lock | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fbe058fc9..6a2e90d42 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@rollup/plugin-json": "4.1.0", "@rollup/plugin-node-resolve": "11.2.1", "@rollup/plugin-replace": "2.4.2", - "@types/estree": "0.0.46", + "@types/estree": "0.0.47", "@types/node": "14.14.0", "babel-jest": "26.6.3", "babel-loader": "8.2.2", diff --git a/yarn.lock b/yarn.lock index 279a34825..79aec208e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,16 +1521,21 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@0.0.46", "@types/estree@^0.0.46": - version "0.0.46" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" - integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== +"@types/estree@*", "@types/estree@0.0.47": + version "0.0.47" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4" + integrity sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg== "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/estree@^0.0.46": + version "0.0.46" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.46.tgz#0fb6bfbbeabd7a30880504993369c4bf1deab1fe" + integrity sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg== + "@types/graceful-fs@^4.1.2": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"