swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
31.32k stars 1.23k forks source link

not generated warning or error when handle ts file with ts grammar error #6860

Open hardfist opened 1 year ago

hardfist commented 1 year ago

Describe the bug

typescript | babel will emit error when handle wrong syntax like this

image https://www.typescriptlang.org/play?#code/DYUwLgBGBcEN4CgLIgQ1gJRAYwPYCcATAHgD4EBfCAXnnXgooG4g image

but swc doesn't emit error about this image

Input code

let t: {a: Record<>} = {a:{}}

Config

empty

Playground link

https://play.swc.rs/?version=1.3.29&code=H4sIAAAAAAAAA8tJLVEosVKoTrQKSk3OL0qxsatVsAVxq2trrbmS8%2FOK83NS9XLy0zXUS6zUdUo0rQFO5c3GMgAAAA%3D%3D&config=H4sIAAAAAAAAA21UQZLjIAz8C%2Bc5bOU4D5jay7yBIkY4ZDFySSITV8p%2FX2EnOE7GJ9RIQmq1fDNn7sznzYyOGKieeMrirubTyDQCdxRHMR9GWCGhArOeHfUg6gF8%2BHM46G1CZFjvP8wQcwxTTdXhMBIw17PGlAGyqBFcYvVzRPjDj6gjYgKX32zr2MYs0ANtoR2m5EYGe3HUIuprjiJj3kFFwNuRcHxCs48SMWuyB%2BbBeduhb134SNBJvMDmojnUJbMW1ipZQA%2FH0veVvtUTLi4VJy0XXBca9MUWd8LIYkPJ%2FALtKl2htcm7VwyWQArlh88ZY97x8A9A60yOObsBtsgFDzqHvWf4xSvmoEOUqaE64K2qDL02Z2MMrcNaNZDEjS0CXzqoHXZb8ju4a4ijBwshKNstmH%2BidKctWZUihmYqay5sM1hN%2B9DTHq0SeAO%2FtCp5HscdH5ycXjGehiOmtxQDyAn9G6xECL6CpOq9jq9oyR6UZvBPF4Wr2WSqwxe0qS7bg2cVhMbYPuGxyVd3cnC5b7Kcq%2BQESAX%2BF9IImzaEdKUC0lBXksB1sh6C6lM7v836aTL0pSa7LcTroiuJA%2BYzm3lb7zVh5O%2B7813q%2BbLELb8IfdaYef4PrQ4RCGUEAAA%3D

Expected behavior

emit error or warning

Actual behavior

not emit error or warning

Version

1.3.29

Additional context

No response

kdy1 commented 10 months ago

Closing as fixed.

https://play.swc.rs/?version=1.3.107&code=H4sIAAAAAAAAA8tJLVEosVKoTrQKSk3OL0qxsatVsAVxq2trrbmS8%2FOK83NS9XLy0zXUS6zUdUo0rQFO5c3GMgAAAA%3D%3D&config=H4sIAAAAAAAAA31VS47bMAzdzykCr2fbTQ9QzKZnEBSLcpRaokFSMwmC3L2UYucrZ2PYfPx%2Fnk8fm0235777vTnpq35Mlhjo%2Bq0SPiaxB5V0cpyAewqTdJ8LKlwgoQxVcr4AnVgaQIoR8K9ZuxsRGWbtWRRDCv54H67HOBEw38lUqu5yhCRF7O3I8HmPEf7wg98q3yKOYNMbxFg2IQkMQC3HPY6jnRjMt6WGl5KppcDYClHALODMRDg18eSCBEwa8xV1YJ3p0UEDCgS9hG9omWksNUus5TXqqbCDbR6GOuIna%2Fi2Y7bSiAmHOhLNtuF1h4HF%2BJxaLbyAKz24gHNzny2DNwSSKb3a7TGklZn8A9AOjJY52Qgtv1XD6z6tWfu3liF5XVk5NnBd71aVCQZtqgnBNzpbOgMkoTVNApd7KJ3tW%2BnM8Er7ODgw4L3uSsM1%2FwTpd62g5cbRNwCdr%2FWtrboA5nqFK3g5iDfwH61S2gs2a0Qru3WUj3GL45sAEWSH7o2CjkJwHSZlicO0jufkQFcDXFMlcwVeSUAPQNCMlStfdkPPQz2aYcTtjSZmhfOVgqNNw%2B3eH2gYDgKkFPMF4wRP99IJKQV6pHhPvwS2l0fuJfB6%2FaX3p%2FMS%2FGN51khdRJdrCvNfpGxRIX8desS05%2B6muRD%2BkkgX%2BO9iXcs7%2Fwc6MHTglQYAAA%3D%3D

kdy1 commented 10 months ago

Oops. I misread the issue