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

JSONC parsing not working #4795

Closed
1 task done
hyoretsu opened this issue Dec 26, 2024 · 2 comments
Closed
1 task done

JSONC parsing not working #4795

hyoretsu opened this issue Dec 26, 2024 · 2 comments
Labels
S-Needs repro Status: needs a reproduction

Comments

@hyoretsu
Copy link

hyoretsu commented Dec 26, 2024

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v20.14.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "bun/1.1.34"

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

Workspace:
  Open Documents:               0

What happened?

I'm receiving Expected an array, an object, or a literal but instead found whenever I add a comment to a JSONC file. Repro.

Here's my biome.json:

{
	"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
	"files": {
		"ignoreUnknown": true,
		"maxSize": 10485760
	},
	"formatter": {
		"lineWidth": 110
	},
	"javascript": {
		"formatter": {
			"arrowParentheses": "asNeeded"
		},
		"parser": {
			"unsafeParameterDecoratorsEnabled": true
		}
	},
	"json": {
		"formatter": {
			"trailingCommas": "none"
		},
		"parser": {
			"allowComments": true,
			"allowTrailingCommas": true
		}
	},
	"linter": {
		"enabled": true,
		"rules": {
			"recommended": true,
			"a11y": {
				"useKeyWithClickEvents": "off"
			},
			"security": {
				"noDangerouslySetInnerHtml": "warn"
			},
			"style": {
				"noNonNullAssertion": "off",
				"noParameterAssign": "warn",
				"useSingleVarDeclarator": "off"
			},
			"suspicious": {
				"noExplicitAny": "off"
			}
		}
	}
}

Expected result

It should allow comments at least in JSONC format.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@hyoretsu hyoretsu added the S-Needs triage Status: this issue needs to be triaged label Dec 26, 2024
@ematipico ematipico added the S-Needs repro Status: needs a reproduction label Dec 26, 2024
Copy link
Contributor

Hello @hyoretsu, please provide a minimal reproduction. You can use one of the following options:

  • Provide a link to our playground, if it's applicable.
  • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the S-Needs triage Status: this issue needs to be triaged label Dec 26, 2024
@hyoretsu
Copy link
Author

Nevermind, it's related to this issue from the VSCode extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs repro Status: needs a reproduction
Projects
None yet
Development

No branches or pull requests

2 participants