Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cancelling vscode warnning `Incorrect type. Expected "array"`

I'm writing a manifest.json as instructed in the google chrome extensions- getting started and the manifest is working fine, but on vscode I'm getting the following error : enter image description here

As said, it's working just fine despite of this warning, but I want it gone. Is there a way to cancel this error? Or, of course, is there a way to correct my code so it will not show warnings?

Thanks

like image 729
barshopen Avatar asked Dec 31 '22 12:12

barshopen


1 Answers

I had the same problem. This is caused by a VSCode Extension that is performing linting/providing validation. You will have to disable them one-by-one until you find the offending plugin. However the first place to start is Angular Snippets by John Papa. That was the plugin that was causing this error for me. Angular projects use manifest.json too like Chrome extensions do. Their schemas are inconsistent. You can disable the Plugin for the workspace that contains your Chrome Extension.

That way you keep the cool Angular Snippets for other projects but disable for your Chrome Extension,

Before disable. Notice the Problems in the workspace. enter image description here

enter image description here

Then choose Disable (Workspace) enter image description here

Then problem is gone. enter image description here

(Separate Pro tip: Add json.schemas element to your settings.json for the vscode project to validate your manifest.json, like so.

"json.schemas": [{
        "fileMatch": ["../src/manifest.json"],
        "url": "http: //json.schemastore.org/chrome-manifest"
    }]
like image 79
cameront Avatar answered Jan 30 '23 13:01

cameront