Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Jan 5, 2025
1 parent cb2cbc0 commit 55eb78d
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 30 deletions.
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

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

export default [
...appiumConfig,
];
8 changes: 4 additions & 4 deletions lib/chromedriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
getChromedriverBinaryPath,
generateLogPrefix,
} from './utils';
import semver from 'semver';
import * as semver from 'semver';
import _ from 'lodash';
import path from 'path';
import {compareVersions} from 'compare-versions';
import ChromedriverStorageClient from './storage-client/storage-client';
import { ChromedriverStorageClient } from './storage-client/storage-client';
import {toW3cCapNames, getCapValue} from './protocol-helpers';

const NEW_CD_VERSION_FORMAT_MAJOR_VERSION = 73;
Expand Down Expand Up @@ -839,7 +839,7 @@ export class Chromedriver extends events.EventEmitter {
try {
await B.promisify(cp.exec)(cmd);
this.log.debug('Successfully cleaned up old chromedrivers');
} catch (err) {
} catch {
this.log.warn('No old chromedrivers seem to exist');
}

Expand Down Expand Up @@ -878,7 +878,7 @@ export class Chromedriver extends events.EventEmitter {
try {
await this.jwproxy.command('/url', 'GET');
return true;
} catch (e) {
} catch {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/storage-client/chromelabs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import path from 'path';
import {logger} from '@appium/support';
import semver from 'semver';
import * as semver from 'semver';
import {ARCH, CPU} from '../constants';

const log = logger.getLogger('ChromedriverChromelabsStorageClient');
Expand Down
4 changes: 2 additions & 2 deletions lib/storage-client/googleapis.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import xpath from 'xpath';
import {select as xpathSelect} from 'xpath';
import {util, logger} from '@appium/support';
import {retrieveData} from '../utils';
import B from 'bluebird';
Expand Down Expand Up @@ -99,7 +99,7 @@ export async function parseGoogleapiStorageXml(xml, shouldParseNotes = true) {
const driverNodes = /** @type {Array<Node|Attr>} */ (
// @ts-expect-error Misssing Node properties are not needed.
// https://github.com/xmldom/xmldom/issues/724
xpath.select(`//*[local-name(.)='Contents']`, doc)
xpathSelect(`//*[local-name(.)='Contents']`, doc)
);
log.debug(`Parsed ${driverNodes.length} entries from storage XML`);
if (_.isEmpty(driverNodes)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/storage-client/storage-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import {parseGoogleapiStorageXml} from './googleapis';
import {parseKnownGoodVersionsWithDownloadsJson, parseLatestKnownGoodVersionsJson} from './chromelabs';
import {compareVersions} from 'compare-versions';
import semver from 'semver';
import * as semver from 'semver';

const MAX_PARALLEL_DOWNLOADS = 5;
const STORAGE_INFOS = /** @type {readonly StorageInfo[]} */ ([{
Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type ADB from 'appium-adb';
import type { ADB } from 'appium-adb';

export interface ChromedriverOpts {
host?: string;
Expand Down
1 change: 0 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const getOsInfo = _.memoize(
}
);

// @ts-expect-error
// error TS2345: Argument of type '{}' is not assignable to parameter of type 'DriverOpts<Readonly<Record<string, Constraint>>>'
// Type '{}' is missing the following properties from type 'ServerArgs': address, allowCors, allowInsecure, basePath, and 26 more.
const getBaseDriverInstance = _.memoize(() => new BaseDriver({}, false));

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / test

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / windows_test

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / test (20)

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / test (22)

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / test (20)

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.

Check failure on line 138 in lib/utils.js

View workflow job for this annotation

GitHub Actions / test (22)

Argument of type '{}' is not assignable to parameter of type '{ address: string; allowCors: NonNullable<boolean | undefined>; allowInsecure: AllowInsecureConfig; basePath: string; callbackAddress: string | undefined; ... 32 more ...; skipUninstall?: boolean | undefined; }'.
Expand Down
3 changes: 1 addition & 2 deletions test/functional/chromedriver-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function nextState(cd) {
function nextError(cd) {
return new B((resolve) => {
cd.on(Chromedriver.EVENT_ERROR, (err) => {
// eslint-disable-line promise/prefer-await-to-callbacks
resolve(err);
});
});
Expand Down Expand Up @@ -48,7 +47,7 @@ function buildReqRes(url, method, body) {
send: (body) => {
try {
body = JSON.parse(body);
} catch (e) {}
} catch {}
res.sentBody = body;
},
};
Expand Down
2 changes: 1 addition & 1 deletion test/functional/storage-client-e2e-specs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChromedriverStorageClient from '../../lib/storage-client/storage-client';
import { ChromedriverStorageClient } from '../../lib/storage-client/storage-client';
import _ from 'lodash';
import { fs, tempDir } from '@appium/support';

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fs, mkdirp } from '@appium/support';
import ChromedriverStorageClient from '../../lib/storage-client/storage-client';
import { ChromedriverStorageClient } from '../../lib/storage-client/storage-client';
import {
CD_VER, getOsInfo, getChromedriverDir,
} from '../../lib/utils';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/storage-client-specs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChromedriverStorageClient from '../../lib/storage-client/storage-client';
import { ChromedriverStorageClient } from '../../lib/storage-client/storage-client';
import _ from 'lodash';

describe('ChromedriverStorageClient', function () {
Expand Down

0 comments on commit 55eb78d

Please sign in to comment.