Skip to content

Use another exit code for internal error. #1361

Open
@risu729

Description

Description

I'm using lint-staged in my GitHub Actions and want to detect whether lint-staged has failed because of the failure of internal git diff or because of linters.

For example, git diff always throws an error if it is the first commit. (I can use the /dev/null hash to avoid it, but it is complicated and cannot handle other errors.)

I suggest using another exit code for internal errors, including git diff, like prettier.

I checked through the current behavior of lint-staged, and it always exits with 1, as defined here.

try {
const passed = await lintStaged(options)
process.exitCode = passed ? 0 : 1
} catch {
process.exitCode = 1
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions