-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprettier.config.js
More file actions
79 lines (69 loc) · 2.44 KB
/
prettier.config.js
File metadata and controls
79 lines (69 loc) · 2.44 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
// Prettier Configuration
// This file configures Prettier code formatting for consistent,
// professional documentation across all contributors.
export default {
// Core Formatting Rules
// Indentation: Use 2 spaces for all files
// Provides consistent, readable indentation without being too wide
tabWidth: 2,
// Use spaces instead of tabs for cross-platform consistency
// Ensures consistent display across different editors and systems
useTabs: false,
// Default line width for code files (JavaScript, CSS, etc.)
// Balances readability with fitting on most screens
printWidth: 80,
// Unix line endings for cross-platform compatibility
// Prevents Git issues with different operating systems
endOfLine: "lf",
// Don't automatically wrap prose text by default
// Preserves intentional formatting in documentation
proseWrap: "preserve",
// File-Specific Overrides
overrides: [
{
// Documentation files: Markdown and MDX
files: ["*.md", "*.mdx"],
options: {
// Wider line width for better prose readability
// 100 characters accommodates longer sentences while staying readable
printWidth: 100,
// Always wrap prose for consistent line breaks
// Ensures clean diffs in version control and consistent formatting
proseWrap: "always",
},
},
{
// Configuration files: JSON, package.json, etc.
files: "*.json",
options: {
// Extra wide for long configuration strings and URLs
// Prevents awkward breaking of configuration values
printWidth: 120,
// Consistent 2-space indentation for configuration files
// Matches the project's overall indentation standard
tabWidth: 2,
},
},
],
};
// Why This Configuration?
//
// MINIMAL APPROACH:
// - Only essential settings for documentation
// - No JavaScript/React specific settings (not needed)
// - Focuses on Markdown, MDX, and JSON formatting
//
// DOCUMENTATION-OPTIMIZED:
// - 100-char width for Markdown provides better readability
// - Always wrap prose ensures consistent Git diffs
// - Preserves intentional formatting where needed
//
// CROSS-PLATFORM COMPATIBLE:
// - Unix line endings work across all systems
// - Spaces instead of tabs prevent display issues
// - Consistent indentation across all file types
//
// CONTRIBUTOR-FRIENDLY:
// - Automatic formatting on save
// - Clear, consistent rules
// - No complex configuration to understand