fix(es/lints): Don't visit types while collecting const (#3967)

This commit is contained in:
Donny/강동윤 2022-03-11 17:41:28 +09:00 committed by GitHub
parent 978a210c68
commit c6b5371c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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 })
}