-
-
Notifications
You must be signed in to change notification settings - Fork 475
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
💅 useNodejsImportProtocol
gets thrown although a npm package is installed with the same name
#3066
💅 useNodejsImportProtocol
gets thrown although a npm package is installed with the same name
#3066
Comments
add node: protocol
to importuseNodejsImportProtocol
gets thrown although a npm package is installed with the same name
@corsin-ragettli Could you share the package name you would like install? |
Hi, @vctqs1, Im having issues with the querystring package. I know it's deprecated but I use it in an old project... |
We could use the |
I think it should be easy enough. We can create a |
In this case, a |
You could write a file executable by node without any |
No, that's an assumption we can't do. Biome can be run anywhere. It can be installed globally because it's a binary, and it can analyse files or projects that aren't inside a package.json. Users can also install the binary inside editors and use a bundled binary. |
Fair enough, thanks for the explanation. I would like to start contributing to this project, but it sounds like this is the wrong issue to do that. What do you guys think? |
We do, we use the same But when Biome is executed from the project root against a file in an inner directory, it will start searching from the root instead of that inner directory for manifest files. This is a known bug that will affect some monorepo projects. |
May I ask why you're doing this, @corsin-ragettli? I would think that (I can set up a gist with a reproduction for the Presumably, this should be a new issue, but 🤷♂️ |
Hi, sorry for the late reply. I found this behavior in a super old repo where I haven't been working on a lot, so I don't know the in's and out's of this code. In the codebase we're actually using it in the web (via import syntax). I didn't want to look into weird behavior differences between the node implementation and the npm version, so I left it at that. I would imagine the import for the web uses the npm package, since you can't import node modules in the web (that's just an assumption tough). |
Ah, checked that repro again, and it is import. Not sure why I thought you were using require.
I would think so as well, but, when I think about it, importing bare specifiers isn't valid either. I assume you're bundling then, which makes me wonder if you're polyfilling in your build process. Anyway, I think that makes sense. Thanks for explaining. 😁 |
Environment information
Rule name
useNodejsImportProtocol
Playground link
https://github.com/corsin-ragettli/biome-nodeProtocol-error
Expected result
When a npm package with the same name as a node module is installed, don't throw a
useNodejsImportProtocol
errorCode of Conduct
The text was updated successfully, but these errors were encountered: