Sublime Forum

Spurious warning in JSON syntax

#1

Editing a manifest.json file for a browser extension produces this spurious warning:


The link to the docs specifically states the entry should be an object. There appears to be some confusion between the icons property in a web extension manifest, and that in a web app manifest (which does require an array).

Is it possible to disable this warning somehow?

0 Likes

#2

Assuming that you use LSP-json…

It seems to work if you add "$schema": "https://json.schemastore.org/webextension.json", into your file. Otherwise my guess is that the various schema definitions for "manifest.json" files are merged somehow, and then the wrong one with the object for “icons” probably takes priority.

It seems that adding

{
    "settings": {
        "userSchemas": [
            {
                "fileMatch": ["manifest.json"],
                "uri": "https://json.schemastore.org/webextension.json"
            },
        ]
    }
}

into LSP-json.sublime-settings doesn’t help here (probably they are still merged?)

0 Likes

#3

Thank you! Adding the explicit schema seems like the correct approach, since the problem stems from the overloaded file name :).

0 Likes