forked from OKEAMAH/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
98 lines (95 loc) · 2.83 KB
/
options.js
File metadata and controls
98 lines (95 loc) · 2.83 KB
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
import commonOptions from "../common/common-options.evaluate.js";
const CATEGORY_JAVASCRIPT = "JavaScript";
// format based on https://github.com/prettier/prettier/blob/main/src/main/core-options.evaluate.js
const options = {
arrowParens: {
category: CATEGORY_JAVASCRIPT,
type: "choice",
default: "always",
description: "Include parentheses around a sole arrow function parameter.",
choices: [
{
value: "always",
description: "Always include parens. Example: `(x) => x`",
},
{
value: "avoid",
description: "Omit parens when possible. Example: `x => x`",
},
],
},
bracketSameLine: commonOptions.bracketSameLine,
bracketSpacing: commonOptions.bracketSpacing,
jsxBracketSameLine: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
description: "Put > on the last line instead of at a new line.",
deprecated: "2.4.0",
},
semi: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
default: true,
description: "Print semicolons.",
oppositeDescription:
"Do not print semicolons, except at the beginning of lines which may need them.",
},
experimentalTernaries: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
default: false,
description:
"Use curious ternaries, with the question mark after the condition.",
oppositeDescription:
"Default behavior of ternaries; keep question marks on the same line as the consequent.",
},
singleQuote: commonOptions.singleQuote,
jsxSingleQuote: {
category: CATEGORY_JAVASCRIPT,
type: "boolean",
default: false,
description: "Use single quotes in JSX.",
},
quoteProps: {
category: CATEGORY_JAVASCRIPT,
type: "choice",
default: "as-needed",
description: "Change when properties in objects are quoted.",
choices: [
{
value: "as-needed",
description: "Only add quotes around object properties where required.",
},
{
value: "consistent",
description:
"If at least one property in an object requires quotes, quote all properties.",
},
{
value: "preserve",
description: "Respect the input use of quotes in object properties.",
},
],
},
trailingComma: {
category: CATEGORY_JAVASCRIPT,
type: "choice",
default: "all",
description: "Print trailing commas wherever possible when multi-line.",
choices: [
{
value: "all",
description:
"Trailing commas wherever possible (including function arguments).",
},
{
value: "es5",
description:
"Trailing commas where valid in ES5 (objects, arrays, etc.)",
},
{ value: "none", description: "No trailing commas." },
],
},
singleAttributePerLine: commonOptions.singleAttributePerLine,
};
export default options;