mirror of
https://github.com/Mastermindzh/code-style-conventions.git
synced 2025-07-19 08:54:00 +02:00
58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
module.exports = {
|
|
// Line length - optimized for modern development
|
|
printWidth: 100,
|
|
|
|
// Use spaces instead of tabs for consistency
|
|
useTabs: false,
|
|
tabWidth: 2,
|
|
|
|
// Use double quotes for consistency with JSON and HTML attributes
|
|
singleQuote: false,
|
|
|
|
// JSX quotes - use double quotes to match regular quotes
|
|
jsxSingleQuote: false,
|
|
|
|
// Only quote object properties when needed
|
|
quoteProps: "as-needed",
|
|
|
|
// Use trailing commas for all ES2017+ features (better for git diffs)
|
|
trailingComma: "all",
|
|
|
|
// Add spaces inside object braces { foo: bar }
|
|
bracketSpacing: true,
|
|
|
|
// Put closing > on new line for JSX elements (better readability)
|
|
bracketSameLine: false,
|
|
|
|
// Always use parentheses around arrow function parameters for consistency
|
|
arrowParens: "always",
|
|
|
|
// Format all files, don't require pragma comments
|
|
requirePragma: false,
|
|
insertPragma: false,
|
|
|
|
// Preserve markdown line breaks as-is (better for documentation)
|
|
proseWrap: "preserve",
|
|
|
|
// CSS whitespace handling - strict for better consistency
|
|
htmlWhitespaceSensitivity: "css",
|
|
|
|
// Consistent line endings across platforms
|
|
endOfLine: "lf",
|
|
|
|
// Always include semicolons for clarity and consistency
|
|
semi: true,
|
|
|
|
// Don't force single attribute per line (allows flexibility)
|
|
singleAttributePerLine: false,
|
|
|
|
// Format embedded languages automatically
|
|
embeddedLanguageFormatting: "auto",
|
|
|
|
// Experimental: Control Vue SFC formatting
|
|
vueIndentScriptAndStyle: false,
|
|
|
|
// Enhanced experimental features for future-proofing
|
|
experimentalTernaries: false,
|
|
};
|