mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 10:59:53 +00:00
## Summary Avoid direct access of i18n instance to favor useI18n ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7327-Lint-Start-cleanup-of-the-i18n-imports-2c56d73d3650811d9214c9a02863a5a3) by [Unito](https://www.unito.io) --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
22 lines
700 B
TypeScript
22 lines
700 B
TypeScript
import path from 'node:path'
|
|
|
|
export default {
|
|
'./**/*.js': (stagedFiles: string[]) => formatAndEslint(stagedFiles),
|
|
|
|
'./**/*.{ts,tsx,vue,mts}': (stagedFiles: string[]) => [
|
|
...formatAndEslint(stagedFiles),
|
|
'pnpm typecheck'
|
|
]
|
|
}
|
|
|
|
function formatAndEslint(fileNames: string[]) {
|
|
// Convert absolute paths to relative paths for better ESLint resolution
|
|
const relativePaths = fileNames.map((f) => path.relative(process.cwd(), f))
|
|
const joinedPaths = relativePaths.map((p) => `"${p}"`).join(' ')
|
|
return [
|
|
`pnpm exec prettier --cache --write ${joinedPaths}`,
|
|
`pnpm exec oxlint --fix ${joinedPaths}`,
|
|
`pnpm exec eslint --cache --fix --no-warn-ignored ${joinedPaths}`
|
|
]
|
|
}
|