Skip to content

Commit 3b3de26

Browse files
build(deps-dev): bump @appium/eslint-config-appium-ts from 0.3.3 to 1.0.1 (#854)
1 parent 788bf1c commit 3b3de26

File tree

15 files changed

+35
-50
lines changed

15 files changed

+35
-50
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import appiumConfig from '@appium/eslint-config-appium-ts';
2+
3+
export default [
4+
...appiumConfig,
5+
{
6+
ignores: [
7+
'docs/**',
8+
],
9+
},
10+
];

lib/commands/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export async function performActions(actions) {
7676
* @this {AndroidUiautomator2Driver}
7777
* @returns {Promise<void>}
7878
*/
79-
// eslint-disable-next-line require-await
8079
export async function releaseActions() {
8180
this.log.info('On this platform, releaseActions is a no-op');
8281
}

lib/driver.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
StringRecord,
1111
} from '@appium/types';
1212
import {DEFAULT_ADB_PORT} from 'appium-adb';
13-
import AndroidDriver, {utils} from 'appium-android-driver';
13+
import {AndroidDriver, utils} from 'appium-android-driver';
1414
import {SETTINGS_HELPER_ID} from 'io.appium.settings';
1515
import {BaseDriver, DeviceSettings} from 'appium/driver';
1616
import {fs, mjpeg, util} from 'appium/support';
@@ -481,7 +481,7 @@ class AndroidUiautomator2Driver
481481
const [startPort, endPort] = DEVICE_PORT_RANGE;
482482
try {
483483
this.systemPort = await findAPortNotInUse(startPort, endPort);
484-
} catch (e) {
484+
} catch {
485485
throw this.log.errorWithException(
486486
`Cannot find any free port in range ${startPort}..${endPort}}. ` +
487487
`Please set the available port number by providing the systemPort capability or ` +
@@ -878,7 +878,7 @@ class AndroidUiautomator2Driver
878878
(async () => {
879879
try {
880880
await task();
881-
} catch (ign) {}
881+
} catch {}
882882
})();
883883
})
884884
);

lib/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function isWriteable(filePath) {
1616
await fs.close(await fs.open(filePath, 'r+'));
1717
}
1818
return true;
19-
} catch (ign) {
19+
} catch {
2020
return false;
2121
}
2222
}

lib/uiautomator2.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ class UiAutomator2Server {
226226
} else if (pmOutput.includes(INSTRUMENTATION_TARGET)) {
227227
pmOutput = ''; // remove output, so it is not printed below
228228
this.log.debug(`Instrumentation target '${INSTRUMENTATION_TARGET}' is available`);
229-
// eslint-disable-next-line require-atomic-updates
230229
isPmServiceAvailable = true;
231230
} else if (!pmError) {
232231
pmError = new Error('The instrumentation target is not listed by Package Manager');
@@ -237,7 +236,7 @@ class UiAutomator2Server {
237236
waitMs: SERVICES_LAUNCH_TIMEOUT,
238237
intervalMs: 1000,
239238
});
240-
} catch (err) {
239+
} catch {
241240
// @ts-ignore It is ok if the attribute does not exist
242241
this.log.error(`Unable to find instrumentation target '${INSTRUMENTATION_TARGET}': ${(pmError || {}).message}`);
243242
if (pmOutput) {
@@ -268,23 +267,23 @@ class UiAutomator2Server {
268267
this.jwproxy.didInstrumentationExit = false;
269268
try {
270269
await this.stopInstrumentationProcess();
271-
} catch (ign) {}
270+
} catch {}
272271
await this.startInstrumentationProcess();
273272
if (!this.jwproxy.didInstrumentationExit) {
274273
try {
275274
await waitForCondition(async () => {
276275
try {
277276
await this.jwproxy.command('/status', 'GET');
278277
return true;
279-
} catch (err) {
278+
} catch {
280279
// short circuit to retry or fail fast
281280
return this.jwproxy.didInstrumentationExit;
282281
}
283282
}, {
284283
waitMs: timeout,
285284
intervalMs: 1000,
286285
});
287-
} catch (err) {
286+
} catch {
288287
throw this.log.errorWithException(
289288
`The instrumentation process cannot be initialized within ${timeout}ms timeout. `
290289
+ 'Make sure the application under test does not crash and investigate the logcat output. '
@@ -391,14 +390,14 @@ class UiAutomator2Server {
391390
url: `http://${this.host}:${this.systemPort}/status`,
392391
timeout: axiosTimeout,
393392
});
394-
} catch (err) {
393+
} catch {
395394
return true;
396395
}
397396
}, {
398397
waitMs: timeout,
399398
intervalMs: 100,
400399
});
401-
} catch (err) {
400+
} catch {
402401
this.log.warn(`The ${SERVER_TEST_PACKAGE_ID} process might fail to stop within ${timeout}ms timeout.`);
403402
}
404403
};
@@ -429,12 +428,12 @@ class UiAutomator2Server {
429428
this.adb.forceStop(SERVER_PACKAGE_ID),
430429
this.adb.forceStop(SERVER_TEST_PACKAGE_ID)
431430
]);
432-
} catch (ignore) {}
431+
} catch {}
433432
if (strictCleanup) {
434433
// https://github.com/appium/appium/issues/10749
435434
try {
436435
await this.adb.killProcessesByName('uiautomator');
437-
} catch (ignore) {}
436+
} catch {}
438437
}
439438
await waitStop();
440439
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
"devDependencies": {
7474
"@appium/docutils": "^1.0.1",
75-
"@appium/eslint-config-appium-ts": "^0.x",
75+
"@appium/eslint-config-appium-ts": "^1.x",
7676
"@appium/support": "^6.0.0",
7777
"@appium/test-support": "^3.0.0",
7878
"@appium/tsconfig": "^0.x",

test/functional/commands/find/by-uiautomator-e2e-specs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ describe('Find - uiautomator', function () {
2929
els.length.should.be.above(8);
3030
els.length.should.be.below(14);
3131
});
32-
it('should find elements without prepending "new UiSelector()"', async function () {
32+
it('should find elements without prepending "new UiSelector()" relative', async function () {
3333
const els = await driver.$$('android=.clickable(true)');
3434
els.should.have.length.at.least(8);
3535
});
36-
it('should find elements without prepending "new UiSelector()"', async function () {
36+
it('should find elements without prepending "new UiSelector()" absolute', async function () {
3737
const els = await driver.$$('android=clickable(true)');
3838
els.should.have.length.at.least(8);
3939
});
@@ -75,7 +75,7 @@ describe('Find - uiautomator', function () {
7575
els.should.have.length(0);
7676
await driver.setTimeout({ implicit: 20000 }); // restore implicit wait
7777
});
78-
it('should allow multiple selector statements and return the Union of the two sets', async function () {
78+
it('should allow multiple selector statements and return the Union of the two sets containing non clickable elements', async function () {
7979
const clickableEls = await driver.$$('android=new UiSelector().clickable(true)');
8080
clickableEls.length.should.be.above(0);
8181
const notClickableEls = await driver.$$('android=new UiSelector().clickable(false)');

test/functional/commands/general/url-e2e-specs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('setUrl', function () {
3535

3636
btn = await driver.$('id=com.android.chrome:id/negative_button');
3737
await btn.click();
38-
} catch (ign) {}
38+
} catch {}
3939

4040
await driver.url('https://autify.com');
4141

0 commit comments

Comments
 (0)