-
Notifications
You must be signed in to change notification settings - Fork 0
/
.prettierrc.cjs
127 lines (103 loc) · 2.86 KB
/
.prettierrc.cjs
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
const prettierPluginPackagejson = require("prettier-plugin-packagejson");
const prettierPluginSortImports = require("@ianvs/prettier-plugin-sort-imports");
// Tailwind plugin should be last
const prettierPluginTailwindcss = require("prettier-plugin-tailwindcss");
module.exports = {
// Plugins
plugins: [
prettierPluginPackagejson,
prettierPluginTailwindcss,
prettierPluginSortImports,
],
pluginSearchDirs: false,
// @ianvs/prettier-plugin-sort-imports
importOrder: [
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
"^react$",
"^react-dom$",
"^next$",
"^next/+",
"^@?\\w",
"",
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything that does not start with a dot.
"^../",
"",
"^./",
"",
// Relative imports.
// Anything that starts with two dots.
// Style imports.
"^.+\\.s?css$",
],
importOrderSortSpecifiers: true,
importOrderCaseInsensitive: true,
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
importOrderBuiltinModulesToTop: true,
importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
// max 80 characters per line
// default
// printWidth: 80,
// use 2 spaces for indentation
// default
// tabWidth: 2,
// use spaces instead of indentations
// https://github.com/prettier/prettier/issues/7475
useTabs: true,
// semicolon at the end of the line
// default
// semi: true,
// use single quotes
// default
// singleQuote: false,
// object's key is quoted only when necessary
// default
// quoteProps: "as-needed",
// use double quotes instead of single quotes in jsx
// default
// jsxSingleQuote: false,
// no comma at the end
trailingComma: "all",
// spaces are required at the beginning and end of the braces
// default
// bracketSpacing: true,
// brackets are not required for arrow function parameter, when there is only one parameter
// default
// arrowParens: "always",
// format the entire contents of the file
// default
// rangeStart: 0,
// default
// rangeEnd: Infinity,
// no need to write the beginning @prettier of the file
// default
// requirePragma: false,
// No need to automatically insert @prettier at the beginning of the file
// default
// insertPragma: false,
// use default break criteria
proseWrap: "always",
// decide whether to break the html according to the display style
// default
// htmlWhitespaceSensitivity: "css",
// vue files script and style tags indentation
// default
// vueIndentScriptAndStyle: false,
// lf for newline
// default
// endOfLine: "lf",
// formats quoted code embedded
// default
// embeddedLanguageFormatting: "auto",
// Enforce single attribute per line in HTML, Vue and JSX.
// default
// singleAttributePerLine: false,
overrides: [
{
files: ".*rc",
options: { parser: "json" },
},
],
};