Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Run lint-staged to format and lint staged files
npx lint-staged
13 changes: 13 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
// JavaScript files - format with Prettier, then lint with ESLint
'*.js': ['prettier --write', 'eslint --fix'],

// Configuration files - format with Prettier
'*.{json,md,yml,yaml}': ['prettier --write'],

// Package.json - format but preserve exact dependency versions
'package.json': ['prettier --write'],

// Markdown files - format with Prettier (respects overrides in .prettierrc.js)
'*.{md,markdown}': ['prettier --write']
};
55 changes: 55 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Dependencies
node_modules/

# Build outputs
dist/
build/
coverage/
*.tgz

# Logs and temporary files
*.log
*.log.*
.eslintcache
.DS_Store
tmp/
temp/

# Test output
test-results.json

# Environment files
.env*

# Minified files
*.min.js
*.min.css

# Generated files that should not be formatted
# (Add any OFX parsing generated files if applicable)

# Lock files (preserve exact format)
package-lock.json
yarn.lock
pnpm-lock.yaml

# Version control
.git/
.svn/
.hg/

# IDE and editor files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
90 changes: 90 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
module.exports = {
// Core formatting options aligned with ESLint rules
semi: true,
singleQuote: true,
quoteProps: 'as-needed',
trailingComma: 'none',

// Indentation and line length
tabWidth: 2,
useTabs: false,
printWidth: 120, // Matches ESLint max-len rule

// Bracket and spacing configuration
bracketSpacing: true,
bracketSameLine: false, // Also applies to JSX (replaces deprecated jsxBracketSameLine)

// Arrow function parentheses - consistent style
arrowParens: 'avoid',

// End of line consistency (important for cross-platform banking systems)
endOfLine: 'lf',

// Prose wrapping for documentation
proseWrap: 'preserve',

// HTML and template formatting
htmlWhitespaceSensitivity: 'css',

// Embedded language formatting
embeddedLanguageFormatting: 'auto',

// JSX configuration (if needed for React components in the future)
jsxSingleQuote: true,

// File-specific overrides for banking/financial code
overrides: [
{
// Test files can have slightly longer lines for readability
files: ['test/**/*.js', '**/*.test.js', '**/*.spec.js'],
options: {
printWidth: 150
}
},
{
// Fixture files may contain long data strings - minimal formatting
files: ['test/fixtures/**/*.js'],
options: {
printWidth: 200,
// Preserve exact formatting for financial data fixtures
proseWrap: 'never'
}
},
{
// Configuration files
files: ['*.config.js', '*.config.mjs', 'eslint.config.js', 'vitest.config.js'],
options: {
printWidth: 120,
// Allow longer expressions in config files
arrowParens: 'always'
}
},
{
// Markdown documentation files
files: ['*.md', '*.markdown'],
options: {
printWidth: 80,
proseWrap: 'always',
tabWidth: 2
}
},
{
// JSON configuration files
files: ['*.json', '.prettierrc', '.eslintrc'],
options: {
printWidth: 120,
tabWidth: 2
}
},
{
// Package.json formatting
files: ['package.json'],
options: {
printWidth: 120,
tabWidth: 2,
// Keep package.json organized and readable
trailingComma: 'none'
}
}
]
};
Loading