Skip to content

Commit

Permalink
chore: Bump eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Jan 3, 2025
1 parent 9734b83 commit b098b4c
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 48 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

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

This file was deleted.

2 changes: 1 addition & 1 deletion Scripts/build-webdriveragent.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function buildWebDriverAgent (xcodeVersion) {
await exec('xcodebuild', ['clean', '-derivedDataPath', DERIVED_DATA_PATH, '-scheme', 'WebDriverAgentRunner'], {
cwd: ROOT_DIR
});
} catch (ign) {}
} catch {}

// Get Xcode version
xcodeVersion = xcodeVersion || await xcode.getVersion();
Expand Down
2 changes: 1 addition & 1 deletion Scripts/fetch-prebuilt-wda.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function fetchPrebuiltWebDriverAgentAssets () {
try {
const nameOfAgent = _.last(url.split('/'));
agentsDownloading.push(downloadAgent(url, path.join(webdriveragentsDir, nameOfAgent)));
} catch (ign) { }
} catch { }
}

// Wait for them all to finish
Expand Down
13 changes: 13 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import appiumConfig from '@appium/eslint-config-appium-ts';

export default [
...appiumConfig,
{
ignores: [
'Configurations/**',
'Fastlane/**',
'PrivateHeaders/**',
'WebDriverAgent*/**'
],
},
];
5 changes: 2 additions & 3 deletions lib/check-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { fs } from '@appium/support';
import _ from 'lodash';
import { exec } from 'teen_process';
import path from 'path';
import XcodeBuild from './xcodebuild';
import xcode from 'appium-xcode';
import {XcodeBuild} from './xcodebuild';
import * as xcode from 'appium-xcode';
import {
WDA_SCHEME, SDK_SIMULATOR, WDA_RUNNER_APP
} from './constants';
Expand All @@ -22,7 +22,6 @@ async function buildWDASim () {
await exec('xcodebuild', args);
}

// eslint-disable-next-line require-await
export async function checkForDependencies () {
log.debug('Dependencies are up to date');
return false;
Expand Down
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const getModuleRoot = _.memoize(function getModuleRoot () {
JSON.parse(_fs.readFileSync(manifestPath, 'utf8')).name === 'appium-webdriveragent') {
return currentDir;
}
} catch (ign) {}
} catch {}
currentDir = path.dirname(currentDir);
isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ async function killAppUsingPattern (pgrepPattern) {
intervalMs: 100,
});
return;
} catch (ign) {
} catch {
// try the next signal
}
}
Expand Down Expand Up @@ -121,7 +121,7 @@ async function updateProjectFile (agentPath, newBundleId) {
try {
// Assuming projectFilePath is in the correct state, create .old from projectFilePath
await fs.copyFile(projectFilePath, `${projectFilePath}.old`);
await replaceInFile(projectFilePath, new RegExp(_.escapeRegExp(WDA_RUNNER_BUNDLE_ID), 'g'), newBundleId); // eslint-disable-line no-useless-escape
await replaceInFile(projectFilePath, new RegExp(_.escapeRegExp(WDA_RUNNER_BUNDLE_ID), 'g'), newBundleId);
log.debug(`Successfully updated '${projectFilePath}' with bundle id '${newBundleId}'`);
} catch (err) {
log.debug(`Error updating project file: ${err.message}`);
Expand Down
4 changes: 2 additions & 2 deletions lib/webdriveragent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NoSessionProxy } from './no-session-proxy';
import {
getWDAUpgradeTimestamp, resetTestProcesses, getPIDsListeningOnPort, BOOTSTRAP_PATH
} from './utils';
import XcodeBuild from './xcodebuild';
import {XcodeBuild} from './xcodebuild';
import AsyncLock from 'async-lock';
import { exec } from 'teen_process';
import { bundleWDASim } from './check-dependencies';
Expand Down Expand Up @@ -417,7 +417,7 @@ export class WebDriverAgent {
let status;
try {
status = await this.getStatus(this.wdaLaunchTimeout);
} catch (err) {
} catch {
throw new Error(
`Failed to start the preinstalled WebDriverAgent in ${this.wdaLaunchTimeout} ms. ` +
`The WebDriverAgent might not be properly built or the device might be locked. ` +
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"homepage": "https://github.com/appium/WebDriverAgent#readme",
"devDependencies": {
"@appium/eslint-config-appium-ts": "^0.x",
"@appium/eslint-config-appium-ts": "^1.0.0",
"@appium/test-support": "^3.0.0",
"@appium/tsconfig": "^0.x",
"@appium/types": "^0.x",
Expand Down
4 changes: 2 additions & 2 deletions test/functional/helpers/simulator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import Simctl from 'node-simctl';
import { Simctl } from 'node-simctl';
import { retryInterval } from 'asyncbox';
import { killAllSimulators as simKill } from 'appium-ios-simulator';
import { resetTestProcesses } from '../../../lib/utils';
Expand Down Expand Up @@ -34,7 +34,7 @@ async function deleteDeviceWithRetry (udid) {
const simctl = new Simctl({udid});
try {
await retryInterval(10, 1000, simctl.deleteDevice.bind(simctl));
} catch (ign) {}
} catch {}
}


Expand Down
6 changes: 3 additions & 3 deletions test/functional/webdriveragent-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Simctl from 'node-simctl';
import { Simctl } from 'node-simctl';
import { getVersion } from 'appium-xcode';
import { getSimulator } from 'appium-ios-simulator';
import { killAllSimulators, shutdownSimulator } from './helpers/simulator';
Expand Down Expand Up @@ -89,7 +89,7 @@ describe('WebDriverAgent', function () {
await retryInterval(5, 1000, async function () {
await shutdownSimulator(device);
});
} catch (ign) {}
} catch {}
});

it('should launch agent on a sim', async function () {
Expand All @@ -106,7 +106,7 @@ describe('WebDriverAgent', function () {

const agent = new WebDriverAgent(xcodeVersion, getStartOpts(device));

agent.xcodebuild.createSubProcess = async function () { // eslint-disable-line require-await
agent.xcodebuild.createSubProcess = async function () {
let args = [
'-workspace',
`${this.agentPath}dfgs`,
Expand Down

0 comments on commit b098b4c

Please sign in to comment.