-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathJsPrettier.sublime-settings
593 lines (532 loc) · 22.3 KB
/
JsPrettier.sublime-settings
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
{
// ----------------------------------------------------------------------
// Debug Mode
// ----------------------------------------------------------------------
//
// @param {bool} "debug"
// @default false
//
// When enabled (true), additional debugging information about the command
// and configured settings will be printed to the Sublime Text Console;
// useful for troubleshooting purposes.
//
// Enabling debug mode also sets Prettier's "--log-level" option to "debug"
// (when not overridden by "additional_cli_args"), for printing additional
// debug information to the console.
// ----------------------------------------------------------------------
"debug": false,
// ----------------------------------------------------------------------
// Prettier CLI Path
// ----------------------------------------------------------------------
//
// @param {string} "prettier_cli_path"
// @default ""
//
// It's recommended to leave the "prettier_cli_path" value empty "".
// However, if Sublime Text has problems resolving the path to the
// `prettier` cli executable, you can explicitly specify the path here.
//
// If the `prettier_cli_path` setting is left empty (""), the path is
// resolved by searching locations in the following order, returning the
// first matched path:
//
// 1. Locally installed prettier relative to active view.
// 2. Locally installed prettier relative to the Sublime Text Project file's root directory. e.g.: `node_modules/.bin/prettier` and `node_modules/prettier/bin-prettier.js`.
// 3. The current user home directory. e.g.: `$HOME/node_modules/.bin/prettier`.
// 4. JsPrettier Sublime Text plugin directory.
// 5. Globally installed prettier.
//
// macOS and Linux examples:
//
// "prettier_cli_path": "/usr/local/bin/prettier"
// "prettier_cli_path": "/some/absolute/path/to/node_modules/.bin/prettier"
// "prettier_cli_path": "./node_modules/.bin/prettier"
// "prettier_cli_path": "~/bin/prettier"
// "prettier_cli_path": "$HOME/bin/prettier"
// "prettier_cli_path": "${project_path}/bin/prettier"
// "prettier_cli_path": "$ENV/bin/prettier"
//
// Windows examples:
//
// "prettier_cli_path": "C:/path/to/prettier.cmd"
// "prettier_cli_path": "%USERPROFILE%\\bin\\prettier.cmd"
// ----------------------------------------------------------------------
"prettier_cli_path": "",
// ----------------------------------------------------------------------
// Node Path
// ----------------------------------------------------------------------
//
// @param {bool} "node_path"
// @default ""
//
// It's strongly recommended to leave the "node_path" value empty "".
// However, if Sublime Text has problems resolving the "absolute" path to
// `node`, you can explicitly specify the path here.
//
// macOS/Linux Examples:
//
// "node_path": "/usr/local/bin/node"
// "node_path": "/some/absolute/path/to/node"
// "node_path": "./node"
// "node_path": "~/bin/node"
// "node_path": "$HOME/bin/node"
// "node_path": "${project_path}/bin/node"
// "node_path": "$ENV/bin/node"
// "node_path": "$NVM_BIN/node"
//
// Windows Examples:
//
// "node_path": "C:/path/to/node.exe"
// "node_path": "%USERPROFILE%\\bin\\node.exe"
// ----------------------------------------------------------------------
"node_path": "",
// ----------------------------------------------------------------------
// Auto Format on Save
// ----------------------------------------------------------------------
//
// @param {bool} "auto_format_on_save"
// @default false
//
// Whether or not to automatically format the file on save.
// ----------------------------------------------------------------------
"auto_format_on_save": false,
// ----------------------------------------------------------------------
// Auto Format on Save Excludes
// ----------------------------------------------------------------------
//
// @param {array} "auto_format_on_save_excludes"
// @default []
//
// Ignore auto formatting when the target file, or its path resides in a
// particular location, and when `auto_format_on_save` is turned on.
//
// Example:
//
// "auto_format_on_save_excludes": [
// "*/node_modules/*",
// "*/file.js",
// "*.json"
// ]
// ----------------------------------------------------------------------
"auto_format_on_save_excludes": [],
// ----------------------------------------------------------------------
// Auto Format Requires Prettier Config File
// ----------------------------------------------------------------------
//
// @param {bool} "auto_format_on_save_requires_prettier_config"
// @default false
//
// Enable auto format on save ONLY when a Prettier config file is found.
//
// The Prettier config file is resolved by first checking if a `--config </path/to/prettier/config>`
// is specified in the `additional_cli_args` setting, then by searching the
// location of the file being formatted, and finally navigating up the file
// tree until a config file is (or isn't) found.
// ----------------------------------------------------------------------
"auto_format_on_save_requires_prettier_config": false,
// ----------------------------------------------------------------------
// Allow Inline Formatting
// ----------------------------------------------------------------------
//
// @param {bool} "allow_inline_formatting"
// @default false
//
// Provides the ability to format selections of in-lined code, outside of
// the normally supported syntaxes and file types. For example, to format a
// selection of JavaScript code within a PHP or HTML file. When `true`, the
// JsPrettier command is available for use across all Sublime Text syntaxes.
// ----------------------------------------------------------------------
"allow_inline_formatting": false,
// ----------------------------------------------------------------------
// Custom File Extensions
// ----------------------------------------------------------------------
//
// @param {array} "custom_file_extensions"
// @default []
//
// Additional custom file extensions to format.
//
// There's built-in support already for "js", "jsx", "cjs", "mjs", "json",
// "jsonc", "json5", "html", "graphql/gql", "ts", "tsx", "cts", "mts", "css",
// "scss", "less", "md", "mdx", "yml", "yaml" and "vue" and "component.html"
// (angular html) files.
//
// Additional file extensions MUST be specified here, and without the leading dot.
// ----------------------------------------------------------------------
"custom_file_extensions": [],
// ----------------------------------------------------------------------
// Maximum File Size Limit
// ----------------------------------------------------------------------
//
// @param {int} "max_file_size_limit"
// @default -1
//
// The maximum allowed file size to format in bytes. For performance
// reasons, files with a greater file size than the specified
// `max_file_size_limit` will not be formatted.
//
// Setting the `max_file_size_limit` value to `-1` will disable file size
// checking (default).
// ----------------------------------------------------------------------
"max_file_size_limit": -1,
// ----------------------------------------------------------------------
// Disable Tab Width Auto Detection
// ----------------------------------------------------------------------
//
// @param {bool} "disable_tab_width_auto_detection"
// @default false
//
// IMPORTANT: By default, "tabWidth" is automatically set using the
// SublimeText configured value for "tab_size". To disable this
// behavior, you must first change the "disable_tab_width_auto_detection"
// value from false, to true.
// ----------------------------------------------------------------------
"disable_tab_width_auto_detection": false,
// ----------------------------------------------------------------------
// Disable Prettier Cursor Offset Calculation
// ----------------------------------------------------------------------
//
// @param {object} "disable_prettier_cursor_offset"
// @default false
//
// There's an apparent (and nasty) defect in Prettier that seems to occur
// during Prettier's cursor offset calculation, and when attempting to
// format large or minimized files (but not limited to just these cases).
// The issue effectively results in the CPU spiking to a constant 100%...
// indefinitely, or until the node executable/process running Prettier is
// forcefully terminated.
//
// To avoid this problematic behavior, or until the defect is resolved, you
// can disable the plugin (JsPrettier) from ever passing the cursor offset
// position to Prettier by setting the `disable_prettier_cursor_offset` value to `true`.
//
// Related Issues:
// - https://github.com/jonlabelle/SublimeJsPrettier/issues/147
// - https://github.com/jonlabelle/SublimeJsPrettier/issues/168
//
// Prettier Cursor Offset Documentation:
// - https://prettier.io/docs/en/api.html#prettierformatwithcursorsource--options
// ----------------------------------------------------------------------
"disable_prettier_cursor_offset": false,
// ----------------------------------------------------------------------
// Additional CLI Arguments
// ----------------------------------------------------------------------
//
// @param {object} "additional_cli_args"
// @default {}
//
// A key-value pair of additional arguments to append to the prettier
// command.
//
// Examples:
//
// "additional_cli_args": {
// "--config": "path/to/my/custom/.prettierrc",
// "--config": "~/.prettierrc",
// "--config": "$HOME/.prettierrc",
// "--config": "${project_path}/.prettierrc",
// "--config-precedence": "prefer-file",
// "--ignore-path": "${file_path}/.prettierignore",
// "--with-node-modules": "",
// "--plugin-search-dir": "$folder"
// }
//
// NOTE: If choosing to specify additional cli args, it is assumed that each
// argument is supported by the prettier-cli. Otherwise, the command will
// fail to run, and errors will be dumped out to the Sublime Text Console.
//
// You can also enable the debug setting to inspect the generated
// command-line output passed to prettier; which is also useful for quickly
// troubleshooting issues.
// ----------------------------------------------------------------------
"additional_cli_args": {},
// ----------------------------------------------------------------------
// Prettier Options
// ----------------------------------------------------------------------
//
// Native Prettier options are defined here.
//
// For a complete list of supported options and acceptable values,
// visit https://github.com/jlongster/prettier.
// ----------------------------------------------------------------------
"prettier_options": {
// --------------------------------------------------------------------
// printWidth
// --------------------------------------------------------------------
//
// @param {int} "prettier_options.printWidth"
// @default 80
//
// Fit code within this line limit.
// --------------------------------------------------------------------
"printWidth": 80,
// --------------------------------------------------------------------
// tabWidth
// --------------------------------------------------------------------
//
// @param {int} "prettier_options.tabWidth"
// @default 2
//
// Specify the number of spaces per indentation-level.
//
// IMPORTANT: By default, "tabWidth" is automatically set using the
// SublimeText configured value for "tab_size". To disable this
// behavior, you must first change the "disable_tab_width_auto_detection"
// setting to "true".
// --------------------------------------------------------------------
"tabWidth": 2,
// --------------------------------------------------------------------
// singleQuote
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.singleQuote"
// @default false
//
// If true, will use single instead of double quotes.
// --------------------------------------------------------------------
"singleQuote": false,
// --------------------------------------------------------------------
// trailingComma
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.trailingComma"
// @default "all"
//
// Controls the printing of trailing commas wherever possible.
//
// Valid options:
//
// - "all" (default) Trailing commas wherever possible (function arguments)
// - "es5" Trailing commas where valid in ES5 (objects, arrays, etc)
// - "none" No trailing commas
// --------------------------------------------------------------------
"trailingComma": "all",
// --------------------------------------------------------------------
// bracketSpacing
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.bracketSpacing"
// @default true
//
// Controls the printing of spaces inside array and objects.
// --------------------------------------------------------------------
"bracketSpacing": true,
// --------------------------------------------------------------------
// bracketSameLine
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.bracketSameLine"
// @default false
//
// Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element
// at the end of the last line instead of being alone on the next line
// (does not apply to self-closing elements).
// --------------------------------------------------------------------
"bracketSameLine": false,
// --------------------------------------------------------------------
// jsxSingleQuote
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.jsxSingleQuote"
// @default false
//
// Use single quotes instead of double quotes in JSX.
// --------------------------------------------------------------------
"jsxSingleQuote": false,
// --------------------------------------------------------------------
// parser
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.parser"
// @default "babel"
//
// Which parser to use. Valid options are "flow", "babel",
// "typescript", "css", "json", "graphql", "markdown" and "yaml".
//
// NOTE: The `parser` option is automatically set by the plugin
// (JsPrettier), based on the contents of current file or selection.
// --------------------------------------------------------------------
"parser": "babel",
// --------------------------------------------------------------------
// semi
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.semi"
// @default true
//
// Valid options:
//
// - true (default) Add a semicolon at the end of every statement.
// - false Only add semicolons at the beginning of lines that may introduce ASI failures.
// --------------------------------------------------------------------
"semi": true,
// --------------------------------------------------------------------
// requirePragma
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.requirePragma"
// @default false
//
// Prettier can restrict itself to only format files that contain a
// special comment, called a pragma, at the top of the file. This is
// very useful when gradually transitioning large, unformatted codebases
// to prettier.
// --------------------------------------------------------------------
"requirePragma": false,
// --------------------------------------------------------------------
// proseWrap
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.proseWrap"
// @default "preserve"
//
// (Markdown and YAML Only) By default, Prettier will not change
// wrapping in markdown text since some services use a
// linebreak-sensitive renderer, e.g. GitHub comments and BitBucket. To
// have Prettier wrap prose to the print width, change this option to
// "always". If you want Prettier to force all prose blocks to be on a
// single line and rely on editor/viewer soft wrapping instead, you can
// use "never".
//
// Valid options:
//
// - "preserve" (default) Wrap prose as-is.
// - "always" Wrap prose if it exceeds the print width.
// - "never" Do not wrap prose.
// --------------------------------------------------------------------
"proseWrap": "preserve",
// --------------------------------------------------------------------
// arrowParens
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.arrowParens"
// @default "always"
//
// Include parentheses around a sole arrow function parameter.
//
// Valid Options:
//
// - "always" (default) Always include parentheses. Example: `(x) => x`
// - "avoid" Omit parentheses when possible. Example: `x => x`
// --------------------------------------------------------------------
"arrowParens": "always",
// --------------------------------------------------------------------
// htmlWhitespaceSensitivity
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.htmlWhitespaceSensitivity"
// @default "css"
//
// Specify the global whitespace sensitivity for HTML files.
//
// Valid Options:
//
// - "css" (default) Respect the default value of CSS display property.
// - "strict" Whitespaces are considered sensitive.
// - "ignore" Whitespaces are considered insensitive.
// --------------------------------------------------------------------
"htmlWhitespaceSensitivity": "css",
// --------------------------------------------------------------------
// quoteProps
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.quoteProps"
// @default "as-needed"
//
// Change when properties in objects are quoted. Requires Prettier v1.17+.
//
// Valid options:
//
// - "as-needed" (default) Only add quotes around object properties where required.
// - "consistent" If at least one property in an object requires quotes, quote all properties.
// - "preserve" Respect the input use of quotes in object properties.
// --------------------------------------------------------------------
"quoteProps": "as-needed",
// --------------------------------------------------------------------
// vueIndentScriptAndStyle
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.vueIndentScriptAndStyle"
// @default false
//
// (Vue files Only) Whether or not to indent the code inside <script>
// and <style> tags in Vue files. Some people (like the creator of Vue)
// don't indent to save an indentation level, but this might break code
// folding in Sublime Text.
//
// Valid Options:
//
// - false (default) Do not indent script and style tags in Vue files.
// - true Indent script and style tags in Vue files.
// --------------------------------------------------------------------
"vueIndentScriptAndStyle": false,
// --------------------------------------------------------------------
// embeddedLanguageFormatting
// --------------------------------------------------------------------
//
// @param {string} "prettier_options.embeddedLanguageFormatting"
// @default "auto"
//
// Control whether Prettier formats quoted code embedded in the file.
//
// When Prettier identifies cases where it looks like you've placed some
// code it knows how to format within a string in another file, like in
// a tagged template in JavaScript with a tag named `html` or in code
// blocks in Markdown, it will by default try to format that code.
//
// Sometimes this behavior is undesirable, particularly in cases where
// you might not have intended the string to be interpreted as code.
// This option allows you to switch between the default behavior
// (`auto`) and disabling this feature entirely (`off`).
//
// Valid Options:
//
// - "auto" (default) Format embedded code if Prettier can automatically identify it.
// - "off" Never automatically format embedded code.
// --------------------------------------------------------------------
"embeddedLanguageFormatting": "auto",
// --------------------------------------------------------------------
// editorconfig
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.editorconfig"
// @default true
//
// Whether to take into account .editorconfig files when parsing
// configuration.
//
// If editorconfig is true, and an .editorconfig file is in your
// project, Prettier will parse it and convert its properties to the
// corresponding Prettier configuration. This configuration will be
// overridden by .prettierrc, etc.
//
// Currently, the following EditorConfig properties are supported:
//
// - end_of_line
// - indent_style
// - indent_size/tab_width
// - max_line_length
//
// Valid Options:
//
// - true (default) If true, and an .editorconfig file is in your project, parse and convert its properties to the corresponding Prettier configuration.
// - false Disable .editorconfig file support.
// --------------------------------------------------------------------
"editorconfig": true,
// --------------------------------------------------------------------
// singleAttributePerLine
// --------------------------------------------------------------------
//
// @param {bool} "prettier_options.singleAttributePerLine"
// @default false
//
// Enforce single attribute per line in HTML, Vue and JSX.
//
// Valid Options:
//
// - false (default) Do not enforce single attribute per line.
// - true Enforce single attribute per line.
// --------------------------------------------------------------------
"singleAttributePerLine": false
}
}