David Sherret
ea419a6e39
feat(BREAKING/fmt): prompt or require deno fmt .
when providing no files and no config files discovered ( #30623 )
...
ci / pre-build (push) Waiting to run
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
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.
2025-09-08 14:28:47 -04:00
Oliver Kuckertz
7b16237a43
feat(fmt): apply object spacing to import/export lines ( #30371 )
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-08-28 19:23:45 -04:00
David Sherret
5f9a64bcaf
refactor: remove WorkspaceDirectoryProvider ( #30467 )
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
2025-08-21 11:27:12 -04:00
林炳权
68297b5f10
chore: Rust 1.89.0 ( #30364 )
...
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Related PR: https://github.com/denoland/deno/pull/30354
2025-08-09 11:11:48 +00:00
David Sherret
32baa286b7
refactor: update to deno_path_util 0.5.2 ( #30211 )
2025-07-27 08:44:29 -04:00
Nathan Whitaker
9379a74e08
chore: update to edition 2024 ( #29923 )
ci / publish canary (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
2025-07-02 17:59:39 -07:00
Kingsword
64525d289a
feat(fmt): remove UTF-8 BOM instead of maintaining it ( #29796 )
...
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2025-06-28 00:50:22 -04:00
Bartek Iwańczuk
695df57358
fix(fmt/css): prefer collapsing font-family values ( #29864 )
...
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Closes https://github.com/denoland/deno/issues/29336
2025-06-24 20:28:53 +00:00
Bartek Iwańczuk
4e23d9b5f0
feat(fmt): add support for .xml, .svg and .mustache files ( #29851 )
...
Formatting `.mustache` files still requires `--unstable-component`
flag when running `deno fmt`
Closes https://github.com/denoland/deno/issues/20205
2025-06-24 17:16:33 +02:00
Janosh Riebesell
59c416662b
fix(fmt): handle TS as syntax in Svelte each block ( #29789 )
...
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Closes #29768
2025-06-17 20:10:06 +02:00
Yoshiya Hinosawa
79a9868d5e
fix(fmt): allow expressions used as key-value pair in css template literals ( #29369 )
2025-05-26 10:50:36 +09:00
林炳权
cb738ee5da
chore: Rust 1.86.0 ( #29435 )
...
Since `rust 1.87.0` reported `undefined symbol:
ring::pbkdf2::PBKDF2_HMAC_SHA1::*` in CI and it was difficult to debug
locally, use `rust 1.86.0` in CI tests for troubleshoot the errors
2025-05-25 23:40:48 +02:00
David Sherret
c4412ffb13
refactor: add deno_npm_installer
crate ( #29319 )
...
More changes/improvements will following in follow-up PRs.
2025-05-16 18:11:05 -04:00
David Sherret
08b236b5b7
Revert "fix(fmt): upgrade markup_fmt and malva" ( #29325 )
...
Reverts denoland/deno#29168
Ref: https://github.com/g-plane/malva/issues/34
2025-05-16 12:50:15 +02:00
Yoshiya Hinosawa
fab9b06878
fix(fmt): fail command when embedded language has syntax error ( #29259 )
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-05-15 10:51:48 +09:00
Jonh Alexis
f8615e404c
fix(fmt): indent width should be ignored when formatting with use tabs set to true ( #29205 )
2025-05-08 22:00:13 +00:00
Bartek Iwańczuk
d8857b9aee
fix(fmt): upgrade markup_fmt and malva ( #29168 )
...
Closes https://github.com/denoland/deno/issues/29034
2025-05-05 15:39:22 -05:00
Yoshiya Hinosawa
41fc04c00c
feat(fmt): support formatting of embedded css, html, and sql ( #29014 )
...
This commit adds the formatting of CSS, HTML, and SQL which are embedded in
Tagged Template Literal strings. The embedded languages are detected by
the tag name of the literal.
```ts
// triggers CSS formatting
const Div = styled.div`
margin: 5px;
padding: ${padding}px;
`;
// triggers HTML formatting
document.body.innerHTML = html`
<main>
<h1>Hello ${name}!<h1>
</main>
`;
// triggers SQL formatting when `--unstable-sql` passed
const query = sql`
SELECT
${table}.${field}
FROM
${table};
`
```
See https://github.com/dprint/dprint-plugin-typescript/pull/701 for more
details
2025-04-29 22:17:55 +09:00
Yoshiya Hinosawa
e142382350
feat(fmt): add fmt options ( #28946 )
...
This commit adds 14 new options from dprint-plugin-typescript:
- quoteProps
- newLineKind
- useBraces
- bracePosition
- singleBodyPosition
- nextControlFlowPosition
- trailingCommas
- operatorPosition
- jsx.bracketPosition
- jsx.forceNewLinesSurroundingContent
- jsx.multiLineParens
- typeLiteral.separatorKind
- spaceAround
- spaceSurroundingProperties
related: https://github.com/denoland/deno_config/pull/162
2025-04-29 21:31:08 +09:00
David Sherret
a5d39b085d
feat(fmt/lint): add --permit-no-files
( #28753 )
...
Closes https://github.com/denoland/deno/issues/28728
2025-04-15 17:57:34 +00:00
WWRS
dca9f7c0c3
fix(fmt): use non-zero exit code when formatting fails ( #28523 )
2025-04-04 14:48:47 +01:00
David Sherret
273ec9fbf2
refactor: add WorkspaceFactory
and ResolverFactory
( #27766 )
...
Allows easily constructing a `DenoResolver` using the exact same logic
that we use in the CLI (useful for dnt and for external bundlers). This
code is then used in the CLI to ensure the logic is always up-to-date.
```rs
use std::rc::Rc;
use deno_resolver:🏭 :ResolverFactory;
use deno_resolver:🏭 :WorkspaceFactory;
use sys_traits::impls::RealSys;
let sys = RealSys;
let cwd = sys.env_current_dir()?;
let workspace_factory = Rc::new(WorkspaceFactory::new(sys, cwd, Default::default()));
let resolver_factory = ResolverFactory::new(workspace_factory.clone(), Default::default());
let deno_resolver = resolver_factory.deno_resolver().await?;
```
2025-01-23 18:52:55 -05:00
David Sherret
563a7c284e
refactor: use DataUrl from deno_media_type ( #27783 )
...
This was moved from deno_graph to deno_media_type.
2025-01-22 20:35:16 +00:00
Leo Kettmeir
ea30e188a8
refactor: update deno_core for error refactor ( #26867 )
...
Closes #26171
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-08 14:52:32 -08:00
Bartek Iwańczuk
b6f2646c1c
refactor: make IncrementalCache
accept a CacheDBHash
( #27570 )
2025-01-06 23:56:36 +00:00
Kenta Moriuchi
8fb073d7b4
chore: Happy New Year 2025 ( #27509 )
2024-12-31 19:12:39 +00:00
David Sherret
ac7b33a340
chore: cargo fmt - turn on group_imports=StdExternalCrate ( #26646 )
2024-12-31 12:13:39 -05:00
David Sherret
4638caa740
refactor: do not use deno_fs::FileSystem
everywhere ( #27508 )
...
This changes the cli to mostly use `std::fs` via `sys_traits` instead of
the implemention of `deno_fs::FileSystem`.
2024-12-31 11:29:07 -05:00
David Sherret
c391ad315e
refactor: use sys_traits ( #27480 )
2024-12-30 12:38:20 -05:00
Bartek Iwańczuk
53936eda11
fix(fmt): stable formatting of HTML files with JS ( #27164 )
...
Closes https://github.com/denoland/deno/issues/26407
Closes https://github.com/denoland/deno/issues/26763
Closes https://github.com/denoland/deno/issues/26560
Closes https://github.com/denoland/deno/issues/26744
Closes https://github.com/denoland/deno/issues/27030
2024-12-03 02:04:55 +01:00
João Baptista
9eee2a0e9e
fix(fmt): return None
if sql fmt result is the same ( #27014 )
...
Similar with https://github.com/denoland/deno/pull/25848 , we need to
make `format_sql` to return `None` so we do not flag well formatted sql
files as being wrong.
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>
2024-11-22 22:57:33 +00:00
João Baptista
c55e936be0
feat(fmt): support SQL ( #26750 )
...
This commit adds support for .sql files in "deno fmt" subcommand.
Closes: https://github.com/denoland/deno/issues/25024
---------
Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-19 21:01:16 +00:00
Bartek Iwańczuk
106d47a013
feat: fmt and lint respect .gitignore file ( #26897 )
...
Closes https://github.com/denoland/deno/issues/26573
2024-11-18 23:54:28 +01:00
HasanAlrimawi
abf06eb87f
feat(watch): log which file changed on HMR or watch change ( #25801 )
...
Closes #25504
2024-11-16 15:59:31 +01:00
David Sherret
6b5cb41545
fix(fmt): error instead of panic on unstable format ( #26859 )
2024-11-13 15:39:40 +00:00
Bartek Iwańczuk
64e887083a
fix(fmt): don't use self-closing tags in HTML ( #26754 )
...
Closes https://github.com/denoland/deno/issues/26748
2024-11-06 13:56:03 +01:00
Bartek Iwańczuk
9a39a98b57
fix(fmt): ignore file directive for YAML files ( #26717 )
...
Closes https://github.com/denoland/deno/issues/26712
Support `# deno-fmt-ignore-file` directive for YAML files.
Also added tests for single line ignores.
2024-11-04 17:57:29 +00:00
Pig Fang
49d31fa4a2
fix(fmt): upgrade formatters ( #26469 )
...
Fixes #25926
Fixes #26004
2024-10-22 12:15:59 +02:00
Bartek Iwańczuk
09a7cc4723
refactor(fmt): rewrite HTML syntax error handling ( #25892 )
2024-09-26 20:44:36 -04:00
Bartek Iwańczuk
6c26c1ed96
feat(fmt): better error on malfored HTML files ( #25853 )
...
Improves syntax errors for HTML formatter.
`broken.html`
```html
<div class=container > content
```
```
$ deno fmt broken.html
Error formatting: /Users/ib/dev/deno/tests/specs/fmt/html/broken.html
syntax error 'expect close tag' at line 3, column 0
Checked 1 file
```
```
$ ./target/debug/deno fmt broken.html
Error formatting: /Users/ib/dev/deno/tests/specs/fmt/html/broken.html
Syntax error (expect close tag) at file:///Users/ib/dev/deno/tests/specs/fmt/html/broken.html:3:0
Checked 1 file
```
2024-09-25 01:00:16 +00:00
Bartek Iwańczuk
3242550f5f
fix(fmt): --check was broken for CSS, YAML and HTML ( #25848 )
...
`deno fmt --check` was broken for CSS, YAML and HTML files.
Before this PR, formatting any of these file types would return a
string, even though the contract in `cli/tools/fmt.rs` is to only return a
string if the formatting changed. This causes wrong flagging of these files
as being badly formatted even though diffs showed nothing (because
they were in fact formatted properly).
Closes https://github.com/denoland/deno/issues/25840
2024-09-24 15:54:48 +02:00
Óscar Otero
1287739ddf
feat(fmt): support vto and njk extensions ( #25831 )
...
Fixes #25802
markup_fmt plugin supports some HTML-like formats like Angular, Jinja,
Twig, Nunjucks or Vento, that are not supported by `deno fmt`. This PR
adds support for the extensions `njk` (Nunjucks) and `vto` (Vento).
Angular doesn't have a custom extension (it uses `html` afaik) and Jinja
and Twig are template engines written in Python and PHP respectively so
it doesn't make sense to be supported by Deno.
2024-09-23 14:27:58 -04:00
Bartek Iwańczuk
a7ac89935b
feat(fmt): stabilize CSS, HTML and YAML formatters ( #25753 )
...
This commits stabilizes CSS, HTML and YAML formatters
in `deno fmt`.
It is no longer required to use either of these flags:
- `--unstable-css`
- `--unstable-html`
- `--unstable-yaml`
Or these `unstable` options in the config file:
- `fmt-css`
- `fmt-html`
- `html-yaml`
2024-09-23 18:01:04 +02:00
Leo Kettmeir
bb45446fa7
fix: don't include extensionless files in file collection for lint & fmt by default ( #25721 )
...
When using the `ext` flag, it will still attempt formatting them with
the provided extension
2024-09-19 11:25:48 +02:00
Leo Kettmeir
a1d0a427e8
feat: default to TS for file extension and support ext flag in more scenarios ( #25472 )
...
Closes #11220
Currently does lint, fmt, and repl
2024-09-18 21:15:13 +02:00
David Sherret
a14e9f55b4
feat(fmt): sort type-only named import/exports last ( #25690 )
...
Closes #22583
2024-09-17 18:26:23 +01:00
HasanAlrimawi
3f6afd1947
fix: update malva in deno to support astro css comments ( #25553 )
...
This PR addresses issue #25534
**Code Changes**
- Updated malva version to the latest in cli/Cargo.toml.
- Updated LanguageOptions to match new Malva config.
- Added test case same as the issue to assure changes success.
2024-09-10 12:54:43 +02:00
Pig Fang
3daab54612
fix(fmt): fix tabs in YAML ( #25536 )
...
Fixes #25176
2024-09-09 15:45:17 +00:00
Pig Fang
f6c537f898
fix(fmt): fix incorrect quotes in components ( #25249 )
...
Unlike in dprint, `single_quote` option is shared between all
formatters, so we shouldn't change this option when formatting
attributes in components. This PR fixes this.
This problem doesn't affect formatting HTML.
2024-08-28 09:48:14 -04:00
Pig Fang
3a3315cc7f
feat(fmt): support HTML, Svelte, Vue, Astro and Angular ( #25019 )
...
This commit adds capability to format HTML, Svelte, Vue, Astro and Angular
files.
"--unstable-html" is required to format HTML files, and "--unstable-component"
flag is needed to format other formats. These can also be specified in the config
file.
Close #25015
2024-08-14 22:58:48 +02:00