Skip to content
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": "off" Didn't work #235

Closed
1 of 3 tasks
wuchuguang opened this issue Jun 8, 2024 · 15 comments
Closed
1 of 3 tasks

🐛 "useNodejsImportProtocol": "off" Didn't work #235

wuchuguang opened this issue Jun 8, 2024 · 15 comments
Labels

Comments

@wuchuguang
Copy link

VS Code version

1.89.1

Extension version

v2024.5.251958

Biome version

1.8.0

Operating system

  • Windows
  • macOS
  • Linux

Description

my beiome.js code

{
	"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
	"organizeImports": {
		"enabled": true
	},
	"linter": {
		"ignore": [
			"**/node_modules/**",
			"**/dist/**",
			"**/build/**",
			"**/run/**",
			"**/test/**"
		],
		"enabled": true,
		"rules": {
			"recommended": true,
			"style": {
				"useNodejsImportProtocol": "off"
			}
		}
	}
}

image

"useNodejsImportProtocol": "off" Didn't work

Steps to reproduce

1、I configured setting.json as provided by the plugin
2、biome init biome.js config
3、change biome.js like up

Expected behavior

4、Now in my code, I can't use require('path').
5、 npx biome lint is ok.

Does this issue occur when using the CLI directly?

No

Logs

that is all
@wuchuguang
Copy link
Author

The biome.js configuration doesn't seem to be working, is vscode-plugin.biome not using biome.js?

@wuchuguang
Copy link
Author

image
image

@wuchuguang
Copy link
Author

image

@Sec-ant
Copy link
Member

Sec-ant commented Jun 8, 2024

The configuration file is biome.json not biome.js.

And where do you put the configuration file?

@wuchuguang
Copy link
Author

The configuration file is biome.json not biome.js.

And where do you put the configuration file?

yes, my is biome.json

@wuchuguang
Copy link
Author

image

@ematipico
Copy link
Member

ematipico commented Jun 8, 2024

Is your configuration at the root of your project? From the look of it, it isn't, that's why it doesn't work.

@wuchuguang
Copy link
Author

Is your configuration at the root of your project? From the look of it, it isn't, that's why it doesn't work.

biome.json in my project.

I have multiple projects in my workspace

@wuchuguang
Copy link
Author

image

@Sec-ant
Copy link
Member

Sec-ant commented Jun 8, 2024

We have limitations in multi-root workspace support, please check the doc: https://biomejs.dev/reference/vscode/#my-biomejson-file-is-ignored-in-a-multi-root-workspace

@Sec-ant Sec-ant closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2024
@ematipico
Copy link
Member

ematipico commented Jun 8, 2024

Since v1.8 we support LSP workspaces. Docs are outdated. @wuchuguang can you create a reproduction?

@Sec-ant
Copy link
Member

Sec-ant commented Jun 8, 2024

Sorry

@Sec-ant Sec-ant reopened this Jun 8, 2024
@wuchuguang
Copy link
Author

s

Since v1.8 we support LSP workspaces. Docs are outdated. @wuchuguang can you create a reproduction?

I'll try using the local LSP

@wuchuguang
Copy link
Author

1、my workspace only one project,
2、project/biome.json
3、test.js
const path = require('path') // show biome error
4、test/biome.json
5、 test/test.js
const path = require('path') // show biome error
image

biome.json

{
    "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
    "organizeImports": {
        "enabled": true
    },
    "linter": {
        "enabled": true,
        "rules": {
            "recommended": true,
            "style": {
                "useNodejsImportProtocol": "off"
            }
        }
    }
}

@ematipico
Copy link
Member

ematipico commented Jun 10, 2024

I believe the issue comes from the extension itself that can't correctly resolve the Biome binary from a workspace project.

This is tracked in: #201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants