-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy path.prettierrc.js
More file actions
102 lines (94 loc) · 2.8 KB
/
.prettierrc.js
File metadata and controls
102 lines (94 loc) · 2.8 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
99
100
101
102
/**
* Prettier Configuration
* Formats code consistently across the project
* Works in conjunction with ESLint via eslint-plugin-prettier
*/
module.exports = {
// ==================== Basic Formatting ====================
// Use 4 spaces for indentation (default for most files)
tabWidth: 4,
useTabs: false,
// Line endings
endOfLine: "lf",
// ==================== String & Quotes ====================
// Use double quotes for JS (matches ESLint config)
singleQuote: false,
quoteProps: "as-needed",
// ==================== Semicolons & Commas ====================
semi: true,
trailingComma: "es5", // Trailing commas where valid in ES5 (objects, arrays, etc.)
// ==================== Line Length ====================
printWidth: 120,
// ==================== Spacing ====================
bracketSpacing: true,
bracketSameLine: false,
arrowParens: "avoid", // Omit parens when possible (a => a)
// ==================== HTML/Vue Specific ====================
htmlWhitespaceSensitivity: "css",
vueIndentScriptAndStyle: false,
// ==================== File-specific Overrides ====================
overrides: [
{
// All JSON files - use 4 spaces
files: "*.json",
options: {
tabWidth: 4,
trailingComma: "none",
},
},
{
// All LESS files - use 4 spaces
files: "**/*.less",
options: {
tabWidth: 4,
},
},
{
// All HTML files - use 4 spaces
files: "**/*.html",
options: {
tabWidth: 4,
},
},
{
// Vue files - use 4 spaces, double quotes for HTML attributes
files: "ui/**/*.vue",
options: {
tabWidth: 4,
singleQuote: false,
htmlWhitespaceSensitivity: "css",
},
},
{
// Frontend JavaScript - use single quotes
files: "ui/**/*.js",
options: {
tabWidth: 4,
singleQuote: true,
},
},
{
// Backend JavaScript - use double quotes and 4 spaces
files: ["src/**/*.js", "scripts/**/*.js", "main.js", "*.config.js", ".*.js"],
options: {
tabWidth: 4,
singleQuote: false,
},
},
{
// Markdown files
files: ["*.md"],
options: {
tabWidth: 2,
proseWrap: "preserve",
},
},
{
// YAML files
files: ["*.{yml,yaml}"],
options: {
tabWidth: 2,
},
},
],
};