Audio: format, codec id, sample rate, channels, bit depth, bit rate, language. Video: format, codec id, aspect, frame rate, bit rate, color space, chroma subsampling, bit depth, scan type, scan order. If there existed another project that was identical to Prettier except that it also had a setting to allow automatic joining and splitting of string literals with + or (''), I would prefer using it over Prettier, and I believe more people would as well, because a code formatter that requires you to modify things manually is, well, not very useful over one that doesn't.Īnother idea is to have another project that does only these transformations that require modifying the AST, made to work on top of Prettier itself, but I think this is being a little too zealous on not touching the AST. MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files. Joining concatenated string literals in the same line is a similar problem that comes to mind. join('') to at least remedy the situation, even if it means modifying the AST in these very particular cases. But that doesn't mean that we can't have well-formatted code because of it, since we can still use 'foo' + 'bar' and. Python has with string literal juxtaposition. It's true that it's ECMAScript's fault for not having a way to split long strings into multiple lines like i.e. (By the way, I tested this output in my setup, and Prettier doesn't change it, leaving the hanging function(done) where it is). The error message is pretty bad, but in particular the function(done) in the it() line is completely off. With a heuristic like that, the following would be true: I'm more in the camp that thinks they should never be broken up, but the resolved upon behavior seems pretty reasonable.Ĭouldn't we create a heuristic to detect if a line with a long string should be broken into multiple lines or not? For example, if the characters that are NOT part of the string are less than 20? It's much more That template string conversation is really interesting. Whereas without line wraps, the conversion changes it from 1 line to 3 lines, a 200% increase in vertical space. With softwraps enabled, the prettier formatting changes it from 4 lines to 6 lines, a 50% increase in vertical space. I think it's the percent increase in vertical space that kills me. In my case, I just hate looking at those triple lines when it could just be one beautiful skimmable line. I don't use soft wraps, and most developers I know don't - but I could be an anomaly. That's an interesting point about soft wraps suchipi.
0 Comments
Leave a Reply. |