File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515- [ cljfmt] ( https://github.com/weavejester/cljfmt )
1616- [ csharpier] ( https://csharpier.com/ )
1717- [ dart] ( https://github.com/dart-lang )
18+ - [ deno_fmt] ( https://github.com/denoland/deno ) as ` deno fmt `
1819- [ djhtml] ( https://github.com/rtts/djhtml )
1920- [ docformatter] ( https://github.com/PyCQA/docformatter )
2021- [ dprint] ( https://dprint.dev/ )
Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ M.dart = {
5353 stdin = true ,
5454}
5555
56+ M .deno_fmt = {
57+ cmd = ' deno' ,
58+ args = { ' fmt' , ' -' },
59+ stdin = true ,
60+ }
61+
5662M .djhtml = {
5763 cmd = ' djhtml' ,
5864 args = { ' -' },
Original file line number Diff line number Diff line change 1+ describe (' deno fmt' , function ()
2+ it (' can format' , function ()
3+ local ft = require (' guard.filetype' )
4+ ft (' typescript' ):fmt (' deno_fmt' )
5+
6+ local formatted = require (' test.formatter.helper' ).test_with (' typescript' , {
7+ [[ function ]] ,
8+ [[ fibonacci(num:]] ,
9+ [[ number):]] ,
10+ [[ number {]] ,
11+ [[ if ]] ,
12+ [[ (num <= 1 ]] ,
13+ [[ )]] ,
14+ [[ return num ;]] ,
15+ [[ return fibonacci(num - 1) + fibonacci(num - 2]] ,
16+ [[ );]] ,
17+ [[ }]] ,
18+ })
19+ assert .are .same ({
20+ [[ function fibonacci(num: number): number {]] ,
21+ [[ if (num <= 1) {]] ,
22+ [[ return num;]] ,
23+ [[ }]] ,
24+ [[ return fibonacci(num - 1) + fibonacci(num - 2);]] ,
25+ [[ }]] ,
26+ }, formatted )
27+ end )
28+ end )
You can’t perform that action at this time.
0 commit comments