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

🐛 Biome extension & CLI not consistent #444

Open
1 of 3 tasks
FaresKi opened this issue Dec 12, 2024 · 2 comments
Open
1 of 3 tasks

🐛 Biome extension & CLI not consistent #444

FaresKi opened this issue Dec 12, 2024 · 2 comments
Labels

Comments

@FaresKi
Copy link

FaresKi commented Dec 12, 2024

VS Code version

1.93.1

Extension version

2.3.0

Biome version

1.9.4

Operating system

  • Windows
  • macOS
  • Linux

Description

Biome CLI (via package.json) and Biome extensions have contradictory behaviors when it come to formatting.

Steps to reproduce

Here is my biome.json:

{
	"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
	"vcs": {
		"enabled": true,
		"clientKind": "git",
		"useIgnoreFile": true
	},
	"formatter": {
		"enabled": true,
		"useEditorconfig": true,
		"formatWithErrors": true,
		"indentStyle": "tab",
		"lineEnding": "lf",
		"indentWidth": 2,
		"lineWidth": 100,
		"attributePosition": "auto",
		"bracketSpacing": true,
		"ignore": ["**/dist", "**/coverage"]
	},
	"organizeImports": {
		"enabled": false
	},
	"linter": {
		"enabled": false
	},
	"javascript": {
		"formatter": {
			"enabled": true,
			"jsxQuoteStyle": "double",
			"quoteProperties": "asNeeded",
			"trailingCommas": "all",
			"semicolons": "always",
			"arrowParentheses": "asNeeded",
			"bracketSameLine": false,
			"quoteStyle": "single"
		}
	},
	"json": {
		"formatter": {
			"enabled": true,
			"trailingCommas": "none"
		}
	},
	"files": {
		"include": [
			"src/**/*.ts",
			"src/**/*.tsx",
			"src/**/*.js",
			"src/**/*.jsx",
			"src/**/*.json",
			"test/**/*.ts",
			"test/**/*.tsx",
			"test/**/*.js",
			"test/**/*.jsx",
			"test/**/*.json"
		],
		"ignore": ["**/node_modules", "**/dist", "**/coverage"]
	}
}

Install biome (package & extension) and add the following scripts:

"format": "biome check ."

run format document via vscode, then run pnpm format --fix

Contradictory & self-cancelling behaviors. I believe it started with a recent update.

Enregistrement.de.l.ecran.2024-12-13.a.00.37.39.mov

Expected behavior

Expected the same behavior whether vscode, or biome package.

Does this issue occur when using the CLI directly?

Yes

Link to a minimal reproduction

No response

Logs

No response

@FaresKi FaresKi added the Triage label Dec 12, 2024
@lumpinif
Copy link

lumpinif commented Dec 31, 2024

I have also encountered out of sync issue with the extension 2.3.0 with @biomejs/biome 1.9.4 in both windsurf and cursor editors in a monorepo structure.

@lumpinif
Copy link

I resolved this by adding a [project].code-workspace config file at the root of my monorepo something like this :

{
	"folders": [
		{
			"name": "references",
			"path": "references"
		},
		{
			"name": "workers",
			"path": "workers"
		},
		{
			"name": "app",
			"path": "app"
		}
	],
	"settings": {
		"files.exclude": {
			"./backup": true
		}
	}
}

Then open the codebase with workspace from the config file, and the extension starts to work in sync with each biome.json.

tip: I setup the local .vscode with settings.json in each workspace to enable customized biome behavior

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

2 participants