-
-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bun
is reported by noUndeclaredDependencies
#2074
Comments
Share my two cents here. To be honest I don't think we should hardcode dependencies in this rule. The A whitelist in the rule option seems a go to me. |
I agree with your idea. To me, it would be helpful to add an option and also detect |
Maybe using For now I agree an allowlist is the best way forward. |
I think this is the correct usage of the rule for this particular case. The user should either use the global If both aren't possible, then I think the rule is acceptable. Although, I don't know bun very well |
Thank you for your comments! For me, it is unintuitive that the rule doesn't report I understand that using the |
I think I misunderstood the issue. Is |
As a mid-solution (only work for project using TS), we could rewrite |
Sorry, your understanding should be right. I meant to say that we do not need to add runtime to dependencies, so should not be reported. |
bun
is reported by noUndeclaredDependencies
bun
is reported by noUndeclaredDependencies
I not in favor of this solution because this can introduce many false positives and false negatives that may confuse users and eventually may make this rule useless. TypeScript uses It would be much safer and configurable to let users set the allow list explicitly. And in the meantime before type inference is a thing, Biome won't be blamed :) |
Resolved with #3893. Thanks! |
Environment information
Rule name
noUndeclaredDependencies
Playground link
https://biomejs.dev/playground/?lintRules=all&code=aQBtAHAAbwByAHQAIAB7ACAAcwBsAGUAZQBwACAAfQAgAGYAcgBvAG0AIAAiAGIAdQBuACIACgAKAHMAbABlAGUAcAAoADEAKQA%3D&jsx=false
The playground does not support
package.json
, so it may not be meaningful.Expected result
Code
It should not report any error, but reports
bun
bynoUndeclaredDependencies
.Solution
biome/crates/biome_js_analyze/src/analyzers/nursery/no_undeclared_dependencies.rs
Lines 51 to 55 in dd1860e
To add
bun
here should fix this issue. I would be happy to open a PR.Code of Conduct
The text was updated successfully, but these errors were encountered: