Skip to content

Commit 17f49ec

Browse files
chore: Bump eslint (#965)
1 parent 9734b83 commit 17f49ec

11 files changed

+28
-48
lines changed

.eslintignore

-3
This file was deleted.

.eslintrc.json

-29
This file was deleted.

Scripts/build-webdriveragent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function buildWebDriverAgent (xcodeVersion) {
3434
await exec('xcodebuild', ['clean', '-derivedDataPath', DERIVED_DATA_PATH, '-scheme', 'WebDriverAgentRunner'], {
3535
cwd: ROOT_DIR
3636
});
37-
} catch (ign) {}
37+
} catch {}
3838

3939
// Get Xcode version
4040
xcodeVersion = xcodeVersion || await xcode.getVersion();

Scripts/fetch-prebuilt-wda.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ async function fetchPrebuiltWebDriverAgentAssets () {
4747
try {
4848
const nameOfAgent = _.last(url.split('/'));
4949
agentsDownloading.push(downloadAgent(url, path.join(webdriveragentsDir, nameOfAgent)));
50-
} catch (ign) { }
50+
} catch { }
5151
}
5252

5353
// Wait for them all to finish

eslint.config.mjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import appiumConfig from '@appium/eslint-config-appium-ts';
2+
3+
export default [
4+
...appiumConfig,
5+
{
6+
ignores: [
7+
'Configurations/**',
8+
'Fastlane/**',
9+
'PrivateHeaders/**',
10+
'WebDriverAgent*/**'
11+
],
12+
},
13+
];

lib/check-dependencies.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { fs } from '@appium/support';
22
import _ from 'lodash';
33
import { exec } from 'teen_process';
44
import path from 'path';
5-
import XcodeBuild from './xcodebuild';
6-
import xcode from 'appium-xcode';
5+
import {XcodeBuild} from './xcodebuild';
6+
import * as xcode from 'appium-xcode';
77
import {
88
WDA_SCHEME, SDK_SIMULATOR, WDA_RUNNER_APP
99
} from './constants';
@@ -22,7 +22,6 @@ async function buildWDASim () {
2222
await exec('xcodebuild', args);
2323
}
2424

25-
// eslint-disable-next-line require-await
2625
export async function checkForDependencies () {
2726
log.debug('Dependencies are up to date');
2827
return false;

lib/utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const getModuleRoot = _.memoize(function getModuleRoot () {
2727
JSON.parse(_fs.readFileSync(manifestPath, 'utf8')).name === 'appium-webdriveragent') {
2828
return currentDir;
2929
}
30-
} catch (ign) {}
30+
} catch {}
3131
currentDir = path.dirname(currentDir);
3232
isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
3333
}
@@ -86,7 +86,7 @@ async function killAppUsingPattern (pgrepPattern) {
8686
intervalMs: 100,
8787
});
8888
return;
89-
} catch (ign) {
89+
} catch {
9090
// try the next signal
9191
}
9292
}
@@ -121,7 +121,7 @@ async function updateProjectFile (agentPath, newBundleId) {
121121
try {
122122
// Assuming projectFilePath is in the correct state, create .old from projectFilePath
123123
await fs.copyFile(projectFilePath, `${projectFilePath}.old`);
124-
await replaceInFile(projectFilePath, new RegExp(_.escapeRegExp(WDA_RUNNER_BUNDLE_ID), 'g'), newBundleId); // eslint-disable-line no-useless-escape
124+
await replaceInFile(projectFilePath, new RegExp(_.escapeRegExp(WDA_RUNNER_BUNDLE_ID), 'g'), newBundleId);
125125
log.debug(`Successfully updated '${projectFilePath}' with bundle id '${newBundleId}'`);
126126
} catch (err) {
127127
log.debug(`Error updating project file: ${err.message}`);

lib/webdriveragent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { NoSessionProxy } from './no-session-proxy';
1010
import {
1111
getWDAUpgradeTimestamp, resetTestProcesses, getPIDsListeningOnPort, BOOTSTRAP_PATH
1212
} from './utils';
13-
import XcodeBuild from './xcodebuild';
13+
import {XcodeBuild} from './xcodebuild';
1414
import AsyncLock from 'async-lock';
1515
import { exec } from 'teen_process';
1616
import { bundleWDASim } from './check-dependencies';
@@ -417,7 +417,7 @@ export class WebDriverAgent {
417417
let status;
418418
try {
419419
status = await this.getStatus(this.wdaLaunchTimeout);
420-
} catch (err) {
420+
} catch {
421421
throw new Error(
422422
`Failed to start the preinstalled WebDriverAgent in ${this.wdaLaunchTimeout} ms. ` +
423423
`The WebDriverAgent might not be properly built or the device might be locked. ` +

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"homepage": "https://github.com/appium/WebDriverAgent#readme",
5050
"devDependencies": {
51-
"@appium/eslint-config-appium-ts": "^0.x",
51+
"@appium/eslint-config-appium-ts": "^1.0.0",
5252
"@appium/test-support": "^3.0.0",
5353
"@appium/tsconfig": "^0.x",
5454
"@appium/types": "^0.x",

test/functional/helpers/simulator.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import Simctl from 'node-simctl';
2+
import { Simctl } from 'node-simctl';
33
import { retryInterval } from 'asyncbox';
44
import { killAllSimulators as simKill } from 'appium-ios-simulator';
55
import { resetTestProcesses } from '../../../lib/utils';
@@ -34,7 +34,7 @@ async function deleteDeviceWithRetry (udid) {
3434
const simctl = new Simctl({udid});
3535
try {
3636
await retryInterval(10, 1000, simctl.deleteDevice.bind(simctl));
37-
} catch (ign) {}
37+
} catch {}
3838
}
3939

4040

test/functional/webdriveragent-e2e-specs.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Simctl from 'node-simctl';
1+
import { Simctl } from 'node-simctl';
22
import { getVersion } from 'appium-xcode';
33
import { getSimulator } from 'appium-ios-simulator';
44
import { killAllSimulators, shutdownSimulator } from './helpers/simulator';
@@ -89,7 +89,7 @@ describe('WebDriverAgent', function () {
8989
await retryInterval(5, 1000, async function () {
9090
await shutdownSimulator(device);
9191
});
92-
} catch (ign) {}
92+
} catch {}
9393
});
9494

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

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

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

0 commit comments

Comments
 (0)