Code Monkey home page Code Monkey logo

chrome-extension-json-schema-manifest's Introduction

chrome-extension-json-schema-manifest

chrome插件json配置清单文件的schema提示

使用说明

在vsCode环境下的示例

可参考本仓库的.vscode/settings.json 文件的项目配置, 指定解析json的schema映射

{
    "json.schemas": [
        {
            "fileMatch": [
                "/*/manifest.json"
            ],
            "url": "/manifest-schema.json"
        },
        {
            "fileMatch": [
                "/manifest-schema.json"
            ],
            "url": "/json-schema.json"
        }
    ]
}

本示例包含了三层映射

json-schema.json采用官方约束

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    ...
}

manifest-schema.json的约束定义文档,采用json-schema约束,实现中文提示

{
    "json.schemas": [
        ...
        {
            "fileMatch": [
                "/manifest-schema.json"
            ],
            "url": "/json-schema.json"
        }
        ...
    ]
}

同时,注释掉了官方无注释说明的模式映射约束

{
    "//$schema": "https://json-schema.org/draft-07/schema#",
    ...

注意:仅在2020-02-28更新到部分配置清单的说明,还有待继续完善

chrome-ext-demo01/manifest.json的约束定义文档,采用manifest-schema.json约束,并继续实现中文提示

{
    "json.schemas": [
        ...
        {
            "fileMatch": [
                "/*/manifest.json"
            ],
            "url": "/manifest-schema.json"
        },
        ...
    ]
}

chrome-extension-json-schema-manifest's People

Contributors

davimeta avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.