Skip to content
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

Fix lint errors using deno lint --fix #906

Merged
merged 2 commits into from
Aug 31, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
- name: setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: v1.46.x

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 18.x
node-version: 20.x
registry-url: https://registry.npmjs.com

- name: format
Expand Down
15 changes: 5 additions & 10 deletions lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createContext } from "./context.ts";
import { type Operation } from "./types.ts";
import { action } from "./instructions.ts";
import { run } from "./run.ts";
import process from "node:process";

/**
* Halt process execution immediately and initiate shutdown. If a message is
Expand Down Expand Up @@ -90,19 +91,13 @@ export async function main(
}
},
*node() {
//@ts-expect-error type-checked by Deno, run on Node
hardexit = (status) => global.process.exit(status);
hardexit = (status) => process.exit(status);
try {
//@ts-expect-error type-checked by Deno, run on Node
process.on("SIGINT", interrupt.SIGINT);
//@ts-expect-error type-checked by Deno, run on Node
process.on("SIGTERM", interrupt.SIGTERM);
//@ts-expect-error type-checked by Deno, run on Node
yield* body(global.process.argv.slice(2));
yield* body(process.argv.slice(2));
} finally {
//@ts-expect-error this runs on Node
process.off("SIGINT", interrupt.SIGINT);
//@ts-expect-error this runs on Node
process.off("SIGTERM", interrupt.SIGINT);
}
},
Expand Down Expand Up @@ -160,10 +155,10 @@ function* withHost<T>(op: HostOperation<T>): Operation<T> {

if (typeof global.Deno !== "undefined") {
return yield* op.deno();
// this snippet is from the node-detect npm package
// this snippet is from the detect-node npm package
// @see https://github.com/iliakan/detect-node/blob/master/index.js
} else if (
Object.prototype.toString.call(
//@ts-expect-error dev env is deno, but this is safe to run.
typeof process !== "undefined" ? process : 0,
) === "[object process]"
) {
Expand Down
Loading