Skip to content

Commit

Permalink
chore: lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FRSgit committed Jan 5, 2025
1 parent bebea28 commit d58ac76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions bin/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ let output: string, dir: string;
}

afterEach(() => {
fs.existsSync(output) &&
(fs.lstatSync(output).isDirectory()
? fs.rmdirSync(output)
: fs.unlinkSync(output));
if (fs.existsSync(output)) {
if (fs.lstatSync(output).isDirectory()) fs.rmdirSync(output);
else fs.unlinkSync(output);
}
});

test('no arguments', () => {
Expand Down Expand Up @@ -130,9 +130,9 @@ test('stdout argument', () => {
describe('input argument', async () => {
let input: tmp.FileResult | undefined, input2: tmp.FileResult | undefined;
const cleanInputs = () => {
input && input.cleanup();
input?.cleanup();
input = undefined;
input2 && input2.cleanup();
input2?.cleanup();
input2 = undefined;
};

Expand Down
12 changes: 6 additions & 6 deletions src/replace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ let output: string, dir: string;
let input: tmp.FileResult | undefined, input2: tmp.FileResult | undefined;

const cleanInputs = () => {
input2 && input2.cleanup();
input2?.cleanup();
input2 = undefined;
input && input.cleanup();
input?.cleanup();
input = undefined;
};

Expand Down Expand Up @@ -82,10 +82,10 @@ const createDemoInputs = async () => {
}

afterEach(() => {
fs.existsSync(output) &&
(fs.lstatSync(output).isDirectory()
? fs.rmdirSync(output)
: fs.unlinkSync(output));
if (fs.existsSync(output)) {
if (fs.lstatSync(output).isDirectory()) fs.rmdirSync(output);
else fs.unlinkSync(output);
}
});

describe('argument validation', () => {
Expand Down

0 comments on commit d58ac76

Please sign in to comment.