-
Notifications
You must be signed in to change notification settings - Fork 0
dprint codebase #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dprint codebase #13
Conversation
22c8c50
to
5dbe1da
Compare
b346117
to
ee8490f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good start.
@@ -11,9 +11,9 @@ | |||
"terminal.integrated.profiles.linux": { | |||
"bash": { | |||
"path": "/bin/bash", | |||
"icon": "terminal-bash", | |||
}, | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this undo the trailing-comma eslint rule you enabled elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
src/compiler/binder.ts
Outdated
if ( | ||
expr.expression.kind === SyntaxKind.PropertyAccessExpression && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of this additional line, although it's OK.
I'd vote for a real line limit in the eventual PR; I don't like that this version produces overlong lines. |
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
fb868e5
Compare
089d88e
to
33f4d1b
Compare
3afd223
to
aeb6799
Compare
b4fbbe3
to
e254ff6
Compare
cbf8f89
to
b79f86d
Compare
1c103c2
to
d79beb2
Compare
4ffc0e3
to
1013b6a
Compare
3c4c7f9
to
79c5998
Compare
[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:
operatorPosition
set 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
.maintain
uses, 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.