Uh oh!
There was an error while loading. Please reload this page.
Use prettier - #18700
Conversation
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
I don't particularly mind running a second style tool; but we should probably also run tslint with --fix if we're going to start down the path of automatic fixes.
| gulp.watch("src/**/*.*", ["runtests-parallel"]); | ||
| }); | ||
| function withFold(name: string, action: () => void): void { |
There was a problem hiding this comment.
Why not withFold<T>(name: string, action: () => T): () => T, making the body:
return()=>{if(fold.isTravis()){console.log(fold.start(name));}constresult=action();if(fold.isTravis()){console.log(fold.end(name));}returnresult;}Allowing you to simply wrap whatever gulp task function you please? Should reduce nesting a bit, too (and clean up the diff).
Technically the fold won't work correctly for stream or promise return values... but w/e, it doesn't already and the higher-order definition looks a bit nicer at the use-site.
Jessica Franco (Jessidhia)
commented
Sep 28, 2017
(Anecdote warning) In my experience |
Mohamed Hegazy (mhegazy)
commented
Nov 8, 2017
this has gone stale. closing for now. |
Fixes#18340
WIP -- Blocked on arijs/prettier-miscellaneous#29
Does not include actually applying prettier; most of the changes are due to the issue mentioned above.
You can test it out in a checkout by using
gulp run prettier.(We could use vanilla
pretiterbut then most of the changes would be moving everyelsebranch up a line.)Also includes a precommit hook to ensure we're actually running it.
We should also be sure to apply this after any huge PRs are in, such as #17269.