Skip to content

Commit ffbac8a

Browse files
committed
Fix linter issues
1 parent cbdc543 commit ffbac8a

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

packages/php-wasm/node/src/lib/node-fs-mount.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
FSHelpers,
3-
type ErrnoError,
4-
type MountHandler,
5-
} from '@php-wasm/universal';
1+
import { type ErrnoError, type MountHandler } from '@php-wasm/universal';
62
import { statSync } from 'fs';
73
import { basename } from 'path';
84

packages/php-wasm/node/src/test/mounting.spec.ts

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { createNodeFsMountHandler, loadNodeRuntime } from '..';
2-
import {
3-
__private__dont__use,
4-
ErrnoError,
5-
FSHelpers,
6-
PHP,
7-
} from '@php-wasm/universal';
2+
import { __private__dont__use, PHP, FSHelpers } from '@php-wasm/universal';
3+
import { type ErrnoError } from '@php-wasm/universal';
84
import { RecommendedPHPVersion } from '@wp-playground/common';
95
import path, { dirname } from 'path';
106
import fs from 'fs';
@@ -83,9 +79,9 @@ describe('Mounting', () => {
8379
createNodeFsMountHandler(filePath)
8480
);
8581
} catch (e: any) {
86-
e = e as ErrnoError;
87-
expect(e.name).toBe('ErrnoError');
88-
expect(e.errno).toBe(10);
82+
const error = e as ErrnoError;
83+
expect(error.name).toBe('ErrnoError');
84+
expect(error.errno).toBe(10);
8985
}
9086
});
9187

@@ -119,8 +115,8 @@ describe('Mounting', () => {
119115
try {
120116
await php.unlink(fileMountPoint);
121117
} catch (e: any) {
122-
e = e as Error;
123-
expect(e.message).toContain(
118+
const error = e as Error;
119+
expect(error.message).toContain(
124120
`Could not unlink "${fileMountPoint}": Device or resource busy.`
125121
);
126122
}
@@ -135,8 +131,8 @@ describe('Mounting', () => {
135131
try {
136132
await php.mv(fileMountPoint, '/single-file-moved.txt');
137133
} catch (e: any) {
138-
e = e as Error;
139-
expect(e.message).toContain(
134+
const error = e as Error;
135+
expect(error.message).toContain(
140136
`Could not move ${fileMountPoint} to /single-file-moved.txt: Device or resource busy.`
141137
);
142138
}
@@ -268,9 +264,9 @@ describe('Mounting', () => {
268264
createNodeFsMountHandler(directoryPath)
269265
);
270266
} catch (e: any) {
271-
e = e as ErrnoError;
272-
expect(e.name).toBe('ErrnoError');
273-
expect(e.errno).toBe(10);
267+
const error = e as ErrnoError;
268+
expect(error.name).toBe('ErrnoError');
269+
expect(error.errno).toBe(10);
274270
}
275271
});
276272

@@ -463,8 +459,8 @@ describe('Mounting', () => {
463459
try {
464460
await php.rmdir(directoryMountPoint);
465461
} catch (e: any) {
466-
e = e as Error;
467-
expect(e.message).toContain(
462+
const error = e as Error;
463+
expect(error.message).toContain(
468464
`Could not remove directory "${directoryMountPoint}": Device or resource busy.`
469465
);
470466
}
@@ -479,8 +475,8 @@ describe('Mounting', () => {
479475
try {
480476
await php.mv(directoryMountPoint, '/nested-test-moved');
481477
} catch (e: any) {
482-
e = e as Error;
483-
expect(e.message).toContain(
478+
const error = e as Error;
479+
expect(error.message).toContain(
484480
`Could not move ${directoryMountPoint} to /nested-test-moved: Device or resource busy.`
485481
);
486482
}

0 commit comments

Comments
 (0)