Skip to content

Fix clean console #5629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage/
.tmp*
.vscode
dist/
.yarn*
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/bin/sh

Copy link
Member

@uiolee uiolee Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but got error on my windows, see the screenshoot

Copy link
Contributor Author

@dimaslanjaka dimaslanjaka Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git scm windows version still need shebang. and shebang still allowed by husky. here the doc, Note section

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could see your screenshot of error. However, I could not reproduce on my window.

npx lint-staged
3 changes: 2 additions & 1 deletion lib/plugins/console/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Promise from 'bluebird';
import { exists, unlink, rmdir } from 'hexo-fs';
import type Hexo from '../../hexo';

function cleanConsole(this: Hexo): Promise<[void, void, any]> {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-unused-vars

Even if I delete it, eslint have not report any errors.

function cleanConsole(this: Hexo, _args?: any) {
return Promise.all([
deleteDatabase(this),
deletePublicDir(this),
Expand Down
Loading