feat(formatters): add laravel pint as a .php formatter (#7312)

This commit is contained in:
nuno maduro 2026-01-21 16:31:39 +00:00 committed by GitHub
commit bfbcbc8863
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -340,3 +340,18 @@ export const rustfmt: Info = {
return Bun.which("rustfmt") !== null
},
}
export const pint: Info = {
name: "pint",
command: ["./vendor/bin/pint", "$FILE"],
extensions: [".php"],
async enabled() {
const items = await Filesystem.findUp("composer.json", Instance.directory, Instance.worktree)
for (const item of items) {
const json = await Bun.file(item).json()
if (json.require?.["laravel/pint"]) return true
if (json["require-dev"]?.["laravel/pint"]) return true
}
return false
},
}