Been bit by node ranges being incorrect in swc too many times. swc has a test suite for this (https://github.com/swc-project/swc/issues/583), but it's not great because people often just do UPDATE=1 and overwrite the expected outputs with incorrect information.
I think it would be good to add debug only assertions for this in dprint that gets inserted into the gen_node call for debugging then have the assertions in a separate file. It should also be done for comments and tokens.
Been bit by node ranges being incorrect in swc too many times. swc has a test suite for this (https://github.com/swc-project/swc/issues/583), but it's not great because people often just do
UPDATE=1
and overwrite the expected outputs with incorrect information.I think it would be good to add debug only assertions for this in dprint that gets inserted into the
gen_node
call for debugging then have the assertions in a separate file. It should also be done for comments and tokens.https://github.com/dprint/dprint-plugin-typescript/issues/650