chore: turn cn comment to en for common space (#376)

This commit is contained in:
tecvan
2025-07-31 12:42:03 +08:00
committed by GitHub
parent f7d73cd391
commit a1f3a9aead
40 changed files with 390 additions and 390 deletions

View File

@@ -25,7 +25,7 @@ module.exports = {
.map(f => path.relative(projectFolder, f))
.join(' ');
// TSESTREE_SINGLE_RUN doc https://typescript-eslint.io/packages/parser/#allowautomaticsingleruninference
// 切换到项目文件夹,并运行 ESLint 命令
// Switch to the project folder and run the ESLint command
const cmd = [
`cd ${projectFolder}`,
`TSESTREE_SINGLE_RUN=true eslint --fix --cache ${filesToCheck} --no-error-on-unmatched-pattern`,
@@ -47,8 +47,8 @@ module.exports = {
}
return [
// 这里不能直接返回 eslintCmds 数组,因为 lint-staged 会依次串行执行每个命令
// concurrently 会并行执行多个命令
// The eslintCmds array cannot be returned directly here, because lint-staged executes each command in sequence
// And concurrently execute multiple commands in parallel
`concurrently --max-process 8 --names ${eslintCmds
.map(r => `${r.name}`)
.join(',')} --kill-others-on-fail ${eslintCmds
@@ -57,7 +57,7 @@ module.exports = {
];
},
'**/*.{less,scss,css}': files => {
// 暂时只修复,不报错卡点
// It is only repaired for the time being, and no errors are reported.
return [`stylelint ${files.join(' ')} --fix || exit 0`];
},
'**/package.json': async files => {
@@ -68,7 +68,7 @@ module.exports = {
if (!filesToLint) return [];
return [
// https://eslint.org/docs/latest/flags/#enable-feature-flags-with-the-cli
// eslint v9默认从cwd找配置这里需要使用 unstable_config_lookup_from_file 配置,否则会报错
// Eslint v9 finds the configuration from cwd by default. You need to use unstable_config_lookup_from_file configuration here, otherwise an error will be reported.
`eslint --cache ${filesToLint} --flag unstable_config_lookup_from_file`,
`prettier ${filesToLint} --write`,
];

View File

@@ -13,7 +13,7 @@ const getRushConfiguration = (function () {
};
})();
// 获取变更文件所在的项目路径
// Get the project path where the change file is located
function withProjectFolder(changedFiles) {
const projectFolders = [];
@@ -24,7 +24,7 @@ function withProjectFolder(changedFiles) {
for (const file of changedFiles) {
const project = lookup.findChildPath(path.relative(rushJsonFolder, file));
// 忽略不在 rush.json 内定义的项目
// Ignore items not defined in rush.json
if (project) {
const projectFolder = project?.projectFolder ?? rushJsonFolder;
const packageName = project?.packageName;
@@ -72,7 +72,7 @@ async function excludeIgnoredFiles(changedFiles) {
}
}
// 获取发生变更的项目路径
// Get the project path that changed
function getChangedProjects(changedFiles) {
const changedProjectFolders = new Set();
const changedProjects = new Set();