Skip to content

Commit 4c0ffd7

Browse files
authored
(doc) add info about when options are ignored (#771)
#764
1 parent 8eda468 commit 4c0ffd7

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

packages/svelte-vscode/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,35 +204,47 @@ Svelte compiler warning codes to ignore or to treat as errors. Example: { 'css-u
204204

205205
##### `svelte.plugin.svelte.format.enable`
206206

207-
Enable formatting for Svelte (includes css & js) using [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte). You can set some formatting options through this extension. They will be ignored if there's a `.prettierrc` configuration file. _Default_: `true`
207+
Enable formatting for Svelte (includes css & js) using [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte). _Default_: `true`
208+
209+
You can set some formatting options through this extension. They will be ignored if there's any kind of configuration file, for example a `.prettierrc` file. Read more about Prettier's configuration file [here](https://prettier.io/docs/en/configuration.html).
208210

209211
##### `svelte.plugin.svelte.format.config.svelteSortOrder`
210212

211213
Format: join the keys `options`, `scripts`, `markup`, `styles` with a `-` in the order you want. _Default_: `options-scripts-markup-styles`
212214

215+
This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file.
216+
213217
##### `svelte.plugin.svelte.format.config.svelteStrictMode`
214218

215219
More strict HTML syntax. _Default_: `false`
216220

221+
This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file.
222+
217223
##### `svelte.plugin.svelte.format.config.svelteAllowShorthand`
218224

219225
Option to enable/disable component attribute shorthand if attribute name and expression are the same. _Default_: `true`
220226

227+
This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file.
228+
221229
##### `svelte.plugin.svelte.format.config.svelteBracketNewLine`
222230

223231
Put the `>` of a multiline element on a new line. _Default_: `true`
224232

233+
This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file.
234+
225235
##### `svelte.plugin.svelte.format.config.svelteIndentScriptAndStyle`
226236

227237
Whether or not to indent code inside `<script>` and `<style>` tags. _Default_: `true`
228238

239+
This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file.
240+
229241
##### `svelte.plugin.svelte.format.config.printWidth`
230242

231-
Maximum line width after which code is tried to be broken up. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. _Default_: `80`
243+
Maximum line width after which code is tried to be broken up. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file. _Default_: `80`
232244

233245
##### `svelte.plugin.svelte.format.config.singleQuote`
234246

235-
Use single quotes instead of double quotes, where possible. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. _Default_: `false`
247+
Use single quotes instead of double quotes, where possible. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file. _Default_: `false`
236248

237249
##### `svelte.plugin.svelte.hover.enable`
238250

packages/svelte-vscode/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,49 +261,49 @@
261261
"type": "boolean",
262262
"default": true,
263263
"title": "Svelte: Format",
264-
"description": "Enable formatting for Svelte (includes css & js). You can set some formatting options through this extension. They will be ignored if there's a `.prettierrc` configuration file."
264+
"description": "Enable formatting for Svelte (includes css & js). You can set some formatting options through this extension. They will be ignored if there's any kind of configuration file, for example a `.prettierrc` file."
265265
},
266266
"svelte.plugin.svelte.format.config.svelteSortOrder": {
267267
"type": "string",
268268
"default": "options-scripts-markup-styles",
269269
"title": "Svelte Format: Sort Order",
270-
"description": "Format: join the keys `options`, `scripts`, `markup`, `styles` with a - in the order you want"
270+
"description": "Format: join the keys `options`, `scripts`, `markup`, `styles` with a - in the order you want. This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file."
271271
},
272272
"svelte.plugin.svelte.format.config.svelteStrictMode": {
273273
"type": "boolean",
274274
"default": false,
275275
"title": "Svelte Format: Strict Mode",
276-
"description": "More strict HTML syntax"
276+
"description": "More strict HTML syntax. This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file."
277277
},
278278
"svelte.plugin.svelte.format.config.svelteAllowShorthand": {
279279
"type": "boolean",
280280
"default": true,
281281
"title": "Svelte Format: Allow Shorthand",
282-
"description": "Option to enable/disable component attribute shorthand if attribute name and expression are the same"
282+
"description": "Option to enable/disable component attribute shorthand if attribute name and expression are the same. This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file."
283283
},
284284
"svelte.plugin.svelte.format.config.svelteBracketNewLine": {
285285
"type": "boolean",
286286
"default": true,
287287
"title": "Svelte Format: Bracket New Line",
288-
"description": "Put the `>` of a multiline element on a new line"
288+
"description": "Put the `>` of a multiline element on a new line. This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file."
289289
},
290290
"svelte.plugin.svelte.format.config.svelteIndentScriptAndStyle": {
291291
"type": "boolean",
292292
"default": true,
293293
"title": "Svelte Format: Indent Script And Style",
294-
"description": "Whether or not to indent code inside `<script>` and `<style>` tags"
294+
"description": "Whether or not to indent code inside `<script>` and `<style>` tags. This option is ignored if there's any kind of configuration file, for example a `.prettierrc` file."
295295
},
296296
"svelte.plugin.svelte.format.config.printWidth": {
297297
"type": "number",
298298
"default": 80,
299299
"title": "Svelte Format: Print Width",
300-
"description": "Maximum line width after which code is tried to be broken up. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead."
300+
"description": "Maximum line width after which code is tried to be broken up. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file."
301301
},
302302
"svelte.plugin.svelte.format.config.singleQuote": {
303303
"type": "boolean",
304304
"default": false,
305305
"title": "Svelte Format: Quotes",
306-
"description": "Use single quotes instead of double quotes, where possible. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead."
306+
"description": "Use single quotes instead of double quotes, where possible. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file."
307307
},
308308
"svelte.plugin.svelte.completions.enable": {
309309
"type": "boolean",

0 commit comments

Comments
 (0)