-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
[json] Override/disable json-schema for package.json #74943
Comments
+1 I want to override json schema for package.json to resolve an incorrect type for "bundleDependencies" property, issue /schemastore/issues/876. To do that i try to use a local schema with custom definition for bundledDependency :
My local file is correctly mapped but it doesn't override the default schema, both are loaded, which causes a conflict. Indeed, i can see the package.json try to resolve the rules of my custom schema and those of the default schema. Default schema in vscode is mapped in ./extensions/npm/package.json :
If i delete this (or replace it by my custom file path) and i refresh vscode cache, it works .... But i'm waiting a better solution. Thanks. |
I just ran into this same situation, but when adding a custom schema for |
I am not sure is my situation related with this issue, but I can get any files under I've tried to add this to my {
"json.schemas": [
{
"fileMatch": [
".github/workflows/*.yml"
],
"url": "https://json.schemastore.org/github-workflow.json"
}
]
} |
I just ran into the same problem as @feryardiant and managed to solve it by editing the {
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": ".github/workflows/**.yml"
}
} |
Awesome! Thank you @octoman90, I didn't realize that we could use that such format. Anyway, I can confirm that your suggestion is working perfectly for per-project settings, but I can't get its working as global (workspace) settings. |
I'm also running into this. It's lousy that an extension which is installed by default cannot be disabled or overridden. |
Bumping this - just ran into it today, same as @feryardiant, where my (I am using version 1.65.1 on a Mac running Monterey 12.2.1) |
VSCode has a feature[1] wherein it auto-detects what schema to use to validate certain JSON and yml files. The problem is, sometimes it's wrong[2], and when it is, it will throw errors* because it's misconstrued what kind of file you're editing. The incorrect association can be overridden, though, with a correct association in settings. This adds such an association, to prevent VSCode from complaining about our GHA `build` workflow. *It correctly detects that it's a GHA config, but also checks it against the schema for a different build tool[3] called `hammerkit`, and throws errors because the two schemas are incompatible [1] https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings [2] microsoft/vscode#74943 (comment) [3] https://no0dles.gitbook.io/hammerkit/
I would like to override the default json-schema used by VSCode on some files with my own json-schema (example: VSCode use a json-schema for the Node's "package.json", but I want to be able to override it), like when configuring any other json-schema in settings.json:
Reason is: I'm working on a project where there's a file called "package.json" which is not related to Node: it's something completely different and internal to the project, and it's not even in the root directory, but I can't rename it and VSCode wrongly use the Node's json-schema and everything become an error.
The text was updated successfully, but these errors were encountered: