Repository navigation
Detect dprint config files - #35
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_NAMESinresolve_main_config_path.rs: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, notlinter— dprint is a formatting platform with no lint rules.JavaScriptandTypeScript, its flagship plugin, rather than listing every plugin it offers (JSON, Markdown, TOML, Dockerfile). Same reasoning as Prettier.excludesglobs 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 thedprint.jsoncname.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
JSONorJSONC, the latter added for Biome in #34:One new tag (
dprint), no new filetypes, noNON_LANGUAGE_FILETYPESentries.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.mdmoves 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 thechanges/note.🤖 Generated with Claude Code