Buckets:
37 GB
4,042,753 files
Updated about 1 month ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| src | 2 items | ||
| tests | 2 items | ||
| CHANGELOG.md | 2.24 kB xet | 26671fb4 | |
| README.md | 3.3 kB xet | 9e505459 | |
| deno.json | 411 Bytes xet | 9b45173e | |
| mod.ts | 481 Bytes xet | 7d4fb815 |
@zuke/dprint
Typed dprint task wrappers for
Zuke builds, in a fluent
settings-lambda API. fmt formats files in place; check verifies formatting.
Arguments stay a discrete argv array, so command construction is injection-free.
import { DprintTasks } from "@zuke/dprint";
await DprintTasks.check((s) => s.config("dprint.json"));
await DprintTasks.fmt((s) => s.files("src").excludes("**/*.md").incremental());
Paths
Every path argument accepts either a string or an AbsolutePath from
@zuke/core, so a path built with absolutePath can be passed in directly.
API
Full typed API — generated from deno doc
`@zuke/dprint` — typed `dprint` task wrappers for Zuke builds.
Configure a fluent settings object in a lambda; the task builds the argv and
runs it. `fmt` formats files in place; `check` verifies formatting.
```ts
import { DprintTasks } from "@zuke/dprint";
await DprintTasks.check((s) => s.config("dprint.json"));
```
@module
const DprintTasks: DprintTasksApi
Typed task functions for the `dprint` code formatter.
class DprintCheckSettings extends DprintSettings
Settings for `dprint check` (verify formatting without writing).
override protected subcommand(): string
The dprint subcommand this settings class runs: `check`.
override protected onOutput(output: CommandOutput): void
Report `Unformatted`, the files that need formatting, onto the build summary.
class DprintFmtSettings extends DprintSettings
Settings for `dprint fmt` (format files in place).
override protected subcommand(): string
The dprint subcommand this settings class runs: `fmt`.
override protected onOutput(output: CommandOutput): void
Report `Formatted`, the files the run changed, onto the build summary.
abstract class DprintSettings extends ToolSettings
Shared options for a `dprint` subcommand (`fmt` or `check`).
override protected defaultTool(): string
The default executable this settings class invokes: `dprint`.
override protected defaultResolution(): ToolResolution
Resolve the binary from `node_modules/.bin` by default — dprint is an npm-distributed tool.
abstract protected subcommand(): string
The dprint subcommand this settings class runs.
config(path: PathLike): this
Use an explicit config file (`-c`/`--config`).
files(...patterns: PathLike[]): this
File paths or globs to format/check (positional); repeatable.
excludes(...patterns: string[]): this
Exclude files matching a pattern (`--excludes`); repeatable.
incremental(): this
Only process files that changed since the last run (`--incremental`).
allowNoFiles(): this
Do not error when no files are matched (`--allow-no-files`).
override protected buildArgs(): string[]
Assemble the `dprint <subcommand>` argv from the configured options.
interface DprintTasksApi
The shape of {@link DprintTasks}.
fmt(configure?: Configure<DprintFmtSettings>): Promise<CommandOutput>
Format files in place: `dprint fmt`.
check(configure?: Configure<DprintCheckSettings>): Promise<CommandOutput>
Verify formatting: `dprint check`.
- Total size
- 37 GB
- Files
- 4,042,753
- Last updated
- Oct 24
- Pre-warmed CDN
- US EU US EU