3 ms·
I don’t see this as a breaking change. Period. The tsconfig.json files tsc itself generates and parse are definitionally JSONC. TypeScript config files are JSO
by donatj 3y ago
I don’t see this as a breaking change. Period.
The tsconfig.json files tsc itself generates and parse are definitionally JSONC. TypeScript config files are JSONC. TypeScript itself via `tsc --init` creates a file absolutely loaded with comments.
It’s clearly the other tools that can’t handle JSONC that are the broken part. They can’t handle configs that typescript itself generates.
The contract for “breaking” here isn’t between the tool and every single poorly written tool in existence. It’s between Prettier and the config file, and it’s correctly encoding the config file.
- mgraczyk 3y agoIt was a breaking change, lots of people had to change their broken code, including me
- donatj 3y agoYou had to change your code because it was literally broken to begin with. It's not a "breaking change" if a library continues to do exactly what it's advertised as doing in a completely compatible way and already broken code downstream at no fault of the authors suddenly doesn't like it. Say a JPEG library added an additional and completely harmless metadata field - and then some JPEG parser explodes because it had hardcoded metadata fields. That's not a breaking change on the JPEG libraries part. That's just a bug on the parsers part.
- mgraczyk 3y agoMy code wasn't broken, I had a tsconfig file that was formatted by prettier and prettier removed trailing commas. Then I updated prettier without reformatting and my tests failed because prettier rejected the now-incorrectly formatted tsconfig file. Also your analogy is wrong and not what is happening here. Suppose that a JPEG encoder encoded files as png when the flag is `--filetype=unknown`. Then in a patch release the behavior changes so that "unknown" means jpeg. That's closer to what happened here.
- silverwind 3y agoSo, don't upgrade it until you fixed your code?
- mgraczyk 3y agoNormally patch updates do not require you to fix your code but often include desirable security fixes. That is the purpose of semantic versioning.