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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 VSCode extension crashes after updating schema to 1.6.4 and fixing warning Missing property "options" with "options": null #2313

Closed
1 task done
FedericoBiccheddu opened this issue Apr 4, 2024 · 7 comments 路 Fixed by #2331
Assignees
Labels
A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@FedericoBiccheddu
Copy link

Environment information

CLI:
  Version:                      1.6.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm"
  JS_RUNTIME_VERSION:           "v20.11.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.6"

Biome Configuration:
  Error:                        options has an incorrect type, expected no value, but received null.
  Status:                       Loaded with errors
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

VSCode:
  Extension:                    v2.2.2

What happened?

  1. Updating the $schema property in biome.json to "https://biomejs.dev/schemas/1.6.4/schema.json" warnings starts to appear.
    • Missing property "options".
  2. Fix adding "options": null in rules as warning suggests
  3. Biome extension fails because: [Error - 11:23:28 PM] options has an incorrect type, expected no value, but received null.

Expected result

Warning disappears or extension works correctly.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico added A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels Apr 4, 2024
@Sec-ant
Copy link
Contributor

Sec-ant commented Apr 5, 2024

Which rule is the warning thrown from? Can you share your config?

@FedericoBiccheddu
Copy link
Author

Every rule that has no option defined. In my case nursery/useImportRestrictions, style/noDefaultExport, style/useShorthandArrayType and suspicious/noShadowRestrictedNames.

{
	"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
	"files": {
		"ignoreUnknown": true,
		"include": [
			"biome.json",
			"tsconfig.json",
			"app/**/*.css",
			"app/**/*.ts",
			"app/**/*.tsx"
		]
	},
	"organizeImports": {
		"enabled": false
	},
	"linter": {
		"enabled": true,
		"rules": {
			"all": true,
			"nursery": {
				"useImportRestrictions": {
					"level": "off"
				}
			},
			"style": {
				"noDefaultExport": {
					"level": "off"
				},
				"useNamingConvention": {
					"level": "off",
					"options": {
						"strictCase": false
					}
				},
				"useConsistentArrayType": {
					"level": "error",
					"options": {
						"syntax": "generic"
					}
				},
				"useShorthandArrayType": {
					"level": "off"
				}
			},
			"suspicious": {
				"noShadowRestrictedNames": {
					"level": "off"
				}
			}
		}
	}
}

@ematipico
Copy link
Member

I can replicate the issue

@FedericoBiccheddu
Copy link
Author

In the meantime, the problem goes away setting the rule to "off" instead of using "level":

{
	// snip
	"nursery": {
		"useImportRestrictions": "off"
	},
	"style": {
		"noDefaultExport": "off",
		"useNamingConvention": {
			"level": "off",
			"options": {
				"strictCase": false
			}
		},
		"useShorthandArrayType": "off"
	},
	"suspicious": {
		"noShadowRestrictedNames": "off"
	}
	// snip
}

@ematipico
Copy link
Member

@Conaclos could you check this out please?

@Sec-ant do you think this is a regression of your recent change?

@Sec-ant
Copy link
Contributor

Sec-ant commented Apr 6, 2024

do you think this is a regression of your recent change?

馃 Sorry, but I have no idea. If @Conaclos need some someone else before he can tend to this issue, I can help.

@Conaclos
Copy link
Member

Conaclos commented Apr 6, 2024

I think it is an "expected" regression of #1876.
I didn't manage to make options optional. Then, I decided to accept this regression by assuming that users didn't use an object when the rule has no options.

EDIT: I can take a look again when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants