Skip to content

Commit

Permalink
chore: bump eslint-config-appium-ts (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Jan 8, 2025
1 parent 4c5854c commit 7873f54
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import appiumConfig from '@appium/eslint-config-appium-ts';

export default [
...appiumConfig,
{
ignores: [
'espresso-server/**',
],
},
];
8 changes: 4 additions & 4 deletions lib/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
(async () => {
try {
await task();
} catch (ign) {}
} catch {}
})();
}));
if (this.wasAnimationEnabled) {
Expand Down Expand Up @@ -680,19 +680,19 @@ export class EspressoDriver extends AndroidDriver implements ExternalDriver<
// settings to the espresso server already
}

// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
proxyActive (sessionId) {
// we always have an active proxy to the espresso server
return true;
}

// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
canProxy (sessionId) {
// we can always proxy to the espresso server
return true;
}

// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getProxyAvoidList (sessionId): RouteMatcher[] {
// we are maintaining two sets of NO_PROXY lists, one for chromedriver(CHROME_NO_PROXY)
// and one for Espresso(NO_PROXY), based on current context will return related NO_PROXY list
Expand Down
4 changes: 2 additions & 2 deletions lib/espresso-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import B from 'bluebird';
import _ from 'lodash';
import { copyGradleProjectRecursively, getPackageInfoSync, getPackageInfo } from './utils';
import axios from 'axios';
import semver from 'semver';
import * as semver from 'semver';


const TEST_SERVER_ROOT = path.resolve(__dirname, '..', '..', 'espresso-server');
Expand Down Expand Up @@ -375,7 +375,7 @@ class EspressoRunner {
(serverStatus = /** @type {import('@appium/types').StringRecord} */ (
await this.jwproxy.command('/status', 'GET')
));
} catch (e) {
} catch {
return false;
}
return await this._verifyServerStatus(manifestPayload.version, serverStatus);
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function getPackageInfo () {
return PACKAGE_INFO;
}
}
} catch (ign) {}
} catch {}
currentDir = path.dirname(currentDir);
isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
}
Expand Down Expand Up @@ -128,7 +128,7 @@ export function getPackageInfoSync () {
return PACKAGE_INFO;
}
}
} catch (ign) {}
} catch {}
currentDir = path.dirname(currentDir);
isAtFsRoot = currentDir.length <= path.dirname(currentDir).length;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"appium": "^2.4.1"
},
"devDependencies": {
"@appium/eslint-config-appium-ts": "^0.x",
"@appium/eslint-config-appium-ts": "^1.0",
"@appium/tsconfig": "^0.x",
"@appium/types": "^0.x",
"@semantic-release/changelog": "^6.0.1",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-espresso.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function buildEspressoServer () {
opts.buildConfiguration = JSON.parse(buildConfigurationStr);
LOG.info(`The espresso build config is ${JSON.stringify(opts.buildConfiguration)}`);
} catch (e) {
throw new Error(`Failed to parse the ${process.env.ESPRESSO_BUILD_CONFIG}. `
throw new Error(`Failed to parse the ${process.env.ESPRESSO_BUILD_CONFIG}. ` +
`Please make sure that the JSON is valid format. Error: ${e}`);
}
}
Expand All @@ -41,7 +41,7 @@ async function buildEspressoServer () {
try {
await builder.build();
} catch (e) {
throw new Error(`Failed to build the espresso server. `
throw new Error(`Failed to build the espresso server. ` +
`SHOW_GRADLE_LOG=true environment variable helps to check the gradle log. Error: ${e}`);
}

Expand Down
2 changes: 1 addition & 1 deletion test/functional/commands/clipboard-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('clipboard', function () {
const text = await driver.getClipboard('PLAINTEXT');
try {
text.should.eql('SGVsbG8=');
} catch (AssertionError) {
} catch (AssertionError) { // eslint-disable-line @typescript-eslint/no-unused-vars
// API level 23 and 25 emulator has '\n'
text.should.eql('SGVsbG8=\n');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('compose node attributes', function () {
afterEach(async function () {
try {
await driver.deleteSession();
} catch (ign) {}
} catch {}
driver = null;
});

Expand Down
2 changes: 1 addition & 1 deletion test/functional/commands/keyboard-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('keyboard', function () {
await el.clear();
});

it('should send keys to the correct element', async function () {
it('should send keys to the correct element with setImmediateValue', async function () {
let el = await driver.elementByXPath('//android.widget.AutoCompleteTextView');
await el.setImmediateValue(['hello world']);
await el.text().should.eventually.equal('hello world');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/commands/touch-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ describe('touch actions -', function () {
});
});

describe('mjsonwp touch actions', function () {
describe('mjsonwp multi touch actions', function () {
describe('multi touch actions', function () {
// let nextEl;

Expand Down
6 changes: 3 additions & 3 deletions test/functional/driver-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('EspressoDriver', function () {
afterEach(async function () {
try {
await driver.deleteSession();
} catch (ign) {}
} catch {}
driver = null;
});

Expand Down Expand Up @@ -81,7 +81,7 @@ describe('EspressoDriver', function () {
afterEach(async function () {
try {
await driver.deleteSession();
} catch (ign) {}
} catch {}
driver = null;
});
it('should start activity by name', async function () {
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('EspressoDriver', function () {
// afterEach(async function () {
// try {
// await driver.deleteSession();
// } catch (ign) {}
// } catch {}
// driver = null;
// });
// it('should send keys to focused-on element', async function () {
Expand Down
4 changes: 2 additions & 2 deletions test/functional/helpers/session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import remote from 'webdriverio';
import { remote } from 'webdriverio';
import AsyncLock from 'async-lock';

const SESSION_GUARD = new AsyncLock();
Expand All @@ -23,7 +23,7 @@ async function deleteSession () {
await SESSION_GUARD.acquire(HOST, async () => {
try {
await driver.quit();
} catch (ign) {}
} catch {}
driver = null;
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/commands/execute-specs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sinon from 'sinon';
import EspressoDriver from '../../../lib/driver';
import { EspressoDriver } from '../../../lib/driver';

let sandbox = sinon.createSandbox();

Expand Down
2 changes: 1 addition & 1 deletion test/unit/driver-specs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sinon from 'sinon';
import { ADB } from 'appium-adb';
import EspressoDriver from '../../lib/driver';
import { EspressoDriver } from '../../lib/driver';


let sandbox = sinon.createSandbox();
Expand Down

0 comments on commit 7873f54

Please sign in to comment.