From 39dd49490bf85fb44ea1563096d8240ad7b763da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sat, 8 Apr 2023 12:55:50 +0900 Subject: [PATCH 1/2] any --- crates/stc_ts_file_analyzer/src/analyzer/expr/jsx.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/stc_ts_file_analyzer/src/analyzer/expr/jsx.rs b/crates/stc_ts_file_analyzer/src/analyzer/expr/jsx.rs index 8353693d83..0158fa65a8 100644 --- a/crates/stc_ts_file_analyzer/src/analyzer/expr/jsx.rs +++ b/crates/stc_ts_file_analyzer/src/analyzer/expr/jsx.rs @@ -314,7 +314,9 @@ impl Analyzer<'_, '_> { fn validate(&mut self, e: &RJSXFragment, type_ann: Option<&Type>) -> VResult { let children = e.children.validate_with_default(self)?; - self.get_jsx_intrinsic_element(e.span, &"Fragment".into()) + // See https://github.com/microsoft/TypeScript/issues/50429 + // The TypeScript does not specify the validation rule for JSXFragment. + Ok(Type::any(e.span, Default::default())) } } From c2b1d141edd1edb203c85d722ecea05eda699e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Sat, 8 Apr 2023 12:58:12 +0900 Subject: [PATCH 2/2] Update stats --- .../jsx/checkJsxChildrenProperty14.error-diff.json | 14 ++------------ .../checkJsxChildrenProperty14.stats.rust-debug | 2 +- ...xTypeArgumentsJsxPreserveOutput.error-diff.json | 12 ------------ ...TypeArgumentsJsxPreserveOutput.stats.rust-debug | 2 +- .../conditional/conditionalTypes1.error-diff.json | 11 ++++++++--- .../conditional/conditionalTypes1.stats.rust-debug | 4 ++-- .../stc_ts_type_checker/tests/tsc-stats.rust-debug | 6 +++--- 7 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.error-diff.json diff --git a/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.error-diff.json b/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.error-diff.json index 0cba54cac1..271859cae5 100644 --- a/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.error-diff.json +++ b/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.error-diff.json @@ -7,16 +7,6 @@ 42 ] }, - "extra_errors": { - "TS2339": 5 - }, - "extra_error_lines": { - "TS2339": [ - 24, - 25, - 26, - 39, - 42 - ] - } + "extra_errors": {}, + "extra_error_lines": {} } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.stats.rust-debug b/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.stats.rust-debug index 56301e3996..4af5bf17ec 100644 --- a/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/conformance/jsx/checkJsxChildrenProperty14.stats.rust-debug @@ -1,6 +1,6 @@ Stats { required_error: 1, matched_error: 0, - extra_error: 5, + extra_error: 0, panic: 0, } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.error-diff.json b/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.error-diff.json deleted file mode 100644 index d56c814962..0000000000 --- a/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.error-diff.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "required_errors": {}, - "required_error_lines": {}, - "extra_errors": { - "TS2339": 1 - }, - "extra_error_lines": { - "TS2339": [ - 10 - ] - } -} \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.stats.rust-debug b/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.stats.rust-debug index 0498397634..c086b5ab15 100644 --- a/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/conformance/jsx/tsxTypeArgumentsJsxPreserveOutput.stats.rust-debug @@ -1,6 +1,6 @@ Stats { required_error: 0, matched_error: 0, - extra_error: 1, + extra_error: 0, panic: 0, } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.error-diff.json b/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.error-diff.json index 62036b763e..fd726daa27 100644 --- a/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.error-diff.json +++ b/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.error-diff.json @@ -1,8 +1,9 @@ { "required_errors": { "TS2322": 6, + "TS2540": 2, "TS2542": 1, - "TS2540": 1, + "TS2339": 1, "TS2403": 1 }, "required_error_lines": { @@ -14,11 +15,15 @@ 109, 111 ], + "TS2540": [ + 137, + 139 + ], "TS2542": [ 138 ], - "TS2540": [ - 139 + "TS2339": [ + 140 ], "TS2403": [ 266 diff --git a/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.stats.rust-debug b/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.stats.rust-debug index d5dbbd0f4f..df5398b133 100644 --- a/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/conformance/types/conditional/conditionalTypes1.stats.rust-debug @@ -1,6 +1,6 @@ Stats { - required_error: 9, - matched_error: 11, + required_error: 11, + matched_error: 9, extra_error: 3, panic: 0, } \ No newline at end of file diff --git a/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug b/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug index 591d5666c8..9621773be7 100644 --- a/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug +++ b/crates/stc_ts_type_checker/tests/tsc-stats.rust-debug @@ -1,6 +1,6 @@ Stats { - required_error: 3714, - matched_error: 6320, - extra_error: 757, + required_error: 3716, + matched_error: 6318, + extra_error: 751, panic: 106, } \ No newline at end of file