mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix prettier triggering from dependencies
This commit is contained in:
parent
a6572725bc
commit
20a92ea019
1 changed files with 5 additions and 3 deletions
|
|
@ -65,9 +65,11 @@ export const prettier: Info = {
|
|||
],
|
||||
async enabled() {
|
||||
const app = App.info()
|
||||
const nms = await Filesystem.findUp("node_modules", app.path.cwd, app.path.root)
|
||||
for (const item of nms) {
|
||||
if (await Bun.file(path.join(item, ".bin", "prettier")).exists()) return true
|
||||
const items = await Filesystem.findUp("package.json", app.path.cwd, app.path.root)
|
||||
for (const item of items) {
|
||||
const json = await Bun.file(item).json()
|
||||
if (json.dependencies?.prettier) return true
|
||||
if (json.devDependencies?.prettier) return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue