-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
55 lines (48 loc) · 1.15 KB
/
index.ts
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
import type * as prettier from 'prettier';
type RemoveIndex<T> = {
[K in keyof T as string extends K ? never
: number extends K ? never
: K]: T[K];
};
type MustSetOptions = Required<
Omit<
RemoveIndex<prettier.Options>,
// Deprecated options.
| 'jsxBracketSameLine' // use bracketSameLine instead
// Options that don't have default value.
| 'parser'
| 'filepath'
| 'plugins'
| 'pluginSearchDirs'
| 'parentParser'
| '__embeddedInHtml'
>
>;
type Config = MustSetOptions & Omit<prettier.Config, keyof MustSetOptions>;
const config = {
// Overridden options
singleQuote: true,
useTabs: true,
experimentalTernaries: true,
// Options with default values
semi: true,
jsxSingleQuote: false,
trailingComma: 'all',
bracketSpacing: true,
bracketSameLine: false,
rangeStart: 0,
rangeEnd: Infinity,
requirePragma: false,
insertPragma: false,
proseWrap: 'preserve',
arrowParens: 'always',
htmlWhitespaceSensitivity: 'css',
endOfLine: 'lf',
quoteProps: 'as-needed',
vueIndentScriptAndStyle: false,
embeddedLanguageFormatting: 'auto',
singleAttributePerLine: false,
printWidth: 80,
tabWidth: 2,
} satisfies Config;
export default config;