代码拉取完成,页面将自动刷新
import path from 'node:path'
function createCommand(prefix) {
return (filenames) => `${prefix} ${filenames.map((f) => path.relative(process.cwd(), f)).join(' ')}`
}
export default {
// JavaScript/TypeScript 文件使用 Biome (排除 .d.ts 文件和tauri-plugin-hula目录)
'*.{js,jsx,ts,tsx,json}': [
(filenames) => {
const filteredFiles = filenames.filter(
(f) =>
!f.includes('src-tauri/') && !f.includes('tauri-plugin-hula/') && !f.includes('public/') && !f.endsWith('.d.ts') && !f.includes('.vscode/')
)
return filteredFiles.length > 0
? `biome check --write --unsafe ${filteredFiles.map((f) => path.relative(process.cwd(), f)).join(' ')}`
: 'echo "No files to check"'
}
],
// Vue 文件:使用 Biome 检查和修复,然后用 Prettier 格式化
'*.vue': [createCommand('biome check --write --unsafe'), createCommand('prettier --write')],
// Rust 代码:使用 manifest-path 指定 workspace,避免切换目录
'src-tauri/**/*.rs': () => 'cargo fmt --manifest-path src-tauri/Cargo.toml'
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。