-
Notifications
You must be signed in to change notification settings - Fork 4
/
.prettierrc.mjs
264 lines (241 loc) · 7.08 KB
/
.prettierrc.mjs
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
export default {
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-tailwindcss'],
organizeImportsSkipDestructiveCodeActions: true,
// https://gist.github.com/adbutterfield/6b91625b5b07ca2c29f6322245e3e2bb
/**
* Print Width
* https://prettier.io/docs/en/options.html#print-width
*
* Specify the line length that the printer will wrap on.
*
* printWidth: <int>
* default: 80
*/
printWidth: 80,
/**
* Tab Width
* https://prettier.io/docs/en/options.html#tab-width
*
* Specify the number of spaces per indentation-level.
*
* tabWidth: <int>
* default: 2
*/
tabWidth: 2,
/**
* Tabs
* https://prettier.io/docs/en/options.html#tabs
*
* Indent lines with tabs instead of spaces.
*
* useTabs: <bool>
* default: false
*/
useTabs: false,
/**
* Semicolons
* https://prettier.io/docs/en/options.html#semicolons
*
* Print semicolons at the ends of statements
*
* semi: <bool>
* default: true
*/
semi: false,
/**
* Quotes
* https://prettier.io/docs/en/options.html#quotes
*
* Use single quotes instead of double quotes.
*
* singleQuote: <bool>
* default: false
*/
singleQuote: true,
/**
* Quote Props
* https://prettier.io/docs/en/options.html#quote-props
*
* Change when properties in objects are quoted.
*
* quoteProps: "<as-needed|consistent|preserve>"
* default: "as-needed"
*/
quoteProps: 'as-needed',
/**
* JSX Quotes
* https://prettier.io/docs/en/options.html#jsx-quotes
*
* Use single quotes instead of double quotes in JSX.
*
* jsxSingleQuote: <bool>
* default: false
*/
jsxSingleQuote: false,
/**
* Trailing Commas
* https://prettier.io/docs/en/options.html#trailing-commas
*
* Print trailing commas wherever possible when multi-line. (A single-line array, for example, never gets trailing commas.)
*
* trailingComma: "<es5|none|all>"
* default: 'es5'
*/
trailingComma: 'none',
/**
* Bracket Spacing
* https://prettier.io/docs/en/options.html#bracket-spacing
*
* Print spaces between brackets in object literals.
*
* bracketSpacing: <bool>
* default: true
*/
bracketSpacing: true,
/**
* Bracket Line
* https://prettier.io/docs/en/options.html#bracket-line
*
* 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: <bool>
* default: false
*/
bracketSameLine: false,
/**
* [Deprecated] JSX Brackets
* https://prettier.io/docs/en/options.html#jsx-brackets
*
* This option has been deprecated in v2.4.0, use --bracket-same-line instead
* Put the > of a multi-line JSX element at the end of the last line instead of being alone on the next line (does not apply to self closing elements).
*
* jsxBracketSameLine: <bool>
* default: false
*/
jsxBracketSameLine: false,
/**
* Arrow Function Parentheses
* https://prettier.io/docs/en/options.html#arrow-function-parentheses
*
* Include parentheses around a sole arrow function parameter.
*
* arrowParens: "<always|avoid>"
* default: "always"
*/
arrowParens: 'avoid',
/**
* Range
* https://prettier.io/docs/en/options.html#range
*
* Format only a segment of a file.
*
* rangeStart: <int>
* default: 0
*
* rangeEnd: <int>
* default: Infinity
*/
rangeStart: 0,
rangeEnd: Infinity,
/**
* Parser
* https://prettier.io/docs/en/options.html#parser
*
* Specify which parser to use.
*
* parser: "<string>" | require("./my-parser")
* no default
*
*/
// parser: '',
/**
* File Path
* https://prettier.io/docs/en/options.html#file-path
*
* Specify the file name to use to infer which parser to use.
*
* filepath: "<string>"
* no default
*/
// filepath: '',
/**
* Require pragma
* https://prettier.io/docs/en/options.html#require-pragma
*
* 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: <bool>
* default: false
*/
requirePragma: false,
/**
* Insert Pragma
* https://prettier.io/docs/en/options.html#insert-pragma
*
* Prettier can insert a special @format marker at the top of files specifying that the file has been formatted with prettier. This works well when used in tandem with the --require-pragma option. If there is already a docblock at the top of the file then this option will add a newline to it with the @format marker.
*
* insertPragma: <bool>
* default: false
*/
insertPragma: false,
/**
* Prose Wrap
* https://prettier.io/docs/en/options.html#prose-wrap
*
* By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer, e.g. GitHub comment and BitBucket. In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out with "never".
*
* proseWrap: "<always|never|preserve>"
* default: "preserve"
*/
proseWrap: 'preserve',
/**
* HTML Whitespace Sensitivity
* https://prettier.io/docs/en/options.html#html-whitespace-sensitivity
*
* Specify the global whitespace sensitivity for HTML files, see whitespace-sensitive formatting for more info.
*
* htmlWhitespaceSensitivity: "<css|strict|ignore>"
* default: "css"
*/
htmlWhitespaceSensitivity: 'css',
/**
* Vue files script and style tags indentation
* https://prettier.io/docs/en/options.html#vue-files-script-and-style-tags-indentation
*
* 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 your editor.
*
* vueIndentScriptAndStyle: <bool>
* default: false
*/
vueIndentScriptAndStyle: false,
/**
* End of Line
* https://prettier.io/docs/en/options.html#end-of-line
*
* For historical reasons, there exist two common flavors of line endings in text files. That is \n (or LF for Line Feed) and \r\n (or CRLF for Carriage Return + Line Feed). The former is common on Linux and macOS, while the latter is prevalent on Windows. Some details explaining why it is so can be found on Wikipedia.
*
* endOfLine: "<lf|crlf|cr|auto>"
* default: "lf"
*/
endOfLine: 'lf',
/**
* Embedded Language Formatting
* https://prettier.io/docs/en/options.html#embedded-language-formatting
*
* Control whether Prettier formats quoted code embedded in the file.
*
* embeddedLanguageFormatting: "<off|auto>"
* default: "auto"
*/
embeddedLanguageFormatting: 'auto',
/**
* Single Attribute Per Line
* https://prettier.io/docs/en/options.html#single-attribute-per-line
*
* Enforce single attribute per line in HTML, Vue and JSX.
*
* singleAttributePerLine: "<bool>"
* default: "false"
*/
singleAttributePerLine: false
}