Skip to content

Commit 17f49ec

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

File tree

11 files changed

+28
-48
lines changed

11 files changed

+28
-48
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

Scripts/build-webdriveragent.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 13 additions & 0 deletions
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)