weapp-json-schema

CI NPM VERSION NPM DOWNLOADS LICENSE

JSON schema for weapp.

Usage

You can config in workspace’s .vscode/settings.json to use json schemas or config in every specific files.

1. Config in workspace .vscode/settings.json

{
  "json.schemas": [
    {
      "fileMatch": ["project.config.json", "project.private.config.json"],
      "url": "https://unpkg.com/weapp-json-schema/project.schema.json"
    },
    {
      "fileMatch": ["app.json"],
      "url": "https://unpkg.com/weapp-json-schema/app.schema.json"
    },
    {
      "fileMatch": ["**/pages/**/*.json"],
      "url": "https://unpkg.com/weapp-json-schema/page.schema.json"
    },
    {
      "fileMatch": ["sitemap.json"],
      "url": "https://unpkg.com/weapp-json-schema/sitemap.schema.json"
    },
    {
      "fileMatch": ["**/components/**/*.json"],
      "url": "https://unpkg.com/weapp-json-schema/component.schema.json"
    }
  ]
}

2. Use json schema in specific file:

Project schema

Config in your project.config.json or project.private.config.json:

{
  "$schema": "https://unpkg.com/weapp-json-schema/project.schema.json"
}

App schema

Config in your app.json:

{
  "$schema": "https://unpkg.com/weapp-json-schema/app.schema.json"
}

Page schema

Config in your <page_name>.json:

{
  "$schema": "https://unpkg.com/weapp-json-schema/page.schema.json"
}

Sitemap schema

Config in your sitemap.json:

{
  "$schema": "https://unpkg.com/weapp-json-schema/sitemap.schema.json"
}

Component schema

Config in your <component_name>.json:

{
  "$schema": "https://unpkg.com/weapp-json-schema/component.schema.json"
}

Schemas

Refs

Updated At

2024-05-29

License

MIT License © 2022-PRESENT ntnyq