-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fail gracefully on fatal error (#369)
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@ts-safeql/eslint-plugin": patch | ||
--- | ||
|
||
Fail SafeQL gracefully on fatal error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// https://github.com/antfu/eslint-config/blob/de2d48d0f4409c66fccbf0872896f00c202f7bf1/src/utils.ts#L135 | ||
export function isInEditorEnv(): boolean { | ||
if (process.env.CI) return false; | ||
if (isInGitHooksOrLintStaged()) return false; | ||
return !!( | ||
false || | ||
process.env.VSCODE_PID || | ||
process.env.VSCODE_CWD || | ||
process.env.JETBRAINS_IDE || | ||
process.env.VIM || | ||
process.env.NVIM | ||
); | ||
} | ||
|
||
export function isInGitHooksOrLintStaged(): boolean { | ||
return !!( | ||
false || | ||
process.env.GIT_PARAMS || | ||
process.env.VSCODE_GIT_COMMAND || | ||
process.env.npm_lifecycle_script?.startsWith("lint-staged") | ||
); | ||
} |