diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index fb7020d..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -coverage -build diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 950cea2..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": ["@appium/eslint-config-appium-ts"], - "overrides": [ - { - "files": "test/**/*.js", - "rules": { - "func-names": "off", - "@typescript-eslint/no-var-requires": "off" - } - }, - { - "files": "scripts/**/*", - "parserOptions": {"sourceType": "script"}, - "rules": { - "@typescript-eslint/no-var-requires": "off" - } - } - ], - "rules": { - "require-await": "error" - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..4d52325 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,5 @@ +import appiumConfig from '@appium/eslint-config-appium-ts'; + +export default [ + ...appiumConfig, +]; diff --git a/lib/helpers.js b/lib/helpers.js index 133552c..2618805 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -39,7 +39,7 @@ export async function findAppPaths (bundleId) { ({stdout} = await exec('/usr/bin/mdfind', [ `kMDItemCFBundleIdentifier=${bundleId}` ])); - } catch (e) { + } catch { return []; } diff --git a/lib/xcode.js b/lib/xcode.js index eb11932..6b815de 100644 --- a/lib/xcode.js +++ b/lib/xcode.js @@ -3,7 +3,7 @@ import path from 'path'; import { retry } from 'asyncbox'; import _ from 'lodash'; import { exec } from 'teen_process'; -import semver from 'semver'; +import * as semver from 'semver'; import { runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist } from './helpers'; @@ -176,7 +176,7 @@ async function getVersion (parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, t async function getClangVersion () { try { await fs.which('clang'); - } catch (e) { + } catch { log.info('Cannot find clang executable on the local system. ' + 'Are Xcode Command Line Tools installed?'); return null; diff --git a/package.json b/package.json index 22b20ad..6074f4c 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "singleQuote": true }, "devDependencies": { - "@appium/eslint-config-appium-ts": "^0.x", + "@appium/eslint-config-appium-ts": "^1.x", "@appium/tsconfig": "^0.x", "@appium/types": "^0.x", "@semantic-release/changelog": "^6.0.1", diff --git a/test/unit/index-specs.js b/test/unit/index-specs.js index 7defd69..8046c03 100644 --- a/test/unit/index-specs.js +++ b/test/unit/index-specs.js @@ -2,12 +2,10 @@ import xcode from '../../lib/index'; describe('index', function () { let chai; - let should; before(async function() { chai = await import('chai'); - - should = chai.should(); + chai.should(); });