build(ci): 建立单仓工具链与质量门禁
统一 pnpm 10 + Node 24.15.0 + Turborepo 单仓,落地 ESLint 9 flat、Prettier、commitlint、husky 与 Gitea CI,作为后续批次的一致门禁。
This commit is contained in:
1 parent
75cedbe97b
commit
b3a2a843bb
21 files changed
+10622
No files matched your search
@@ -0,0 +1,18 @@
|
||||
const quote = (file) => JSON.stringify(file);
|
||||
|
||||
// 生成的声明文件(如 openapi.d.ts)被 ESLint 忽略,跳过 lint 只做格式化,
|
||||
// 避免 lint-staged 因 "File ignored" 警告而阻断提交。
|
||||
const lintScripts = (filenames) => {
|
||||
const lintable = filenames.filter((file) => !file.endsWith('.d.ts'));
|
||||
const commands = [];
|
||||
if (lintable.length > 0) {
|
||||
commands.push(`eslint --fix --max-warnings=0 ${lintable.map(quote).join(' ')}`);
|
||||
}
|
||||
commands.push(`prettier --write ${filenames.map(quote).join(' ')}`);
|
||||
return commands;
|
||||
};
|
||||
|
||||
export default {
|
||||
'*.{ts,tsx,js,mjs,cjs}': lintScripts,
|
||||
'*.{json,md,css,scss,yml,yaml}': ['prettier --write'],
|
||||
};
|
||||
Reference in new issue
Block a user