Add pre-commit hooks for linting and formatting
Set up pre-commit framework with ruff (backend) and ESLint/Prettier/tsc (frontend) hooks to catch issues locally before CI. Auto-format all frontend files with Prettier to comply with the new check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
export function downloadJson(data: unknown, filename: string) {
|
||||
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' })
|
||||
const blob = new Blob([JSON.stringify(data, null, 2)], {
|
||||
type: 'application/json',
|
||||
})
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
|
||||
@@ -1,18 +1,30 @@
|
||||
export function formatEvolutionMethod(evo: { trigger: string; minLevel: number | null; item: string | null; heldItem: string | null; condition: string | null }): string {
|
||||
export function formatEvolutionMethod(evo: {
|
||||
trigger: string
|
||||
minLevel: number | null
|
||||
item: string | null
|
||||
heldItem: string | null
|
||||
condition: string | null
|
||||
}): string {
|
||||
const parts: string[] = []
|
||||
if (evo.trigger === 'level-up' && evo.minLevel) {
|
||||
parts.push(`Level ${evo.minLevel}`)
|
||||
} else if (evo.trigger === 'level-up') {
|
||||
parts.push('Level up')
|
||||
} else if (evo.trigger === 'use-item' && evo.item) {
|
||||
parts.push(evo.item.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()))
|
||||
parts.push(
|
||||
evo.item.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
)
|
||||
} else if (evo.trigger === 'trade') {
|
||||
parts.push('Trade')
|
||||
} else {
|
||||
parts.push(evo.trigger.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()))
|
||||
parts.push(
|
||||
evo.trigger.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
)
|
||||
}
|
||||
if (evo.heldItem) {
|
||||
parts.push(`holding ${evo.heldItem.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())}`)
|
||||
parts.push(
|
||||
`holding ${evo.heldItem.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())}`
|
||||
)
|
||||
}
|
||||
if (evo.condition) {
|
||||
parts.push(evo.condition)
|
||||
|
||||
Reference in New Issue
Block a user