feat: Add prettier and configure autofix to use it (#6642)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/6643/head^2
parent
0eca301181
commit
65b21d2c4b
@ -0,0 +1,38 @@
|
||||
# Dependencies
|
||||
node_modules/
|
||||
|
||||
# Build output
|
||||
dist/
|
||||
build/
|
||||
|
||||
# Data directories
|
||||
data/
|
||||
|
||||
# Test output
|
||||
test-results/
|
||||
playwright-report/
|
||||
private/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
# Lock files
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
|
||||
# Generated files
|
||||
*.min.js
|
||||
*.min.css
|
||||
|
||||
# Docker
|
||||
docker/
|
||||
@ -0,0 +1,71 @@
|
||||
/**
|
||||
* Prettier Configuration for Uptime Kuma
|
||||
*
|
||||
* Usage:
|
||||
* npm run fmt - Format all files (auto-runs in CI via autofix workflow)
|
||||
* npm run fmt -- --check - Check formatting without making changes
|
||||
*
|
||||
* TIP: This formatter is automatically run in CI, so no need to worry about it
|
||||
*/
|
||||
module.exports = {
|
||||
// Core formatting options - matching original ESLint rules
|
||||
semi: true,
|
||||
singleQuote: false,
|
||||
trailingComma: "es5",
|
||||
printWidth: 120,
|
||||
tabWidth: 4,
|
||||
useTabs: false,
|
||||
endOfLine: "lf",
|
||||
arrowParens: "always",
|
||||
bracketSpacing: true,
|
||||
bracketSameLine: false,
|
||||
|
||||
// Vue-specific settings
|
||||
vueIndentScriptAndStyle: false,
|
||||
singleAttributePerLine: false,
|
||||
htmlWhitespaceSensitivity: "ignore", // More forgiving with whitespace in HTML
|
||||
|
||||
// Override settings for specific file types
|
||||
overrides: [
|
||||
{
|
||||
files: "*.vue",
|
||||
options: {
|
||||
parser: "vue",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["*.json"],
|
||||
options: {
|
||||
tabWidth: 2,
|
||||
trailingComma: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["*.yml", "*.yaml"],
|
||||
options: {
|
||||
tabWidth: 2,
|
||||
trailingComma: "none",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["package.json"],
|
||||
options: {
|
||||
tabWidth: 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["src/icon.js"],
|
||||
options: {
|
||||
trailingComma: "all",
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["*.md"],
|
||||
options: {
|
||||
printWidth: 100,
|
||||
proseWrap: "preserve",
|
||||
tabWidth: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
Loading…
Reference in new issue