dprint codebase - #13
Conversation
22c8c50 to
5dbe1daCompareb346117 to
ee8490fCompareUh oh!
There was an error while loading. Please reload this page.
| "path": "/bin/bash", | ||
| "icon": "terminal-bash", | ||
| }, | ||
| }, |
There was a problem hiding this comment.
does this undo the trailing-comma eslint rule you enabled elsewhere?
There was a problem hiding this comment.
No, since this is a JSON file, which aren't linted. If you open this file now in our repo, VS Code actually already complains, we just have nothing that can fix it.
| if ( | ||
| expr.expression.kind === SyntaxKind.PropertyAccessExpression && |
There was a problem hiding this comment.
I'm not a huge fan of this additional line, although it's OK.
sandersn
commented
Sep 12, 2022
I'd vote for a real line limit in the eventual PR; I don't like that this version produces overlong lines. |
jakebailey
commented
Sep 12, 2022
I think those cases can actually be "fixed" by making sure that they aren't hanging weirdly in the original code, which I can do earlier in the stack or after in a cleanup commit. But, yes, I do think that we should have a line limit. |
8e9aea7 to
fb868e5Compare089d88e to
33f4d1bCompare3afd223 to
aeb6799Compareb4fbbe3 to
e254ff6Comparecbf8f89 to
b79f86dCompare1c103c2 to
d79beb2Compare4ffc0e3 to
1013b6aCompare3c4c7f9 to
79c5998Compare[git-generate] npm ci npx eslint . --fix
[git-generate] test -f ./node_modules/.bin/dprint || npm ci npx dprint fmt
The first two commits run an eslint rule for trailing commas; this is just to eliminate it from the dprint diff as making our trailing commas consistent takes up a good portion of the diff. You can view just the "Run dprint" commit to see what dprint changed past that.
There are still some TODOs:
operatorPositionset tomaintain; I would prefernextLine(I find this much more readable), but right now we have a mix of both, but mostlysameLine. See also dprint codebase + lineWidth=120 and operatorPosition=nextLine #18.src/lib.maintainuses, to ensure that it isn't possible to write "invalid" code and have it not be caught without our eslint rules. e.g. if statements without braces that are too big.import { blah } from "..."instead of forcing multi-line.