3 ms·
It depends how aggressively your reformatter changes your code. For example, Prettier will take this JavaScript line: document.addEventListener('keydown', e
by mtlynch 6y ago
It depends how aggressively your reformatter changes your code. For example, Prettier will take this JavaScript line:
document.addEventListener('keydown', e => { console.log(e) });
and convert it to this, which changes both whitespace and syntax:
document.addEventListener("keydown", (e) => {
console.log(e);
});
I don't think there are any diff tools that can hide the differences there, even though they're superficial.
[0] https://prettier.io/ https://prettier.io/
- jlund-molfese 6y agoYou could try https://github.com/josephfrazier/prettier-diff https://github.com/josephfrazier/prettier-diff , but it's inconvenient to ask members of your team to download an entirely separate diff tool
- mtlynch 6y agoOh, that's interesting. I didn't realize that existed. Thanks for the pointer! Personally, I wouldn't want a niche diff tool globally wrapping my diff views. I'd worry too much about missing something important. And I agree that it's also a tough sell to get your teammates to all use this one particular diff tool.