When adding prettier to a large codebase for the first time, it is important to be extremely careful. While I generally trust prettier to not break my code, I'd like to be sure.
I currently have a command that does, essentially, prettier --debug-check 'files' && prettier --write 'files', but debug-check raises a lot of issues I don't care about (namely, prettier(x) != prettier(prettier(x)) and a select few "safe" AST modifications (like <span> hi</span> to <span>{' '}hi</span>).
Instead, it would be nice to be able to run prettier with --write but throw an error instead of writing if the input ast does not equal the output ast, modulo whitelisted deviances like {' '}.
I recognize that this would be slower 😄
When adding prettier to a large codebase for the first time, it is important to be extremely careful. While I generally trust prettier to not break my code, I'd like to be sure.
I currently have a command that does, essentially,
prettier --debug-check 'files' && prettier --write 'files', butdebug-checkraises a lot of issues I don't care about (namely,prettier(x) != prettier(prettier(x))and a select few "safe" AST modifications (like<span> hi</span>to<span>{' '}hi</span>).Instead, it would be nice to be able to run prettier with
--writebut throw an error instead of writing if the input ast does not equal the output ast, modulo whitelisted deviances like{' '}.I recognize that this would be slower 😄