💅 Bun monorepo hoisting of node modules confuses biome's noUndeclaredDependencies rule #4414
Closed
1 task done
Labels
S-Needs triage
Status: this issue needs to be triaged
Environment information
Rule name
noUndeclaredDependencies
Playground link
https://github.com/calvinusesyourcode/biome-reproducible-error
Expected result
Expected result
Biome should know to use the package.json closest to the file.
Error
TLDR: I am using
bun
and have a monorepo with apackages/
folder, and I am getting linter errors relating to the root package.json, meanwhile biome should be using the package's package.json.Cause of error (in theory)
Because bun monorepos hoist the depedencies up into the root node_modules, instead of using a local node_modules folder in the nested package, biome gets confused when it sees the npm package installed in the root node_modules folder but no depedency mentioned in the root package.json. I bet it would have no problem if the npm package was installed in the nested package's node_modules.
To reproduce:
Here's a one-liner:
And then look at line 3 and
'react'
should give a warning with the messageThe current dependency isn't specified in your package.json. biome(lint/correctness/noUndeclaredDependencies)
Code of Conduct
The text was updated successfully, but these errors were encountered: