Skip to content

Commit a511fff

Browse files
committed
lint
1 parent dc16cb9 commit a511fff

File tree

5 files changed

+21
-28
lines changed

5 files changed

+21
-28
lines changed

src/BashEnv.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ import {
2727
type SecureFetch,
2828
} from "./network/index.js";
2929
import { type ParseException, parse } from "./parser/parser.js";
30-
import type {
31-
BashExecResult,
32-
Command,
33-
CommandRegistry,
34-
ExecResult,
35-
} from "./types.js";
30+
import type { BashExecResult, Command, CommandRegistry } from "./types.js";
3631

3732
// Default protection limits
3833
const DEFAULT_MAX_CALL_DEPTH = 100;

src/commands/alias/alias.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ describe("unalias command", () => {
7676

7777
it("should remove all aliases with -a", async () => {
7878
const env = new BashEnv();
79-
const result = await env.exec("alias ll='ls -la' la='ls -a'; unalias -a; alias");
79+
const result = await env.exec(
80+
"alias ll='ls -la' la='ls -a'; unalias -a; alias",
81+
);
8082
expect(result.stdout).toBe("");
8183
expect(result.exitCode).toBe(0);
8284
});

src/comparison-tests/export.comparison.test.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ describe("export command - Real Bash Comparison", () => {
2525

2626
it("should set multiple variables", async () => {
2727
const env = await setupFiles(testDir, {});
28-
await compareOutputs(
29-
env,
30-
testDir,
31-
"export A=1 B=2 C=3; echo $A $B $C",
32-
);
28+
await compareOutputs(env, testDir, "export A=1 B=2 C=3; echo $A $B $C");
3329
});
3430

3531
it("should handle value with equals sign", async () => {
@@ -43,7 +39,7 @@ describe("export command - Real Bash Comparison", () => {
4339

4440
it("should handle empty value", async () => {
4541
const env = await setupFiles(testDir, {});
46-
await compareOutputs(env, testDir, "export EMPTY=; echo \"[$EMPTY]\"");
42+
await compareOutputs(env, testDir, 'export EMPTY=; echo "[$EMPTY]"');
4743
});
4844
});
4945

@@ -76,19 +72,15 @@ describe("export command - Real Bash Comparison", () => {
7672
await compareOutputs(
7773
env,
7874
testDir,
79-
"export NAME=world; echo \"hello $NAME\"",
75+
'export NAME=world; echo "hello $NAME"',
8076
);
8177
});
8278
});
8379

8480
describe("inline export", () => {
8581
it("should allow setting and using in same line", async () => {
8682
const env = await setupFiles(testDir, {});
87-
await compareOutputs(
88-
env,
89-
testDir,
90-
"export X=42 && echo $X",
91-
);
83+
await compareOutputs(env, testDir, "export X=42 && echo $X");
9284
});
9385
});
9486
});

src/interpreter/builtins/export.test.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ describe("export builtin", () => {
2525

2626
it("should create empty variable when NAME has no value", async () => {
2727
const env = new BashEnv();
28-
const result = await env.exec('export EMPTY; test -z "$EMPTY" && echo empty');
28+
const result = await env.exec(
29+
'export EMPTY; test -z "$EMPTY" && echo empty',
30+
);
2931
expect(result.stdout).toBe("empty\n");
3032
});
3133

@@ -60,7 +62,7 @@ describe("export builtin", () => {
6062

6163
it("should list newly exported variables within same exec", async () => {
6264
const env = new BashEnv();
63-
const result = await env.exec("export MSG=\"it's working\"; export");
65+
const result = await env.exec('export MSG="it\'s working"; export');
6466
expect(result.stdout).toContain("it'\\''s working");
6567
});
6668

@@ -75,7 +77,9 @@ describe("export builtin", () => {
7577
describe("un-exporting with -n", () => {
7678
it("should remove variable with -n (within same exec)", async () => {
7779
const env = new BashEnv({ env: { FOO: "bar" } });
78-
const result = await env.exec('export -n FOO; test -z "$FOO" && echo removed');
80+
const result = await env.exec(
81+
'export -n FOO; test -z "$FOO" && echo removed',
82+
);
7983
expect(result.stdout).toBe("removed\n");
8084
});
8185

@@ -91,7 +95,9 @@ describe("export builtin", () => {
9195
describe("variable usage", () => {
9296
it("exported variable should be available in same exec", async () => {
9397
const env = new BashEnv();
94-
const result = await env.exec("export GREETING=hello; echo $GREETING world");
98+
const result = await env.exec(
99+
"export GREETING=hello; echo $GREETING world",
100+
);
95101
expect(result.stdout).toBe("hello world\n");
96102
});
97103

@@ -103,7 +109,9 @@ describe("export builtin", () => {
103109

104110
it("should work with conditional", async () => {
105111
const env = new BashEnv();
106-
const result = await env.exec('export DEBUG=1; [ "$DEBUG" = "1" ] && echo debug_on');
112+
const result = await env.exec(
113+
'export DEBUG=1; [ "$DEBUG" = "1" ] && echo debug_on',
114+
);
107115
expect(result.stdout).toBe("debug_on\n");
108116
});
109117

src/interpreter/builtins/export.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ export function handleExport(
2424
if (arg === "-n") {
2525
unexport = true;
2626
} else if (arg === "-p") {
27-
// -p is same as no args, just list
28-
continue;
2927
} else if (arg === "--") {
30-
// End of options
31-
continue;
3228
} else {
3329
processedArgs.push(arg);
3430
}

0 commit comments

Comments
 (0)