From 09ba3333ca8d819b38461fba5dd7b15e518386a8 Mon Sep 17 00:00:00 2001 From: pushkine Date: Mon, 18 Jan 2021 11:22:19 +0100 Subject: [PATCH 01/26] 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 d81499578..8c585988d 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -300,6 +300,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