You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: It is formatted using not deno.json, but sub/deno.json
sub/test.ts has console.log("sub/test")
Deno reports Checked 6 files
Research
I spent some time debugging it. It seems the additional CLI argument paths are added as include set to each workspace member FilePatterns. Thus, when Deno formats the root, it includes deno.json and test.ts; then, when Deno formats the sub workspace member, it includes sub/deno.json, sub/test.ts, and_ also . i.e. deno.json and test.ts again. Hence Checked 6 files message.
Note that deno fmt (without paths) works as expected.
The text was updated successfully, but these errors were encountered:
I have already spent some time working on some fmt and --watch enhancements locally (which led to discovering this bug). Hopefully I can open a PR that addresses this issue targetly, or maybe it will be a larger one.
Version: Deno 2.2.5
Steps to reproduce
Create the following workspace:
Then run
deno fmt .
(the.
is crucial here)Expected result
test.ts
must haveconsole.log('test');
sub/test.ts
must haveconsole.log("sub/test")
Checked 4 files
Actual result
test.ts
hasconsole.log("test")
deno.json
, butsub/deno.json
sub/test.ts
hasconsole.log("sub/test")
Checked 6 files
Research
I spent some time debugging it. It seems the additional CLI argument paths are added as
include
set to each workspace memberFilePatterns
. Thus, when Deno formats the root, it includesdeno.json
andtest.ts
; then, when Deno formats thesub
workspace member, it includessub/deno.json
,sub/test.ts
, and_ also.
i.e.deno.json
andtest.ts
again. HenceChecked 6 files
message.Note that
deno fmt
(without paths) works as expected.The text was updated successfully, but these errors were encountered: