diff --git a/crates/swc_css_codegen/tests/fixture.rs b/crates/swc_css_codegen/tests/fixture.rs index 34c1d08dac2..a18d892ac9a 100644 --- a/crates/swc_css_codegen/tests/fixture.rs +++ b/crates/swc_css_codegen/tests/fixture.rs @@ -405,7 +405,7 @@ fn linefeed_lf(input: PathBuf) { let fm_output = cm.load_file(&output).unwrap(); - assert_eq!(false, css_str.contains("\r\n")); + assert!(!css_str.contains("\r\n")); NormalizedOutput::from(css_str) .compare_to_file(output) @@ -484,7 +484,7 @@ fn linefeed_crlf(input: PathBuf) { let fm_output = cm.load_file(&output).unwrap(); - assert_eq!(true, css_str.contains("\r\n")); + assert!(css_str.contains("\r\n")); NormalizedOutput::from(css_str) .compare_to_file(output) diff --git a/crates/swc_ecma_lints/src/rules/const_assign.rs b/crates/swc_ecma_lints/src/rules/const_assign.rs index 9ec91847d8b..f6de7c2fa8d 100644 --- a/crates/swc_ecma_lints/src/rules/const_assign.rs +++ b/crates/swc_ecma_lints/src/rules/const_assign.rs @@ -92,6 +92,8 @@ struct Collector<'a> { } impl Visit for Collector<'_> { + noop_visit_type!(); + fn visit_assign_pat_prop(&mut self, p: &AssignPatProp) { p.visit_children_with(self); diff --git a/crates/swc_ecma_lints/tests/pass/issue-3956/1/input.ts b/crates/swc_ecma_lints/tests/pass/issue-3956/1/input.ts new file mode 100644 index 00000000000..d08b8d05a66 --- /dev/null +++ b/crates/swc_ecma_lints/tests/pass/issue-3956/1/input.ts @@ -0,0 +1,8 @@ +function fn1({ x, y }: { x: string, y: string }): string { + return x + y +} + +function fn2({ x, y }: { x: string, y: string }): string { + const fn3: ({ x, y }: { x: string, y: string }) => string = fn1 + return fn3({ x, y }) +} \ No newline at end of file