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

📝 overrides.json.formatter.trailingCommas: all does not seem to work #2052

Closed
1 task done
tylerbutler opened this issue Mar 11, 2024 · 4 comments
Closed
1 task done

Comments

@tylerbutler
Copy link

tylerbutler commented Mar 11, 2024

Environment information

CLI:
  Version:                      1.6.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.17.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.6.6"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              true
  Organize imports disabled:    true
  VCS disabled:                 false

Formatter:
  Format with errors:           true
  Indent style:                 Tab
  Indent size:                  0
  Indent width:                 0
  Line ending:                  Lf
  Line width:                   95
  Attribute position:           Auto
  Ignore:                       []
  Include:                      []

JavaScript Formatter:
  Enabled:                      false
  JSX quote style:              Double
  Quote properties:             Preserve
  Trailing comma:               All
  Semicolons:                   Always
  Arrow parentheses:            Always
  Bracket spacing:              true
  Bracket same line:            false
  Quote style:                  Double
  Indent style:                 unset
  Indent size:                  unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           Auto

JSON Formatter:
  Enabled:                      false
  Indent style:                 Tab
  Indent width:                 unset
  Indent size:                  unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset

Workspace:
  Open Documents:               0

Configuration

{
	"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
	"files": {
		"ignoreUnknown": true,
		"ignore": ["**/_api-extractor-temp/**", "**/oclif.manifest.json"]
	},
	"vcs": {
		"enabled": true,
		"clientKind": "git",
		"useIgnoreFile": true
	},
	"organizeImports": {
		"enabled": false
	},
	"linter": {
		"enabled": false,
		"rules": {
			"recommended": true
		}
	},
	"formatter": {
		"enabled": true,
		"formatWithErrors": true,
		"indentStyle": "tab",
		"lineWidth": 95,
		"lineEnding": "lf"
	},
	"javascript": {
		"formatter": {
			"arrowParentheses": "always",
			"jsxQuoteStyle": "double",
			"semicolons": "always",
			"trailingComma": "all",
			"quoteProperties": "preserve",
			"quoteStyle": "double",
			"bracketSpacing": true
		}
	},
	"json": {
		"formatter": {
			"indentStyle": "tab"
		}
	},
	"overrides": [
		{
			"include": [".vscode/*.json"],
			"formatter": {
				"formatWithErrors": true
			},
			"json": {
				"parser": {
					"allowComments": true,
					"allowTrailingCommas": true
				},
				"formatter": {
					"trailingCommas": "all"
				}
			}
		}
	]
}

Playground link

The codebox link below is a slightly different set up than mine. I updated the sandbox to format files in .codesandbox instead of .vscode, since .vscode isn't visible in codesandbox. If you add a trailing comma to one of those files, then run npm run format, the trailing comma will be removed.

https://codesandbox.io/p/devbox/musing-hooks-32w42r?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522cltn9nllq00053j6f6kjpx43a%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522cltn9nllp00023j6fbina2abj%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522cltn9nllp00033j6f53ytgazk%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522cltn9nllp00043j6fpafckyp0%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522cltn9nllp00023j6fbina2abj%2522%253A%257B%2522id%2522%253A%2522cltn9nllp00023j6fbina2abj%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cltn9oxxr003i3j6fr8r4hmv0%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A4%252C%2522startColumn%2522%253A24%252C%2522endLineNumber%2522%253A4%252C%2522endColumn%2522%253A24%257D%255D%252C%2522filepath%2522%253A%2522%252Fbiome.json%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522activeTabId%2522%253A%2522cltn9oxxr003i3j6fr8r4hmv0%2522%257D%252C%2522cltn9nllp00043j6fpafckyp0%2522%253A%257B%2522tabs%2522%253A%255B%255D%252C%2522id%2522%253A%2522cltn9nllp00043j6fpafckyp0%2522%257D%252C%2522cltn9nllp00033j6f53ytgazk%2522%253A%257B%2522id%2522%253A%2522cltn9nllp00033j6f53ytgazk%2522%252C%2522activeTabId%2522%253A%2522cltn9qyme00fe3j6f5h1vofrw%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522cltn9qyme00fe3j6f5h1vofrw%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TERMINAL%2522%252C%2522shellId%2522%253A%2522cltn9qyks003udjip6uf77di6%2522%257D%255D%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@tylerbutler
Copy link
Author

I can reproduce this with tsconfig files as well. It seems like overrides either don't work the way I think they do or the "trailingCommas": "all" option doesn't work in overrides.

@ematipico
Copy link
Member

Closing. It's been reported and fixed. We will release it soon

@tylerbutler
Copy link
Author

@ematipico Can you link the issue/PR? Thanks!

@ematipico
Copy link
Member

#2025

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

No branches or pull requests

2 participants