-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathprettier.config.js
More file actions
85 lines (64 loc) · 1.94 KB
/
prettier.config.js
File metadata and controls
85 lines (64 loc) · 1.94 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
/**
* Prettier Configuration
*
* Code formatting rules for consistent code style across the project
*/
/** @type {import('prettier').Config} */
module.exports = {
// Print width - line length that the printer will wrap on
printWidth: 120,
// Tab width - number of spaces per indentation level
tabWidth: 2,
// Use tabs instead of spaces
useTabs: false,
// Semicolons at the end of statements
semi: false,
// Use single quotes instead of double quotes
singleQuote: false,
// Quote properties in objects only when necessary
quoteProps: "as-needed",
// Use single quotes in JSX
jsxSingleQuote: false,
// Trailing commas where valid in ES5 (objects, arrays, etc.)
trailingComma: "es5",
// Spaces between brackets in object literals
bracketSpacing: true,
// Put the > of a multi-line JSX element at the end of the last line
bracketSameLine: false,
// Include parentheses around a sole arrow function parameter
arrowParens: "always",
// Prettier can restrict itself to only format files that contain a special comment
requirePragma: false,
// Prettier can insert a special @format marker at the top of files
insertPragma: false,
// How to wrap prose (markdown)
proseWrap: "preserve",
// HTML whitespace sensitivity
htmlWhitespaceSensitivity: "css",
// Vue files script and style tags indentation
vueIndentScriptAndStyle: false,
// Line ending
endOfLine: "lf",
// Control whether Prettier formats quoted code embedded in the file
embeddedLanguageFormatting: "auto",
// Enforce single attribute per line in HTML, Vue and JSX
singleAttributePerLine: false,
// Tailwind CSS plugin
plugins: ["prettier-plugin-tailwindcss"],
// Override settings for specific file types
overrides: [
{
files: "*.json",
options: {
printWidth: 80,
},
},
{
files: "*.md",
options: {
proseWrap: "always",
printWidth: 80,
},
},
],
}