Skip to content

Commit 19e5f28

Browse files
chore: Bump eslint version
1 parent 57463a8 commit 19e5f28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+136
-173
lines changed

.eslintignore

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

.eslintrc.json

Lines changed: 0 additions & 22 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/appearance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
style = /** @type {Style} */ (
5454
await /** @type {import('../driver').Simulator} */ (this.device).getAppearance()
5555
);
56-
} catch (ign) {}
56+
} catch {}
5757
}
5858
if (!style) {
5959
style = /** @type {Style} */ (

lib/commands/certificate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async function clickElement(driver, locator, options = {}) {
140140
lookupDelay,
141141
() => driver.findNativeElementOrElements(locator.type, locator.value, false),
142142
);
143-
} catch (err) {
143+
} catch {
144144
if (skipIfInvisible) {
145145
return false;
146146
}
@@ -362,7 +362,7 @@ export default {
362362
async () => {
363363
try {
364364
return (await checkPortStatus(tmpPort, host)) === 'open';
365-
} catch (ign) {
365+
} catch {
366366
return false;
367367
}
368368
},
@@ -372,7 +372,7 @@ export default {
372372
},
373373
);
374374
this.log.debug(`The temporary web server is running at http://${host}:${tmpPort}`);
375-
} catch (e) {
375+
} catch {
376376
throw new Error(
377377
`The temporary web server cannot be started at http://${host}:${tmpPort}.`,
378378
);

lib/commands/context.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createRemoteDebugger, RemoteDebugger} from 'appium-remote-debugger';
22
import {errors, isErrorType} from 'appium/driver';
33
import {util, timing} from 'appium/support';
4-
import IOSPerformanceLog from '../device-log/ios-performance-log';
4+
import {IOSPerformanceLog} from '../device-log/ios-performance-log';
55
import _ from 'lodash';
66
import { NATIVE_WIN } from '../utils';
77
import {
@@ -478,7 +478,6 @@ const commands = {
478478
* @this {XCUITestDriver}
479479
* @returns {Promise<string>}
480480
*/
481-
// eslint-disable-next-line require-await
482481
async getCurrentContext() {
483482
if (this.curContext && this.curContext !== NATIVE_WIN) {
484483
return `${WEBVIEW_BASE}${this.curContext}`;
@@ -638,7 +637,6 @@ const commands = {
638637
* @this {XCUITestDriver}
639638
* @returns {Promise<string>}
640639
*/
641-
// eslint-disable-next-line require-await
642640
async getWindowHandle() {
643641
if (!this.isWebContext()) {
644642
// https://github.com/appium/appium/issues/20710
@@ -701,7 +699,7 @@ function isUrlIgnored(url, safariIgnoreWebHostnames) {
701699
if (hostname === ignoredHost) {
702700
return true;
703701
}
704-
} catch (ign) {
702+
} catch {
705703
// do nothing if invalid URL
706704
}
707705
}

lib/commands/execute.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export default {
7878
* @deprecated
7979
* @privateRemarks It's unclear what this is for. Don't use it.
8080
*/
81-
// eslint-disable-next-line require-await
8281
async receiveAsyncResponse(status, value) {
8382
this.log.debug(`Received async response: ${JSON.stringify(value)}`);
8483
if (!util.hasValue(this.asyncPromise)) {

lib/commands/find.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default {
122122
els = /** @type {Element[]|undefined} */ (
123123
await this.proxyCommand(endpoint, method, body)
124124
);
125-
} catch (err) {
125+
} catch {
126126
els = [];
127127
}
128128
// we succeed if we get some elements
@@ -162,7 +162,6 @@ export default {
162162
// error, when the index gets higher than the number of child elements. This
163163
// is what we want because that error will halt the loop and make it all the
164164
// way to the client.
165-
// eslint-disable-next-line no-constant-condition
166165
while (true) {
167166
const strategy = WDA_CLASS_CHAIN_STRATEGY;
168167
const selector = `*[${index}]`;

lib/commands/general.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ const commands = {
135135
/**
136136
* @this {XCUITestDriver}
137137
*/
138-
// eslint-disable-next-line require-await
139138
async launchApp() {
140139
throw new Error(
141140
`The launchApp API has been deprecated and is not supported anymore. ` +
@@ -145,7 +144,6 @@ const commands = {
145144
/**
146145
* @this {XCUITestDriver}
147146
*/
148-
// eslint-disable-next-line require-await
149147
async closeApp() {
150148
throw new Error(
151149
`The closeApp API has been deprecated and is not supported anymore. ` +

lib/commands/gesture.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ const commands = {
9393
/**
9494
* @this {XCUITestDriver}
9595
*/
96-
// eslint-disable-next-line require-await
9796
async releaseActions() {
9897
this.log.warn('On this platform, releaseActions is a no-op');
9998
},

0 commit comments

Comments
 (0)