Skip to content

Detect dprint config files - #35

Merged
sabbaticas merged 1 commit into
mainfrom
feat/dprint-detection
Oct 5, 2026
Merged

sabbaticas merged 1 commit into
mainfrom
feat/dprint-detection

Conversation

@sabbaticas

Copy link
Copy Markdown
Contributor

Folds dprint into the linter/formatter detection set added in #34. Version stays at 0.0.20, which is unreleased, so this ships with that release rather than needing a 0.0.21.

Why it was left out, and what changed

dprint was in #34's rejected list because its documentation never enumerates the filenames it discovers — and a missing rule is better than a wrong one.

The answer is in the source. POSSIBLE_CONFIG_FILE_NAMES in resolve_main_config_path.rs:

["dprint.json", "dprint.jsonc", ".dprint.json", ".dprint.jsonc"]

Four names, searched in that order while walking up ancestor directories, with no config/ subdirectory. The setup page corroborates the two hidden variants: "The dprint CLI supports a default hidden configuration at .dprint.json or .dprint.jsonc."

Classification

  • formatter, not linter — dprint is a formatting platform with no lint rules.
  • Languages capped at JavaScript and TypeScript, its flagship plugin, rather than listing every plugin it offers (JSON, Markdown, TOML, Dockerfile). Same reasoning as Prettier.
  • No ignore file — exclusions are excludes globs inside the config, as with golangci-lint.

Checked against the revive trap

revive was rejected in #34 because its only auto-discovered config is $HOME/revive.toml, a user-level path. dprint also reads a global config — at ~/.config/dprint/dprint.jsonc, reusing the dprint.jsonc name.

That does not disqualify it, and the distinction is the point: revive has no project-level discovery at all, so a repository rule would be fiction. dprint's four names are genuinely project-level; its global config merely shares a name in a different directory. Recorded in the docs so the distinction isn't relitigated.

Cost

Nothing in the filetype tables — all four names already resolve to JSON or JSONC, the latter added for Biome in #34:

dprint.json      -> JSON    ['JavaScript', 'TypeScript', 'formatter', 'dprint', 'config']
.dprint.jsonc    -> JSONC   ['JavaScript', 'TypeScript', 'formatter', 'dprint', 'config']

One new tag (dprint), no new filetypes, no NON_LANGUAGE_FILETYPES entries.

31 tools and 100 exact filenames, up from 30 and 96. Tags 118 → 119.

Testing

696 pass, up from 686: six new dprint tests, plus four the existing vocabulary drift test picked up automatically from the new filenames. Five of the six failed before the rule was added.

docs/linter-detection-rules.md moves dprint from the rejected table to the inventory and records how it was settled; the rejected count drops from eleven to ten in CLAUDE.md and the changes/ note.

🤖 Generated with Claude Code

dprint was left out of the initial linter detection set because its
documentation never enumerates the filenames it discovers, and a missing
rule is better than a wrong one. The answer is in the source:
POSSIBLE_CONFIG_FILE_NAMES in
crates/dprint/src/configuration/resolve_main_config_path.rs lists exactly
four names, searched in order while walking up ancestor directories, with
no config/ subdirectory. The setup page corroborates the two hidden
variants.

  dprint.json  dprint.jsonc  .dprint.json  .dprint.jsonc

Tagged formatter, not linter — dprint is a formatting platform with no
lint rules. Languages are capped at JavaScript and TypeScript, its
flagship plugin, rather than listing every plugin it offers (JSON,
Markdown, TOML, Dockerfile), on the same reasoning as Prettier. No ignore
file: exclusions are `excludes` globs inside the config, as with
golangci-lint.

Checked against the user-level trap that disqualified revive. dprint does
read a global config at ~/.config/dprint/dprint.jsonc, reusing the
dprint.jsonc name, but that does not disqualify it: revive's only
auto-discovered config is user-level, so a repository rule would be
fiction, whereas dprint's four names are genuinely project-level and the
global config merely shares a name in a different directory.

Costs nothing in the filetype tables — all four names already resolve to
JSON or JSONC, the latter added for Biome. One new tag, no new filetypes.

31 tools and 100 exact filenames, up from 30 and 96. Version stays at
0.0.20, which is unreleased, so this folds into that release rather than
needing a 0.0.21.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sabbaticas
sabbaticas merged commit bdfe287 into main Oct 5, 2026
4 checks passed
@sabbaticas
sabbaticas deleted the feat/dprint-detection branch October 5, 2026 05:05
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.

1 participant