lint-staged是一个在Git暂存区文件上运行linters的工具。它通常与husky这样的Git钩子库一起使用,以确保在每次提交前都通过代码质量检查。如果提交是空的(即没有文件被修改或添加),lint-staged就没有文件可以处理,因此可能会阻止提交。 2. 研究git commit的--allow-empty选项用法 --allow-empty选项允许你创建一个没...
it also created an empty commit What did create this empty commit? 🚫💩 lint-staged doesn't create commits and works as you described below: if the resulting diff is empty when there will be no-op for the commit aftergit add. I had this in my config:['eslint --fix', 'git add...
29 31 await expect(gitCommit()).rejects.toThrow('lint-staged prevented an empty git commit.') 30 32 31 - // Something was wrong so the repo is returned to original state 33 + // Something was wrong so commit was canceled 32 34 expect(await execGit(['rev-list', '--count',...
yellow(`lint-staged prevented an empty git commit. Use the --allow-empty option to continue, or check your task configuration`)} `) } // Show help text about manual restore in case of git errors. // No sense to show this if the backup stash itself is missing. else if (error....
yellow(`lint-staged prevented an empty git commit. Use the --allow-empty option to continue, or check your task configuration`)} `) } // Show help text about manual restore in case of git errors. // No sense to show this if the backup stash itself is missing. else if (error....
ERROR [FAILED] Prevented an empty git commit! LOG [STARTED] Reverting to original state because of errors... LOG [SUCCESS] Reverting to original state because of errors... LOG [STARTED] Cleaning up... LOG [SUCCESS] Cleaning up... LOG [STARTED] Cleaning up temporary files... LOG [SUCCES...
ERROR [FAILED] Prevented an empty git commit! @@ -982,12 +982,12 @@ describe('lint-staged', () => { LOG [STARTED] Preparing lint-staged... LOG [SUCCESS] Preparing lint-staged... LOG [STARTED] Running tasks for staged files... LOG [STARTED] <path>/lint-staged— 1 file LOG [...
logger.warn(PREVENTED_EMPTY_COMMIT) } else if (ctx.errors.has(GitError) && !ctx.errors.has(GetBackupStashError)) { } else if ( (ctx.errors.has(GitError) || cleanupSkipped(ctx)) && !ctx.errors.has(GetBackupStashError) ) { logger.error(GIT_ERROR) if (ctx.shouldBackup) { // No ...
--allow-empty: By default, when tasks undo all staged changes, lint-staged will exit with an error and abort the commit. Use this flag to allow creating empty git commits. --concurrent [number|boolean]: Controls the concurrency of tasks being run by lint-staged. NOTE: This does NOT ...
WARN ‼ Some of your tasks use \`git add\` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index. WARN ‼ lint-staged prevented an empty git commit. Use the --allow-empty option to continue, or check you...