Skip to content

Conversation

@dsherret
Copy link
Member

@dsherret dsherret commented Sep 5, 2025

When running deno fmt with no input paths with no deno.json or package.json:

  • In tty environments, prompts for confirmation.
  • In non-tty environments, errors without providing the current directory (deno fmt .).

The reason for this is we had too many complaints of people accidentally running deno fmt in a directory that wasn't a JS project.

Closes #26707

@dsherret dsherret changed the title feat(fmt): prompt or require --force when providing no files and in directory without deno.json feat(BREAKING/fmt): prompt or require --force when providing no files and in directory without deno.json Sep 5, 2025
@dsherret dsherret changed the title feat(BREAKING/fmt): prompt or require --force when providing no files and in directory without deno.json feat(BREAKING/fmt): prompt or require --force when providing no files and no config files discovered Sep 5, 2025
@dsherret dsherret marked this pull request as ready for review September 5, 2025 19:49
@dsherret dsherret added this to the 2.5.0 milestone Sep 5, 2025
@dsherret dsherret changed the title feat(BREAKING/fmt): prompt or require --force when providing no files and no config files discovered feat(BREAKING/fmt): prompt or require deno fmt . when providing no files and no config files discovered Sep 5, 2025
@KnorpelSenf
Copy link
Contributor

Amazing changes, this happened to me way too often

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@dsherret dsherret merged commit ea419a6 into denoland:main Sep 8, 2025
19 checks passed
@dsherret dsherret deleted the feat_fmt_force branch September 8, 2025 18:28
Tango992 pushed a commit to Tango992/deno that referenced this pull request Sep 24, 2025
…files and no config files discovered (denoland#30623)

When running `deno fmt` with no input paths with no deno.json or
package.json:

* In tty environments, prompts for confirmation.
* In non-tty environments, errors without providing the current
directory (`deno fmt .`).

The reason for this is we had too many complaints of people accidentally
running `deno fmt` in a directory that wasn't a JS project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confirm deno fmt in well know directories

3 participants