From cfd0865efcf201121cec0c26dc0da0e525ed8777 Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 18 Jan 2021 11:27:57 +0100 Subject: [PATCH 1/3] init --- .../svelte-vscode/package-json-schema.json | 9 ++ packages/svelte-vscode/package.json | 20 ++++ .../prettier-options-schema.json | 106 ++++++++++++++++++ 3 files changed, 135 insertions(+) create mode 100644 packages/svelte-vscode/package-json-schema.json create mode 100644 packages/svelte-vscode/prettier-options-schema.json diff --git a/packages/svelte-vscode/package-json-schema.json b/packages/svelte-vscode/package-json-schema.json new file mode 100644 index 000000000..3db9f6af0 --- /dev/null +++ b/packages/svelte-vscode/package-json-schema.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "properties": { + "prettier": { + "description": "Prettier-Plugin-Svelte configuration", + "$ref": "./prettier-options.json" + } + } +} diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index c30d29f62..b5cbff591 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -348,6 +348,26 @@ ".svelte" ], "configuration": "./language-configuration.json" + }, + { + "id": "json", + "filenames": [ + ".prettierrc" + ] + } + ], + "jsonValidation": [ + { + "fileMatch": ".prettierrc", + "url": "./prettier-options-schema.json" + }, + { + "fileMatch": ".prettierrc.json", + "url": "./prettier-options-schema.json" + }, + { + "fileMatch": "package.json", + "url": "./package-json-schema.json" } ], "grammars": [ diff --git a/packages/svelte-vscode/prettier-options-schema.json b/packages/svelte-vscode/prettier-options-schema.json new file mode 100644 index 000000000..7963befa9 --- /dev/null +++ b/packages/svelte-vscode/prettier-options-schema.json @@ -0,0 +1,106 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Prettier-plugin-svelte schema for .prettierrc", + "definitions": { + "optionsDefinition": { + "type": "object", + "properties": { + "svelteSortOrder": { + "description": "Sort order for , scripts, markup, and styles.", + "default": "options-scripts-markup-styles", + "enum": [ + "options-scripts-markup-styles", + "options-scripts-styles-markup", + "options-markup-scripts-styles", + "options-markup-styles-scripts", + "options-styles-scripts-markup", + "options-styles-markup-scripts", + "scripts-options-markup-styles", + "scripts-options-styles-markup", + "scripts-markup-options-styles", + "scripts-markup-styles-options", + "scripts-styles-options-markup", + "scripts-styles-markup-options", + "markup-options-scripts-styles", + "markup-options-styles-scripts", + "markup-scripts-options-styles", + "markup-scripts-styles-options", + "markup-styles-options-scripts", + "markup-styles-scripts-options", + "styles-options-scripts-markup", + "styles-options-markup-scripts", + "styles-scripts-options-markup", + "styles-scripts-markup-options", + "styles-markup-options-scripts", + "styles-markup-scripts-options" + ] + }, + "svelteStrictMode": { + "description": "More strict HTML syntax: less self-closed tags, quotes in attributes, no attribute shorthand (overrules svelteAllowShorthand).", + "default": true, + "type": "boolean" + }, + "svelteBracketNewLine": { + "description": "Put the > of a multiline element on a new line. Roughly the Svelte equivalent of the jsxBracketSameLine rule.", + "default": false, + "type": "boolean" + }, + "svelteAllowShorthand": { + "description": "Option to enable/disable component attribute shorthand if attribute name and expression are same.", + "default": false, + "type": "boolean" + }, + "svelteIndentScriptAndStyle": { + "description": "Whether or not to indent the code inside