-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Use prettier in deno (in //tools/format.ts) #1708
Conversation
e9f669c
to
92fda3d
Compare
tools/util.ts
Outdated
/** | ||
* Returns true if the path exists. | ||
*/ | ||
export function existsSync (path: string): boolean { |
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.
Style error here - shouldn't be a space between existsSync and parens.
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.
Yes. Will fix it.
Something is wrong in this branch and formatting doesn't seem working now. I'll look into it.
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.
std/prettier/main.ts
was crashing at //tests/error_syntax.js
because the parser throws. The original prettier CLI seems ignoring the file when it can't parse it, and avoids crashing. I added error_syntax.js
to skip list to avoid the crash.
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.
Because of this file: https://github.com/denoland/deno/blob/master/.prettierignore
I guess std/prettier doesn't look at it?
tools/util.ts
Outdated
|
||
/** | ||
* Returns true if the path exists. | ||
*/ |
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.
Use a single line for jsdoc comments if possible.
* Looks up the available deno path with the priority | ||
* of release -> debug -> global | ||
*/ | ||
export function lookupDenoPath(): string { |
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.
Aside: I wonder if the executable location should be available in deno.
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 think that's convenient in some situations, like when deno is unavailable in $PATH.
5f95f38
to
949c0f5
Compare
949c0f5
to
09bf5d8
Compare
join("tools", "clang"), | ||
join("js", "deps"), | ||
join("tests", "badly_formatted.js"), | ||
join("tests", "error_syntax.js") |
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.
Please remove .prettierignore if we do this.
export const executableSuffix = platform.os === "win" ? ".exe" : ""; | ||
|
||
// Returns true if the path exists. | ||
export function existsSync(path: string): boolean { |
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.
existsSync is super useful. Maybe we should add it to the core API...
The comment should be jsdoc /** Returns true if the path exists. */
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.
Please update the documentation if necessary (note #1712)
9ebc6a9
to
ddae887
Compare
Removed |
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.
LGTM - nice work!
No description provided.