Skip to content

Commit

Permalink
chore: use "@appium/eslint-config-appium-ts": "^1.0.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Jan 3, 2025
1 parent 06737a3 commit 25ebaa7
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import appiumConfig from '@appium/eslint-config-appium-ts';

export default appiumConfig;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SafariDriver from './lib/driver';
import * as SafariDriver from './lib/driver';

export default SafariDriver;
export { SafariDriver };
10 changes: 5 additions & 5 deletions lib/commands/record-screen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import { util, fs, net, tempDir } from 'appium/support';
import { waitForCondition } from 'asyncbox';
import Simctl from 'node-simctl';
import * as Simctl from 'node-simctl';


const commands = {};
Expand Down Expand Up @@ -43,7 +43,7 @@ process.on('exit', () => {
for (const videoFile of VIDEO_FILES) {
try {
fs.rimrafSync(videoFile);
} catch (ign) {}
} catch {}
}
});

Expand Down Expand Up @@ -89,7 +89,7 @@ class ScreenRecorder {
this.log.debug('Force-stopping the currently running video recording');
try {
await /** @type {import('teen_process').SubProcess} */ (this._process).stop('SIGKILL');
} catch (ign) {}
} catch {}
}
this._process = null;
const videoPath = await this.getVideoPath();
Expand Down Expand Up @@ -145,7 +145,7 @@ class ScreenRecorder {
waitMs: STARTUP_TIMEOUT_MS,
intervalMs: STARTUP_INTERVAL_MS,
});
} catch (e) {
} catch {
await this._enforceTermination();
throw this.log.errorWithException(
`The expected screen record file '${this._videoPath}' does not exist after ${STARTUP_TIMEOUT_MS}ms. ` +
Expand Down Expand Up @@ -181,7 +181,7 @@ class ScreenRecorder {

try {
await /** @type {import('teen_process').SubProcess} */ (this._process).stop('SIGINT', PROCESS_SHUTDOWN_TIMEOUT_MS);
} catch (e) {
} catch {
await this._enforceTermination();
throw new Error(`Screen recording has failed to stop after ${PROCESS_SHUTDOWN_TIMEOUT_MS}ms`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import _ from 'lodash';
import { BaseDriver } from 'appium/driver';
import SafariDriverServer from './safari';
import { desiredCapConstraints } from './desired-caps';
import commands from './commands/index';
import * as commands from './commands/index';
import { formatCapsForServer } from './utils';
import { newMethodMap } from './method-map';

Expand Down
8 changes: 4 additions & 4 deletions lib/safari.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SafariDriverProcess {
const [startPort, endPort] = SAFARI_PORT_RANGE;
try {
this.port = await findAPortNotInUse(startPort, endPort);
} catch (e) {
} catch {
throw new Error(
`Cannot find any free port in range ${startPort}..${endPort}. ` +
`Double check the processes that are locking ports within this range and terminate ` +
Expand All @@ -62,7 +62,7 @@ class SafariDriverProcess {
let safariBin;
try {
safariBin = await fs.which(SD_BINARY);
} catch (e) {
} catch {
throw new Error(`${SD_BINARY} binary cannot be found in PATH. ` +
`Please make sure it is present on your system`);
}
Expand All @@ -83,7 +83,7 @@ class SafariDriverProcess {
if (this.isRunning) {
try {
await this.proc?.stop('SIGKILL');
} catch (ign) {}
} catch {}
}
}
}
Expand All @@ -94,7 +94,7 @@ process.once('exit', () => {
if (SAFARI_DRIVER_PROCESS.isRunning) {
try {
execSync(`kill ${SAFARI_DRIVER_PROCESS.proc?.pid}`);
} catch (ign) {}
} catch {}
}
});

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
"appium": "^2.0.0"
},
"devDependencies": {
"@appium/eslint-config-appium": "^8.0.4",
"@appium/eslint-config-appium-ts": "^0.x",
"@appium/eslint-config-appium-ts": "^1.0.0",
"@appium/tsconfig": "^0.x",
"@appium/types": "^0.x",
"@semantic-release/changelog": "^6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion test/functional/mobile-driver-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { remote } from 'webdriverio';
import Simctl from 'node-simctl';
import * as Simctl from 'node-simctl';
import { HOST, PORT, MOCHA_TIMEOUT } from '../utils';

const PLATFORM_VERSION = process.env.PLATFORM_VERSION || '14.1';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/driver-specs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SafariDriver from '../../lib/driver';
import * as SafariDriver from '../../lib/driver';

describe('SafariDriver', function () {
let chai;
Expand Down

0 comments on commit 25ebaa7

Please sign in to comment.