From 2b22b168e00430d63ecf1f9d6bf2a63a840e388e Mon Sep 17 00:00:00 2001 From: Katy Bowman Date: Wed, 26 Apr 2023 15:24:56 -0400 Subject: [PATCH] chore: eslint standardization clean-up (#2325) * chore: turn on linting for several packages * chore: turn on linting and fix erros for certs-v5 * chore: turn on linting and fix errors for orgs-v5 * chore: yarn.lock updates * chore: eslint clean up in certs-v5 * chore: eslint clean up in ci-v5 * chore: eslint clean up in container-registry-v5 * chore: eslint clean up in oauth-v5 * chore: eslint clean up in orgs-v5 * chore: addons-v5 eslint cleanup * chore: apps eslint cleanup * chore: buildpacks eslint cleanup * chore: certs and certs-v5 eslint cleanup * chore: ci eslint cleanup * chore: ci-v5 eslint cleanup * chore: cli eslint cleanup * chore: config eslint cleanup * chore: git and local eslint cleanup * chore: pipelines eslint cleanup * chore: ps run and status eslint cleanup --- .eslintrc | 19 +++ packages/addons-v5/commands/addons/attach.js | 1 - packages/addons-v5/commands/addons/destroy.js | 4 +- packages/addons-v5/commands/addons/detach.js | 2 +- packages/addons-v5/commands/addons/index.js | 2 +- packages/addons-v5/commands/addons/info.js | 2 +- packages/addons-v5/commands/addons/rename.js | 2 +- packages/addons-v5/commands/addons/upgrade.js | 3 +- packages/addons-v5/commands/addons/wait.js | 4 +- packages/addons-v5/lib/addons_wait.js | 3 - packages/addons-v5/lib/create_addon.js | 1 - packages/addons-v5/lib/resolve.js | 3 - packages/addons-v5/lib/util.js | 1 - packages/addons-v5/package.json | 1 + .../addons-v5/test/commands/addons/docs.js | 1 - packages/addons-v5/test/lib/util.js | 1 - packages/addons-v5/test/opn.js | 1 - packages/apps/src/commands/domains/clear.ts | 1 - packages/apps/src/commands/domains/wait.ts | 1 - packages/apps/src/lib/wait-for-domain.ts | 3 +- packages/buildpacks/src/buildpacks.ts | 1 - .../src/commands/buildpacks/info.ts | 1 - .../src/commands/buildpacks/search.ts | 2 - .../src/commands/buildpacks/versions.ts | 1 - .../certs-v5/commands/certs/auto/index.js | 1 - packages/certs-v5/commands/certs/chain.js | 1 - packages/certs-v5/commands/certs/generate.js | 5 - packages/certs-v5/commands/certs/key.js | 1 - packages/certs-v5/commands/certs/remove.js | 1 - packages/certs-v5/lib/display_table.js | 2 - packages/certs-v5/lib/display_warnings.js | 1 - packages/certs-v5/lib/domains.js | 5 - packages/certs-v5/lib/error.js | 1 - packages/certs-v5/lib/find_match.js | 1 - packages/certs-v5/lib/format_endpoint.js | 1 + packages/certs-v5/lib/get_cert_and_key.js | 2 - packages/certs-v5/lib/is_wildcard.js | 1 - packages/certs-v5/lib/is_wildcard_match.js | 1 - packages/certs-v5/lib/match_domains.js | 4 +- packages/certs-v5/lib/openssl.js | 1 - packages/certs-v5/lib/read_file.js | 1 - packages/certs-v5/package.json | 1 + packages/certs-v5/test/commands/certs/add.js | 19 --- .../test/commands/certs/auto/disable.js | 3 +- .../test/commands/certs/auto/enable.js | 4 +- .../test/commands/certs/auto/index.js | 4 +- .../test/commands/certs/auto/refresh.js | 3 +- .../certs-v5/test/commands/certs/chain.js | 5 +- .../certs-v5/test/commands/certs/index.js | 8 +- packages/certs-v5/test/commands/certs/info.js | 19 ++- packages/certs-v5/test/commands/certs/key.js | 5 +- .../certs-v5/test/commands/certs/remove.js | 3 +- .../test/commands/certs/shared_sni.js | 3 +- .../certs-v5/test/commands/certs/update.js | 3 +- packages/certs/test/commands/hello.test.ts | 1 - packages/ci-v5/commands/ci/config-index.js | 1 - packages/ci-v5/commands/ci/config-set.js | 2 - packages/ci-v5/commands/ci/config-unset.js | 1 - packages/ci-v5/commands/ci/debug.js | 5 - .../ci-v5/commands/ci/migrate-manifest.js | 1 - packages/ci-v5/lib/heroku-api.js | 1 - packages/ci-v5/lib/key-by.js | 2 - packages/ci-v5/lib/source.js | 1 - packages/ci-v5/lib/test-run.js | 2 - packages/ci-v5/package.json | 1 + packages/ci-v5/test/lib/utils-test.js | 1 - packages/ci/src/utils/test-run.ts | 1 - packages/ci/test/commands/ci/info.test.ts | 1 - packages/ci/test/commands/ci/last.test.ts | 1 - packages/ci/test/commands/ci/rerun.test.ts | 1 - packages/ci/test/commands/ci/run.test.ts | 2 - packages/cli/src/file.ts | 2 +- .../cli/src/hooks/update/plugin-migrate.ts | 2 - packages/config/src/commands/config/edit.ts | 1 - .../config/test/commands/config/edit.test.ts | 2 - .../container-registry-v5/commands/index.js | 1 - .../container-registry-v5/commands/pull.js | 1 - .../container-registry-v5/commands/push.js | 3 - .../container-registry-v5/commands/release.js | 1 - packages/container-registry-v5/commands/rm.js | 1 - .../container-registry-v5/lib/sanbashi.js | 4 - packages/container-registry-v5/package.json | 1 + .../test/commands/login.js | 3 +- .../test/commands/logout.js | 3 +- .../test/commands/pull.js | 3 +- .../test/commands/push.js | 3 +- .../test/commands/release.js | 3 +- .../container-registry-v5/test/commands/rm.js | 3 +- .../test/commands/run.js | 3 +- packages/git/src/git.ts | 1 - packages/local/src/fork-foreman.ts | 1 - packages/oauth-v5/lib/clients.js | 1 - .../oauth-v5/lib/commands/sessions/destroy.js | 1 - packages/oauth-v5/package.json | 2 + packages/oauth-v5/test/clients.js | 2 - packages/oauth-v5/test/clients/create.js | 2 - packages/oauth-v5/test/clients/destroy.js | 3 +- packages/oauth-v5/test/clients/index.js | 3 +- packages/oauth-v5/test/clients/info.js | 3 +- packages/oauth-v5/test/clients/rotate.js | 3 +- packages/oauth-v5/test/clients/update.js | 3 +- packages/orgs-v5/commands/access/add.js | 2 - packages/orgs-v5/commands/access/index.js | 1 - packages/orgs-v5/commands/access/remove.js | 1 - packages/orgs-v5/commands/apps/transfer.js | 2 - packages/orgs-v5/commands/members/add.js | 1 - packages/orgs-v5/commands/members/index.js | 1 - packages/orgs-v5/commands/members/remove.js | 2 - packages/orgs-v5/lib/error.js | 1 - packages/orgs-v5/lib/utils.js | 1 - packages/orgs-v5/package.json | 5 +- .../orgs-v5/test/commands/access/remove.js | 6 +- packages/orgs-v5/test/commands/apps/leave.js | 14 +- packages/orgs-v5/test/commands/orgs/open.js | 10 +- packages/orgs-v5/test/stub/delete.js | 4 +- packages/pipelines/src/api.ts | 1 - .../pipelines/src/commands/pipelines/diff.ts | 5 +- .../src/commands/pipelines/promote.ts | 6 - packages/pipelines/src/key-by.ts | 1 - packages/pipelines/src/setup/create-apps.ts | 1 - .../pipelines/src/setup/poll-app-setups.ts | 1 - packages/ps/src/commands/ps/wait.ts | 2 - packages/ps/test/commands/wait.test.ts | 2 - packages/run/src/lib/dyno.ts | 1 - packages/run/src/lib/log-displayer.ts | 1 - packages/status/src/commands/status.ts | 1 - yarn.lock | 135 ++++++++++++++++++ 127 files changed, 230 insertions(+), 239 deletions(-) diff --git a/.eslintrc b/.eslintrc index 52f3e4bf14..674d43e291 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,22 +7,41 @@ ], "rules": { "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-unused-vars": "warn", // TODO: fix issues and turn this back on "camelcase":"off", "import/no-unresolved": "error", + "func-names":"warn", // TODO: fix issues and turn this back on + "no-await-in-loop": "warn", // TODO: fix issues and turn this back on "no-constant-condition": ["error", {"checkLoops": false }], + "no-else-return": "warn", // TODO: fix issues and turn this back on + "no-negated-condition":"warn", // TODO: fix issues and turn this back on + "no-process-exit": "off", + "no-promise-executor-return": "warn", // TODO: fix issues and turn this back on + "no-prototype-builtins": "warn", // TODO: fix issues and turn this back on + "no-return-await":"warn", // TODO: fix issues and turn this back on + "node/no-deprecated-api": "warn", // TODO: fix issues and turn this back on "node/no-missing-import": "off", // using import/no-unresolved instead + "radix":"warn", // TODO: fix issues and turn this back on + "wrap-iife": "warn", // TODO: fix issues and turn this back on "unicorn/better-regex": "off", // TODO: fix issues and turn this back on "unicorn/consistent-function-scoping": "off", // TODO: fix issues and turn this back on "unicorn/filename-case": "off", "unicorn/import-style": "off", "unicorn/no-abusive-eslint-disable": "off", "unicorn/no-array-for-each": "off", + "unicorn/no-array-reduce": "warn", // TODO: fix issues and turn this back on "unicorn/no-lonely-if":"off", + "unicorn/no-process-exit": "off", + "unicorn/no-useless-undefined": "warn", // TODO: fix issues and turn this back on "unicorn/numeric-separators-style":"off", + "unicorn/prefer-array-some": "warn", // TODO: fix issues and turn this back on "unicorn/prefer-module": "off", "unicorn/prefer-node-protocol": "off", + "unicorn/prefer-object-from-entries": "warn", // TODO: fix issues and turn this back on "unicorn/prefer-regexp-test": "off", "unicorn/prefer-spread": "off", // TODO: fix issues and turn this back on + "unicorn/prefer-string-slice": "warn", // TODO: fix issues and turn this back on "unicorn/prefer-ternary": "off" // TODO: fix issues and turn this back on }, diff --git a/packages/addons-v5/commands/addons/attach.js b/packages/addons-v5/commands/addons/attach.js index 645b985fef..7c30740071 100644 --- a/packages/addons-v5/commands/addons/attach.js +++ b/packages/addons-v5/commands/addons/attach.js @@ -41,7 +41,6 @@ async function run(context, heroku) { await cli.action( `Setting ${cli.color.attachment(attachment.name)} config vars and restarting ${cli.color.app(app)}`, {success: false}, - // eslint-disable-next-line wrap-iife async function () { let releases = await heroku.get(`/apps/${app}/releases`, { partial: true, diff --git a/packages/addons-v5/commands/addons/destroy.js b/packages/addons-v5/commands/addons/destroy.js index 58fbfc6ae6..2f97fab32e 100644 --- a/packages/addons-v5/commands/addons/destroy.js +++ b/packages/addons-v5/commands/addons/destroy.js @@ -21,10 +21,10 @@ async function run(context, heroku) { for (let app of toPairs(groupBy(addons, 'app.name'))) { addons = app[1] app = app[0] - await cli.confirmApp(app, context.flags.confirm) // eslint-disable-line no-await-in-loop + await cli.confirmApp(app, context.flags.confirm) for (let addon of addons) { let msg = `Destroying ${cli.color.addon(addon.name)} on ${cli.color.app(addon.app.name)}` - await cli.action(msg, heroku.request({ // eslint-disable-line no-await-in-loop + await cli.action(msg, heroku.request({ method: 'DELETE', path: `/apps/${addon.app.id}/addons/${addon.id}`, headers: {'Accept-Expansion': 'plan'}, diff --git a/packages/addons-v5/commands/addons/detach.js b/packages/addons-v5/commands/addons/detach.js index 86333dc2ff..0e226b95ad 100644 --- a/packages/addons-v5/commands/addons/detach.js +++ b/packages/addons-v5/commands/addons/detach.js @@ -17,7 +17,7 @@ async function run(context, heroku) { await cli.action( `Unsetting ${cli.color.attachment(attachment.name)} config vars and restarting ${cli.color.app(app)}`, {success: false}, - async function () { // eslint-disable-line wrap-iife + async function () { let releases = await heroku.request({ path: `/apps/${app}/releases`, partial: true, diff --git a/packages/addons-v5/commands/addons/index.js b/packages/addons-v5/commands/addons/index.js index e24890531e..5fedd5795f 100644 --- a/packages/addons-v5/commands/addons/index.js +++ b/packages/addons-v5/commands/addons/index.js @@ -224,7 +224,7 @@ async function run(ctx, api) { format: function (addon) { if (addon.app.name === app) { return formatPrice(addon.plan.price) - } else { // eslint-disable-line no-else-return + } else { return style('dim', printf('(billed to %s app)', style('app', addon.app.name))) } }, diff --git a/packages/addons-v5/commands/addons/info.js b/packages/addons-v5/commands/addons/info.js index f8650e39fc..840bd95c44 100644 --- a/packages/addons-v5/commands/addons/info.js +++ b/packages/addons-v5/commands/addons/info.js @@ -9,7 +9,7 @@ let style = require('../../lib/util').style let run = cli.command({preauth: true}, function (ctx, api) { const resolve = require('../../lib/resolve') - return async function () { // eslint-disable-line wrap-iife + return async function () { let addon = await resolve.addon(api, ctx.app, ctx.args.addon) let attachments = await api.request({ method: 'GET', diff --git a/packages/addons-v5/commands/addons/rename.js b/packages/addons-v5/commands/addons/rename.js index d6de0c0869..a45a4b10af 100644 --- a/packages/addons-v5/commands/addons/rename.js +++ b/packages/addons-v5/commands/addons/rename.js @@ -3,7 +3,7 @@ let cli = require('heroku-cli-util') let run = cli.command({preauth: true}, function (ctx, api) { - return async function () { // eslint-disable-line wrap-iife + return async function () { let addon = await api.get(`/addons/${ctx.args.addon}`) let addonUrl = `/apps/${addon.app.id}/addons/${addon.id}` diff --git a/packages/addons-v5/commands/addons/upgrade.js b/packages/addons-v5/commands/addons/upgrade.js index 3217eddc68..0dfed3a171 100644 --- a/packages/addons-v5/commands/addons/upgrade.js +++ b/packages/addons-v5/commands/addons/upgrade.js @@ -50,7 +50,7 @@ It is not clear which add-on's plan you are trying to change. Specify the add-on name instead of the name of the add-on service. For example, instead of: ${cli.color.blue('heroku addons:upgrade ' + context.args.addon + ' ' + (context.args.plan || ''))} Run this: ${cli.color.blue('heroku addons:upgrade ' + example + ' ' + name + ':' + plan)} -${// eslint-disable-next-line no-negated-condition +${ !app ? 'Alternatively, specify an app to filter by with ' + cli.color.blue('--app') : '' } ${cli.color.cyan('https://devcenter.heroku.com/articles/managing-add-ons')}`) @@ -86,7 +86,6 @@ async function run(c, h) { service = addon.addon_service.name app = addon.app.name plan = `${service}:${plan}` - // eslint-disable-next-line wrap-iife await cli.action(`Changing ${cli.color.magenta(addon.name)} on ${cli.color.cyan(app)} from ${cli.color.blue(addon.plan.name)} to ${cli.color.blue(plan)}`, {success: false}, async function () { addon = await heroku.request({ path: `/apps/${app}/addons/${addon.name}`, diff --git a/packages/addons-v5/commands/addons/wait.js b/packages/addons-v5/commands/addons/wait.js index 13c145b054..c8a31269ae 100644 --- a/packages/addons-v5/commands/addons/wait.js +++ b/packages/addons-v5/commands/addons/wait.js @@ -20,7 +20,7 @@ async function run(ctx, api) { addons = addons.filter(addon => addon.state === 'provisioning') - let interval = Number.parseInt(ctx.flags['wait-interval']) // eslint-disable-line radix + let interval = Number.parseInt(ctx.flags['wait-interval']) if (!interval || interval < 0) { interval = 5 } @@ -28,7 +28,7 @@ async function run(ctx, api) { for (let addon of addons) { const startTime = new Date() try { - addon = await waitForAddonProvisioning(api, addon, interval) // eslint-disable-line no-await-in-loop + addon = await waitForAddonProvisioning(api, addon, interval) } catch (error) { notify(`heroku addons:wait ${addon.name}`, 'Add-on failed to provision', false) throw error diff --git a/packages/addons-v5/lib/addons_wait.js b/packages/addons-v5/lib/addons_wait.js index a4ed1481d0..4e5a263c1a 100644 --- a/packages/addons-v5/lib/addons_wait.js +++ b/packages/addons-v5/lib/addons_wait.js @@ -6,13 +6,10 @@ module.exports = async function (api, addon, interval) { const app = addon.app.name const addonName = addon.name - // eslint-disable-next-line wrap-iife await cli.action(`Creating ${cli.color.addon(addon.name)}`, async function () { while (addon.state === 'provisioning') { - // eslint-disable-next-line no-await-in-loop, no-promise-executor-return await new Promise(resolve => setTimeout(resolve, interval * 1000)) - // eslint-disable-next-line no-await-in-loop addon = await api.request({ method: 'GET', path: `/apps/${app}/addons/${addonName}`, diff --git a/packages/addons-v5/lib/create_addon.js b/packages/addons-v5/lib/create_addon.js index a8955111a6..cb9a02792b 100644 --- a/packages/addons-v5/lib/create_addon.js +++ b/packages/addons-v5/lib/create_addon.js @@ -8,7 +8,6 @@ function formatConfigVarsMessage(addon) { if (configVars.length > 0) { configVars = configVars.map(c => cli.color.configVar(c)).join(', ') return `Created ${cli.color.addon(addon.name)} as ${configVars}` - // eslint-disable-next-line no-else-return } else { return `Created ${cli.color.addon(addon.name)}` } diff --git a/packages/addons-v5/lib/resolve.js b/packages/addons-v5/lib/resolve.js index 57b917cfc7..52659b6e9d 100644 --- a/packages/addons-v5/lib/resolve.js +++ b/packages/addons-v5/lib/resolve.js @@ -28,7 +28,6 @@ const appAddon = function (heroku, app, id, options = {}) { const handleNotFound = function (err, resource) { if (err.statusCode === 404 && err.body && err.body.resource === resource) { return true - // eslint-disable-next-line no-else-return } else { throw err } @@ -110,7 +109,6 @@ const singularize = function (type, namespace) { matches = matches.filter(m => m.namespace === namespace) } else if (matches.length > 1) { // In cases that aren't specific enough, filter by namespace - // eslint-disable-next-line no-prototype-builtins matches = matches.filter(m => !m.hasOwnProperty('namespace') || m.namespace === null) } @@ -170,7 +168,6 @@ exports.attachment = function (heroku, app, id, options = {}) { // If we were passed an add-on slug, there still could be an attachment // to the context app. Try to find and use it so `context_app` is set // correctly in the SSO payload. - // eslint-disable-next-line no-else-return else if (app) { return exports.addon(heroku, app, id, options) .then(addon => getAppAddonAttachment(addon, app)) diff --git a/packages/addons-v5/lib/util.js b/packages/addons-v5/lib/util.js index c243460b97..7367b18a35 100644 --- a/packages/addons-v5/lib/util.js +++ b/packages/addons-v5/lib/util.js @@ -42,7 +42,6 @@ module.exports = { }, trapConfirmationRequired: async function (app, confirm, fn) { - // eslint-disable-next-line no-return-await return await fn(confirm) .catch(error => { if (!error.body || error.body.id !== 'confirmation_required') throw error diff --git a/packages/addons-v5/package.json b/packages/addons-v5/package.json index e1239a58d0..7428a44910 100644 --- a/packages/addons-v5/package.json +++ b/packages/addons-v5/package.json @@ -49,6 +49,7 @@ "scripts": { "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "release": "np", "test": "nyc mocha", diff --git a/packages/addons-v5/test/commands/addons/docs.js b/packages/addons-v5/test/commands/addons/docs.js index 810e7c2e11..2b757b1b20 100644 --- a/packages/addons-v5/test/commands/addons/docs.js +++ b/packages/addons-v5/test/commands/addons/docs.js @@ -4,7 +4,6 @@ let cli = require('heroku-cli-util') let proxyquire = require('proxyquire') const sinon = require('sinon') -// eslint-disable-next-line @typescript-eslint/no-empty-function let openStub = sinon.stub(cli, 'open').callsFake(() => {}) let cmd = commands.find(c => c.topic === 'addons' && c.command === 'docs') let docs diff --git a/packages/addons-v5/test/lib/util.js b/packages/addons-v5/test/lib/util.js index 76571a8aac..006ed9e54d 100644 --- a/packages/addons-v5/test/lib/util.js +++ b/packages/addons-v5/test/lib/util.js @@ -21,7 +21,6 @@ describe('util.formatPrice', function () { }) it('returns undefined when no pricing information given', function () { - // eslint-disable-next-line unicorn/no-useless-undefined expect(util.formatPrice(null)).to.eq(undefined) }) }) diff --git a/packages/addons-v5/test/opn.js b/packages/addons-v5/test/opn.js index db452a44d5..0b318ca410 100644 --- a/packages/addons-v5/test/opn.js +++ b/packages/addons-v5/test/opn.js @@ -2,7 +2,6 @@ let opn = function (url) { opn.url = url - // eslint-disable-next-line no-promise-executor-return return new Promise(resolve => resolve()) } diff --git a/packages/apps/src/commands/domains/clear.ts b/packages/apps/src/commands/domains/clear.ts index c6f6fb5cfd..ef14773636 100644 --- a/packages/apps/src/commands/domains/clear.ts +++ b/packages/apps/src/commands/domains/clear.ts @@ -22,7 +22,6 @@ export default class DomainsClear extends Command { let {body: domains} = await this.heroku.get>(`/apps/${flags.app}/domains`) domains = domains.filter((d: Heroku.Domain) => d.kind === 'custom') for (const domain of domains) { - // eslint-disable-next-line no-await-in-loop await this.heroku.delete(`/apps/${flags.app}/domains/${domain.hostname}`) } diff --git a/packages/apps/src/commands/domains/wait.ts b/packages/apps/src/commands/domains/wait.ts index 7335b8c71d..6d3ad5b94a 100644 --- a/packages/apps/src/commands/domains/wait.ts +++ b/packages/apps/src/commands/domains/wait.ts @@ -27,7 +27,6 @@ export default class DomainsWait extends Command { } for (const domain of domains) { - // eslint-disable-next-line no-await-in-loop await waitForDomain(flags.app, this.heroku, domain) } } diff --git a/packages/apps/src/lib/wait-for-domain.ts b/packages/apps/src/lib/wait-for-domain.ts index de35dd2fa8..bc11e8789f 100644 --- a/packages/apps/src/lib/wait-for-domain.ts +++ b/packages/apps/src/lib/wait-for-domain.ts @@ -9,12 +9,11 @@ export default async function waitForDomain(app: string, heroku: APIClient, doma action.start(`Waiting for ${color.green(domain.hostname || 'domain')}`) while (domain.status === 'pending') { - // eslint-disable-next-line no-await-in-loop await CliUx.ux.wait(5000) - // eslint-disable-next-line no-await-in-loop const {body: updatedDomain} = await heroku.get(`/apps/${app}/domains/${domain.id}`) domain = updatedDomain } + action.stop() if (domain.status === 'succeeded' || domain.status === 'none') return throw new Error(`The domain creation finished with status ${domain.status}`) diff --git a/packages/buildpacks/src/buildpacks.ts b/packages/buildpacks/src/buildpacks.ts index 0d39deef3b..5e0adf18b9 100644 --- a/packages/buildpacks/src/buildpacks.ts +++ b/packages/buildpacks/src/buildpacks.ts @@ -56,7 +56,6 @@ export class BuildpackCommand { } Result.match({ - // eslint-disable-next-line @typescript-eslint/no-empty-function Ok: _ => {}, Err: err => { CliUx.ux.error(`Could not find the buildpack: ${buildpack}. ${err}`, {exit: 1}) diff --git a/packages/buildpacks/src/commands/buildpacks/info.ts b/packages/buildpacks/src/commands/buildpacks/info.ts index c2036ec75c..44dd1e2e4d 100644 --- a/packages/buildpacks/src/commands/buildpacks/info.ts +++ b/packages/buildpacks/src/commands/buildpacks/info.ts @@ -20,7 +20,6 @@ export default class Info extends Command { const registry = new BuildpackRegistry() Result.match({ - // eslint-disable-next-line @typescript-eslint/no-empty-function Ok: _ => {}, Err: err => { this.error(`Could not publish the buildpack.\n${err}`) diff --git a/packages/buildpacks/src/commands/buildpacks/search.ts b/packages/buildpacks/src/commands/buildpacks/search.ts index 5550e95032..bde7a9cd8b 100644 --- a/packages/buildpacks/src/commands/buildpacks/search.ts +++ b/packages/buildpacks/src/commands/buildpacks/search.ts @@ -26,9 +26,7 @@ export default class Search extends Command { if (args.term) { const uniqueBuildpacks = new Map() - // eslint-disable-next-line unicorn/no-useless-undefined const array = ((await registry.search(args.term, undefined, undefined)).unwrapOr([])) - // eslint-disable-next-line unicorn/no-useless-undefined .concat((await registry.search(undefined, args.term, undefined)).unwrapOr([])) .concat((await registry.search(undefined, undefined, args.term)).unwrapOr([])) array diff --git a/packages/buildpacks/src/commands/buildpacks/versions.ts b/packages/buildpacks/src/commands/buildpacks/versions.ts index 5b170a1b70..332eab06eb 100644 --- a/packages/buildpacks/src/commands/buildpacks/versions.ts +++ b/packages/buildpacks/src/commands/buildpacks/versions.ts @@ -25,7 +25,6 @@ export default class Versions extends Command { const registry = new BuildpackRegistry() Result.match({ - // eslint-disable-next-line @typescript-eslint/no-empty-function Ok: _ => {}, Err: err => { this.error(`Could not find the buildpack.\n${err}`) diff --git a/packages/certs-v5/commands/certs/auto/index.js b/packages/certs-v5/commands/certs/auto/index.js index c8ea0f217e..38f1b929d8 100644 --- a/packages/certs-v5/commands/certs/auto/index.js +++ b/packages/certs-v5/commands/certs/auto/index.js @@ -79,7 +79,6 @@ async function run(context, heroku) { {label: 'Domain', key: 'hostname'}, {label: 'Status', key: 'acm_status', format: humanize}, ] - // eslint-disable-next-line unicorn/prefer-array-some if (domains.find(d => d.acm_status_reason)) { columns.push({ label: 'Reason', diff --git a/packages/certs-v5/commands/certs/chain.js b/packages/certs-v5/commands/certs/chain.js index 02b87f9a86..246fa19a6a 100644 --- a/packages/certs-v5/commands/certs/chain.js +++ b/packages/certs-v5/commands/certs/chain.js @@ -5,7 +5,6 @@ let cli = require('heroku-cli-util') // let error = require('../../lib/error.js') // let readFile = require('../../lib/read_file.js') -// eslint-disable-next-line @typescript-eslint/no-unused-vars async function run(context) { // TODO: Fix chain command diff --git a/packages/certs-v5/commands/certs/generate.js b/packages/certs-v5/commands/certs/generate.js index b67f3d4c81..11b0aea8ae 100644 --- a/packages/certs-v5/commands/certs/generate.js +++ b/packages/certs-v5/commands/certs/generate.js @@ -1,4 +1,3 @@ -/* eslint-disable require-atomic-updates */ 'use strict' let cli = require('heroku-cli-util') @@ -9,7 +8,6 @@ let endpoints = require('../../lib/endpoints.js').all function valueEmpty(value) { if (value) { return value.length === 0 - // eslint-disable-next-line no-else-return } else { return true } @@ -51,7 +49,6 @@ function getSubject(context) { function requiresPrompt(context) { if (valueEmpty(context.flags.subject)) { - // eslint-disable-next-line unicorn/prevent-abbreviations let args = [context.flags.owner, context.flags.country, context.flags.area, context.flags.city] if (!context.flags.now && args.every(function (v) { return valueEmpty(v) @@ -64,14 +61,12 @@ function requiresPrompt(context) { } function getCommand(certs, domain) { - // eslint-disable-next-line unicorn/prefer-array-some if (certs.find(function (f) { return f.ssl_cert.cert_domains.find(function (d) { return d === domain }) })) { return 'update' - // eslint-disable-next-line no-else-return } else { return 'add' } diff --git a/packages/certs-v5/commands/certs/key.js b/packages/certs-v5/commands/certs/key.js index 7b4ed03c7a..6138f06c8f 100644 --- a/packages/certs-v5/commands/certs/key.js +++ b/packages/certs-v5/commands/certs/key.js @@ -5,7 +5,6 @@ let cli = require('heroku-cli-util') // let error = require('../../lib/error.js') // let readFile = require('../../lib/read_file.js') -// eslint-disable-next-line @typescript-eslint/no-unused-vars async function run(context) { // TODO: Fix key command diff --git a/packages/certs-v5/commands/certs/remove.js b/packages/certs-v5/commands/certs/remove.js index 7413e2330b..129de06098 100644 --- a/packages/certs-v5/commands/certs/remove.js +++ b/packages/certs-v5/commands/certs/remove.js @@ -12,7 +12,6 @@ async function run(context, heroku) { await cli.confirmApp(context.app, context.flags.confirm, `WARNING: Destructive Action - you cannot rollback this change\nThis command will remove the endpoint ${formattedEndpoint} from ${cli.color.app(context.app)}.`) - // eslint-disable-next-line @typescript-eslint/no-unused-vars let _ = await cli.action(`Removing SSL certificate ${formattedEndpoint} from ${cli.color.app(context.app)}`, {}, heroku.request({ path: endpoint._meta.path, method: 'DELETE', diff --git a/packages/certs-v5/lib/display_table.js b/packages/certs-v5/lib/display_table.js index 64fd963ea8..87c0da0641 100644 --- a/packages/certs-v5/lib/display_table.js +++ b/packages/certs-v5/lib/display_table.js @@ -7,7 +7,6 @@ let _ = require('lodash') function type(f) { if (f.ssl_cert && f.ssl_cert.acm) { return 'ACM' - // eslint-disable-next-line no-else-return } else { return 'SNI' } @@ -44,7 +43,6 @@ module.exports = function (certs) { columns.push({label: 'Display Name', key: 'display_name'}) } - // eslint-disable-next-line unicorn/prefer-array-some if (_.find(mapped, row => row.cname)) { columns = columns.concat([{label: 'Endpoint', key: 'cname', format: function (f) { return f || '(Not applicable for SNI)' diff --git a/packages/certs-v5/lib/display_warnings.js b/packages/certs-v5/lib/display_warnings.js index 0814c59dc0..0a8bf7d62b 100644 --- a/packages/certs-v5/lib/display_warnings.js +++ b/packages/certs-v5/lib/display_warnings.js @@ -6,7 +6,6 @@ module.exports = function (endpoint) { let warnings = endpoint.warnings if (warnings) { for (var field in warnings) { - // eslint-disable-next-line no-prototype-builtins if (warnings.hasOwnProperty(field) && endpoint.warnings[field].length > 0) { cli.warn(`WARNING: ${field} ${endpoint.warnings[field]}`) } diff --git a/packages/certs-v5/lib/domains.js b/packages/certs-v5/lib/domains.js index 5a76a93969..e003d0025e 100644 --- a/packages/certs-v5/lib/domains.js +++ b/packages/certs-v5/lib/domains.js @@ -4,7 +4,6 @@ let _ = require('lodash') let cli = require('heroku-cli-util') let psl = require('psl') -// eslint-disable-next-line no-promise-executor-return const wait = ms => new Promise(resolve => setTimeout(resolve, ms)) function type(domain) { @@ -31,9 +30,7 @@ async function waitForDomains(context, heroku) { throw new Error('Timed out while waiting for stable domains to be created') } - // eslint-disable-next-line no-await-in-loop await wait(1000) - // eslint-disable-next-line no-await-in-loop apiDomains = await apiRequest(context, heroku) index++ @@ -97,9 +94,7 @@ async function waitForCertIssuedOnDomains(context, heroku) { await cli.action('Waiting until the certificate is issued to all domains', (async function () { let retries = 0 while (!certIssuedOrFailedForAllCustomDomains(domains)) { - // eslint-disable-next-line no-await-in-loop await wait(backoff(retries)) - // eslint-disable-next-line no-await-in-loop domains = await apiRequest(context, heroku) retries++ } diff --git a/packages/certs-v5/lib/error.js b/packages/certs-v5/lib/error.js index 07f23aacd1..313207401e 100644 --- a/packages/certs-v5/lib/error.js +++ b/packages/certs-v5/lib/error.js @@ -23,7 +23,6 @@ function exit(code, message) { if (mocking) { throw new ErrorExit(code) } else { - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(code) } } diff --git a/packages/certs-v5/lib/find_match.js b/packages/certs-v5/lib/find_match.js index 490fffe218..8df1ef90fc 100644 --- a/packages/certs-v5/lib/find_match.js +++ b/packages/certs-v5/lib/find_match.js @@ -23,6 +23,5 @@ module.exports = function (certDomain, domains) { return wildcardMatch } - // eslint-disable-next-line unicorn/no-null return null } diff --git a/packages/certs-v5/lib/format_endpoint.js b/packages/certs-v5/lib/format_endpoint.js index 7d26b1bc93..6cfb64b7e2 100644 --- a/packages/certs-v5/lib/format_endpoint.js +++ b/packages/certs-v5/lib/format_endpoint.js @@ -5,5 +5,6 @@ module.exports = function (endpoint) { if (endpoint.cname) { display += ` (${endpoint.cname})` } + return display } diff --git a/packages/certs-v5/lib/get_cert_and_key.js b/packages/certs-v5/lib/get_cert_and_key.js index f0df088d9e..ae804f3c78 100644 --- a/packages/certs-v5/lib/get_cert_and_key.js +++ b/packages/certs-v5/lib/get_cert_and_key.js @@ -10,7 +10,6 @@ function usageError() { } async function getFiles(context) { - // eslint-disable-next-line no-return-await return await Promise.all( context.args.map(argument => readFile(argument, 'utf-8')), ) @@ -28,6 +27,5 @@ module.exports = async function (context) { cli.warn('use of the --bypass flag is deprecated. The flag currently does not perform any additional behavior. Please remove --bypass') } - // eslint-disable-next-line no-return-await return await getFilesBypass(context) } diff --git a/packages/certs-v5/lib/is_wildcard.js b/packages/certs-v5/lib/is_wildcard.js index 7926c0820c..9727cf7560 100644 --- a/packages/certs-v5/lib/is_wildcard.js +++ b/packages/certs-v5/lib/is_wildcard.js @@ -1,6 +1,5 @@ 'use strict' module.exports = function (hostname) { - // eslint-disable-next-line unicorn/prefer-string-slice return hostname.substring(0, 2) === '*.' } diff --git a/packages/certs-v5/lib/is_wildcard_match.js b/packages/certs-v5/lib/is_wildcard_match.js index 33d6026c54..4eb5b83af8 100644 --- a/packages/certs-v5/lib/is_wildcard_match.js +++ b/packages/certs-v5/lib/is_wildcard_match.js @@ -12,7 +12,6 @@ module.exports = function (wildcard, hostname) { return false } - // eslint-disable-next-line unicorn/prefer-string-slice let baseDomain = wildcard.substring(2) let regex = new RegExp(`^[a-zA-Z0-9_-]+\\.${escapeRegExp(baseDomain)}$`) return hostname.match(regex) diff --git a/packages/certs-v5/lib/match_domains.js b/packages/certs-v5/lib/match_domains.js index 5751a27f23..57d1070891 100644 --- a/packages/certs-v5/lib/match_domains.js +++ b/packages/certs-v5/lib/match_domains.js @@ -2,7 +2,6 @@ function splitDomains(domains) { return domains.map(domain => { - // eslint-disable-next-line unicorn/prefer-string-slice return [domain.substring(0, 1), domain.substring(1)] }) } @@ -35,7 +34,7 @@ module.exports = function (certDomains, appDomains) { const matchers = splitCertDomains.map(splitDomain => createMatcherFromSplitDomain(splitDomain)) if (includesWildcard(splitCertDomains)) { - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prevent-abbreviations + // eslint-disable-next-line unicorn/prevent-abbreviations const matchedDomains = appDomains.reduce((acc, appDomain) => { if (matchers.some(matcher => matcher.test(appDomain))) { acc.push(appDomain) @@ -45,7 +44,6 @@ module.exports = function (certDomains, appDomains) { }, []) return matchedDomains - // eslint-disable-next-line no-else-return } else { return certDomains.filter(domain => appDomains.includes(domain)) } diff --git a/packages/certs-v5/lib/openssl.js b/packages/certs-v5/lib/openssl.js index 8e0532675b..eeea5e415a 100644 --- a/packages/certs-v5/lib/openssl.js +++ b/packages/certs-v5/lib/openssl.js @@ -3,7 +3,6 @@ let childProcess = require('child_process') module.exports = { - // eslint-disable-next-line unicorn/prevent-abbreviations spawn: function (args) { return new Promise(function (resolve, reject) { let s = childProcess.spawn('openssl', args, {stdio: 'inherit'}) diff --git a/packages/certs-v5/lib/read_file.js b/packages/certs-v5/lib/read_file.js index 896ef05883..5eef1d8309 100644 --- a/packages/certs-v5/lib/read_file.js +++ b/packages/certs-v5/lib/read_file.js @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/prevent-abbreviations */ 'use strict' function promisfy(mod, fn) { diff --git a/packages/certs-v5/package.json b/packages/certs-v5/package.json index e23fa3dd92..2bca589937 100644 --- a/packages/certs-v5/package.json +++ b/packages/certs-v5/package.json @@ -52,6 +52,7 @@ "scripts": { "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "test": "nyc mocha", "version": "oclif readme && git add README.md" diff --git a/packages/certs-v5/test/commands/certs/add.js b/packages/certs-v5/test/commands/certs/add.js index 1477412191..950b1d8784 100644 --- a/packages/certs-v5/test/commands/certs/add.js +++ b/packages/certs-v5/test/commands/certs/add.js @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/no-null */ 'use strict' // eslint-disable-next-line no-redeclare /* globals describe it beforeEach afterEach cli */ @@ -36,7 +35,6 @@ function mockDomains(inquirer) { .get('/apps/example/domains') .reply(200, []) - // eslint-disable-next-line @typescript-eslint/no-unused-vars inquirer.prompt = prompts => { return Promise.resolve({domains: []}) } @@ -93,13 +91,11 @@ describe('heroku certs:add', function () { return certs.run({app: 'example', args: ['pem_file', 'key_file'], flags: {}}).then(function () { mockSni.done() expect(cli.stderr).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-irregular-whitespace */ expect(cli.stdout).to.equal( `example now served by tokyo-1050.herokussl.com Certificate details: ${certificateDetails} `) - /* eslint-enable no-irregular-whitespace */ }) }) @@ -155,7 +151,6 @@ ${certificateDetails} return certs.run({app: 'example', args: ['pem_file', 'key_file'], flags: {}}).then(function () { mock.done() expect(cli.stderr).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-irregular-whitespace */ expect(cli.stdout).to.equal( `example now served by tokyo-1050.herokussl.com Certificate details: @@ -187,7 +182,6 @@ ${certificateDetails} return certs.run({app: 'example', args: ['pem_file', 'key_file'], flags: {}}).then(function () { mockSni.done() expect(cli.stderr).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-irregular-whitespace */ expect(cli.stdout).to.equal( `example now served by tokyo-1050.herokussl.com Certificate details: @@ -241,7 +235,6 @@ ${certificateDetails} domainsMock.done() domainsCreate.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): foo.example.org @@ -290,8 +283,6 @@ SSL certificate is self signed. domainsMock.done() domainsMockPatch.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-irregular-whitespace */ - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): tokyo-1050.herokuapp.com @@ -322,7 +313,6 @@ SSL certificate is not trusted. // { 'kind': 'custom', 'hostname': 'biz.example.com', 'cname': 'biz.example.com.herokudns.com' } ]) - // eslint-disable-next-line @typescript-eslint/no-unused-vars inquirer.prompt = prompts => { expect.fail('inquirer.prompt() should not be called') } @@ -331,7 +321,6 @@ SSL certificate is not trusted. mock.done() domainsMock.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): foo.example.org @@ -358,7 +347,6 @@ SSL certificate is self signed. .get('/apps/example/domains') .reply(200, []) - // eslint-disable-next-line @typescript-eslint/no-unused-vars inquirer.prompt = prompts => { expect.fail('inquirer.prompt() should not be called') } @@ -367,8 +355,6 @@ SSL certificate is self signed. mock.done() domainsMock.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-trailing-spaces */ - /* eslint-disable no-irregular-whitespace */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): *.example.org @@ -414,8 +400,6 @@ SSL certificate is self signed. domainsMock.done() domainsMockPatch.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\n') - /* eslint-disable no-trailing-spaces */ - /* eslint-disable no-irregular-whitespace */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): *.example.org @@ -437,7 +421,6 @@ SSL certificate is self signed. beforeEach(function () { cli.mockConsole() clock = lolex.install() - // eslint-disable-next-line unicorn/prevent-abbreviations, @typescript-eslint/no-unused-vars clock.setTimeout = function (fn, timeout) { fn() } @@ -512,7 +495,6 @@ SSL certificate is self signed. domainsCreateBar.done() domainsCreateBiz.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\nWaiting for stable domains to be created... done\n') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): foo.example.org @@ -550,7 +532,6 @@ SSL certificate is self signed. mock.done() domainsMock.done() expect(unwrap(cli.stderr)).to.equal('Adding SSL certificate to example... done\nWaiting for stable domains to be created... !\n') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Certificate details: Common Name(s): foo.example.org diff --git a/packages/certs-v5/test/commands/certs/auto/disable.js b/packages/certs-v5/test/commands/certs/auto/disable.js index 4dec0c0a3a..a0ffd52482 100644 --- a/packages/certs-v5/test/commands/certs/auto/disable.js +++ b/packages/certs-v5/test/commands/certs/auto/disable.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let chai = require('chai') let chaiAsPromised = require('chai-as-promised') diff --git a/packages/certs-v5/test/commands/certs/auto/enable.js b/packages/certs-v5/test/commands/certs/auto/enable.js index 58b5e16365..3701ef0559 100644 --- a/packages/certs-v5/test/commands/certs/auto/enable.js +++ b/packages/certs-v5/test/commands/certs/auto/enable.js @@ -1,7 +1,6 @@ /* eslint-env mocha */ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals cli */ let expect = require('chai').expect let nock = require('nock') @@ -114,7 +113,6 @@ foo.example.org CNAME foo.example.org.herokudns.com nock.cleanAll() sandbox = sinon.sandbox.create() clock = lolex.install() - // eslint-disable-next-line @typescript-eslint/no-unused-vars clock.setTimeout = function (fn, timeout) { fn() } diff --git a/packages/certs-v5/test/commands/certs/auto/index.js b/packages/certs-v5/test/commands/certs/auto/index.js index faddf0af3c..452b8d62e8 100644 --- a/packages/certs-v5/test/commands/certs/auto/index.js +++ b/packages/certs-v5/test/commands/certs/auto/index.js @@ -1,7 +1,6 @@ /* eslint-env mocha */ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals cli */ let expect = require('chai').expect let nock = require('nock') @@ -445,7 +444,6 @@ heroku-failed.heroku-cli-sni-test.com Failed uh oh something failed less than beforeEach(() => { sandbox = sinon.sandbox.create() clock = lolex.install() - // eslint-disable-next-line @typescript-eslint/no-unused-vars clock.setTimeout = function (fn, timeout) { fn() } diff --git a/packages/certs-v5/test/commands/certs/auto/refresh.js b/packages/certs-v5/test/commands/certs/auto/refresh.js index be0da7b5f0..8b8b3f8cd4 100644 --- a/packages/certs-v5/test/commands/certs/auto/refresh.js +++ b/packages/certs-v5/test/commands/certs/auto/refresh.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect let nock = require('nock') diff --git a/packages/certs-v5/test/commands/certs/chain.js b/packages/certs-v5/test/commands/certs/chain.js index 4dc3650e58..cad4db27f3 100644 --- a/packages/certs-v5/test/commands/certs/chain.js +++ b/packages/certs-v5/test/commands/certs/chain.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect // let nock = require('nock') @@ -30,7 +29,7 @@ describe('heroku certs:chain', function () { // }) it('# checks command does nothing', function () { - return certs.run({ app: 'example', args: [] }).then(function () { + return certs.run({app: 'example', args: []}).then(function () { expect(cli.stdout).to.equal('') expect(cli.stderr).to.equal('') }) diff --git a/packages/certs-v5/test/commands/certs/index.js b/packages/certs-v5/test/commands/certs/index.js index dec920d3f4..3fe5063030 100644 --- a/packages/certs-v5/test/commands/certs/index.js +++ b/packages/certs-v5/test/commands/certs/index.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect let nock = require('nock') @@ -36,7 +35,6 @@ describe('heroku certs', function () { return certs.run({app: 'example'}).then(function () { mockSni.done() expect(cli.stderr).to.equal('') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Name Common Name(s) Expires Trusted Type ────────── ────────────── ──────────────────── ─────── ──── @@ -54,7 +52,6 @@ tokyo-1050 heroku.com 2013-08-01 21:34 UTC True ACM return certs.run({app: 'example'}).then(function () { mockSni.done() expect(cli.stderr).to.equal('') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Name Common Name(s) Expires Trusted Type Domains ────────── ───────────────────────────────────────────────── ──────────────────── ─────── ──── ─────── @@ -74,7 +71,6 @@ tokyo-1050 foo.example.org, bar.example.org, biz.example.com 2013-08-01 21:34 return certs.run({app: 'example'}).then(function () { mockSni.done() expect(cli.stderr).to.equal('') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Name Common Name(s) Expires Trusted Type Domains ────────── ────────────── ──────────────────── ─────── ──── ─────── @@ -94,7 +90,6 @@ tokyo-1050 fooexample.org 2013-08-01 21:34 UTC False SNI 0 return certs.run({app: 'example'}).then(function () { mockSni.done() expect(cli.stderr).to.equal('') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Name Common Name(s) Expires Trusted Type Domains ────────── ────────────── ──────────────────── ─────── ──── ─────── @@ -112,7 +107,6 @@ tokyo-1050 *.example.org 2013-08-01 21:34 UTC False SNI 0 return certs.run({app: 'example'}).then(function () { mockSni.done() expect(cli.stderr).to.equal('') - /* eslint-disable no-trailing-spaces */ expect(cli.stdout).to.equal( `Name Common Name(s) Expires Trusted Type Domains ────────── ───────────────────────────────────────────────── ──────────────────── ─────── ──── ─────── diff --git a/packages/certs-v5/test/commands/certs/info.js b/packages/certs-v5/test/commands/certs/info.js index a8a4e74657..694835f2c5 100644 --- a/packages/certs-v5/test/commands/certs/info.js +++ b/packages/certs-v5/test/commands/certs/info.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let certs = require('../../../commands/certs/info.js') let nock = require('nock') @@ -41,20 +40,20 @@ ${certificateDetails} it('returns domains when show-domains flag is passed', function () { let mockSni = nock('https://api.heroku.com') - .get('/apps/example/sni-endpoints') - .reply(200, [endpointWithDomains]) + .get('/apps/example/sni-endpoints') + .reply(200, [endpointWithDomains]) let mock = nock('https://api.heroku.com', { - reqheaders: { 'Accept': 'application/vnd.heroku+json; version=3' } + reqheaders: {Accept: 'application/vnd.heroku+json; version=3'}, }) - .get('/apps/example/sni-endpoints/tokyo-1050') - .reply(200, endpointWithDomains) + .get('/apps/example/sni-endpoints/tokyo-1050') + .reply(200, endpointWithDomains) let mockDomains = nock('https://api.heroku.com') - .get('/apps/example/domains/example.heroku.com') - .reply(200, [endpointWithDomains]) + .get('/apps/example/domains/example.heroku.com') + .reply(200, [endpointWithDomains]) - return certs.run({ app: 'example', args: {}, flags: { 'show-domains': true } }).then(function () { + return certs.run({app: 'example', args: {}, flags: {'show-domains': true}}).then(function () { mockSni.done() mock.done() mockDomains.done() diff --git a/packages/certs-v5/test/commands/certs/key.js b/packages/certs-v5/test/commands/certs/key.js index 519b3efc07..f10a731ded 100644 --- a/packages/certs-v5/test/commands/certs/key.js +++ b/packages/certs-v5/test/commands/certs/key.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect // let nock = require('nock') @@ -30,7 +29,7 @@ describe('heroku certs:key', function () { // }) it('# checks command does nothing', function () { - return certs.run({ app: 'example', args: [] }).then(function () { + return certs.run({app: 'example', args: []}).then(function () { expect(cli.stdout).to.equal('') expect(cli.stderr).to.equal('') }) diff --git a/packages/certs-v5/test/commands/certs/remove.js b/packages/certs-v5/test/commands/certs/remove.js index 5dbee6a5e4..e1becf1791 100644 --- a/packages/certs-v5/test/commands/certs/remove.js +++ b/packages/certs-v5/test/commands/certs/remove.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect let nock = require('nock') diff --git a/packages/certs-v5/test/commands/certs/shared_sni.js b/packages/certs-v5/test/commands/certs/shared_sni.js index 3ef19e1e84..f5cd83faa7 100644 --- a/packages/certs-v5/test/commands/certs/shared_sni.js +++ b/packages/certs-v5/test/commands/certs/shared_sni.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach cli */ +/* globals beforeEach cli */ let expect = require('chai').expect let nock = require('nock') diff --git a/packages/certs-v5/test/commands/certs/update.js b/packages/certs-v5/test/commands/certs/update.js index e52d281c83..7d0eae913e 100644 --- a/packages/certs-v5/test/commands/certs/update.js +++ b/packages/certs-v5/test/commands/certs/update.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach cli */ +/* globals beforeEach afterEach cli */ let expect = require('chai').expect let nock = require('nock') diff --git a/packages/certs/test/commands/hello.test.ts b/packages/certs/test/commands/hello.test.ts index f309d27ceb..53d1cfd50a 100644 --- a/packages/certs/test/commands/hello.test.ts +++ b/packages/certs/test/commands/hello.test.ts @@ -3,6 +3,5 @@ import {test} from '@oclif/test' describe('certs:auto:wait', () => { test .stdout() - // eslint-disable-next-line @typescript-eslint/no-empty-function .it('runs certs:auto:wait', () => {}) }) diff --git a/packages/ci-v5/commands/ci/config-index.js b/packages/ci-v5/commands/ci/config-index.js index a8267f6ced..20e3e256e2 100644 --- a/packages/ci-v5/commands/ci/config-index.js +++ b/packages/ci-v5/commands/ci/config-index.js @@ -16,7 +16,6 @@ async function run(context, heroku) { cli.styledJSON(config) } else { cli.styledHeader(`${pipeline.name} test config vars`) - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries cli.styledObject(Object.keys(config).reduce((memo, key) => { memo[cli.color.green(key)] = config[key] return memo diff --git a/packages/ci-v5/commands/ci/config-set.js b/packages/ci-v5/commands/ci/config-set.js index b351f3e3a5..55cf141e74 100644 --- a/packages/ci-v5/commands/ci/config-set.js +++ b/packages/ci-v5/commands/ci/config-set.js @@ -20,7 +20,6 @@ function validateInput(str) { async function run(context, heroku) { validateArgs(context.args) - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries const vars = context.args.reduce((memo, str) => { validateInput(str) const [key, value] = str.split('=') @@ -35,7 +34,6 @@ async function run(context, heroku) { api.setConfigVars(heroku, pipeline.id, vars), ) - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries cli.styledObject(Object.keys(vars).reduce((memo, key) => { memo[cli.color.green(key)] = vars[key] return memo diff --git a/packages/ci-v5/commands/ci/config-unset.js b/packages/ci-v5/commands/ci/config-unset.js index 4afd56b7f0..d54eaa7c0d 100644 --- a/packages/ci-v5/commands/ci/config-unset.js +++ b/packages/ci-v5/commands/ci/config-unset.js @@ -12,7 +12,6 @@ function validateArgs(args) { async function run(context, heroku) { validateArgs(context.args) - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries const vars = context.args.reduce((memo, key) => { memo[key] = null return memo diff --git a/packages/ci-v5/commands/ci/debug.js b/packages/ci-v5/commands/ci/debug.js index ef3f83fb8b..33c7e1c2ea 100644 --- a/packages/ci-v5/commands/ci/debug.js +++ b/packages/ci-v5/commands/ci/debug.js @@ -18,14 +18,11 @@ async function run(context, heroku) { pipelineRepository.organization.name const commit = await git.readCommit('HEAD') - // eslint-disable-next-line wrap-iife const sourceBlobUrl = await cli.action('Preparing source', async function () { - // eslint-disable-next-line no-return-await return await source.createSourceBlob(commit.ref, context, heroku) }()) // Create test run and wait for it to transition to `debugging` - // eslint-disable-next-line wrap-iife const testRun = await cli.action('Creating test run', async function () { const run = await api.createTestRun(heroku, { commit_branch: commit.branch, @@ -38,7 +35,6 @@ async function run(context, heroku) { source_blob_url: sourceBlobUrl, }) - // eslint-disable-next-line no-return-await return await TestRun.waitForStates(['debugging', 'errored'], run, {heroku}) }()) @@ -67,7 +63,6 @@ async function run(context, heroku) { dyno.dyno = {attach_url: Utils.dig(testNodes, 0, 'dyno', 'attach_url')} - // eslint-disable-next-line @typescript-eslint/no-unused-vars function sendSetup(data, connection) { if (data.toString().includes('$')) { dyno.write(SETUP_COMMAND + '\n') diff --git a/packages/ci-v5/commands/ci/migrate-manifest.js b/packages/ci-v5/commands/ci/migrate-manifest.js index 893af37a2d..2bed7b3095 100644 --- a/packages/ci-v5/commands/ci/migrate-manifest.js +++ b/packages/ci-v5/commands/ci/migrate-manifest.js @@ -4,7 +4,6 @@ const BB = require('bluebird') const writeFile = BB.promisify(fs.writeFile) const unlinkFile = BB.promisify(fs.unlink) -// eslint-disable-next-line @typescript-eslint/no-unused-vars async function run(context, heroku) { const appJSONPath = `${process.cwd()}/app.json` const appCiJSONPath = `${process.cwd()}/app-ci.json` diff --git a/packages/ci-v5/lib/heroku-api.js b/packages/ci-v5/lib/heroku-api.js index 144d05b706..b9d8b0e15b 100644 --- a/packages/ci-v5/lib/heroku-api.js +++ b/packages/ci-v5/lib/heroku-api.js @@ -97,7 +97,6 @@ function logStream(url, fn) { } async function createSource(client) { - // eslint-disable-next-line no-return-await return await client.post('/sources') } diff --git a/packages/ci-v5/lib/key-by.js b/packages/ci-v5/lib/key-by.js index b6cb84f59a..2efaad93cc 100644 --- a/packages/ci-v5/lib/key-by.js +++ b/packages/ci-v5/lib/key-by.js @@ -1,9 +1,7 @@ // copied from plugin-pipelines-v5 -// eslint-disable-next-line func-names module.exports = function keyBy(list, propertyOrCb) { const isCallback = typeof propertyOrCb === 'function' - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries return list.reduce((memo, item) => { const key = isCallback ? propertyOrCb(item) : item[propertyOrCb] memo[key] = item diff --git a/packages/ci-v5/lib/source.js b/packages/ci-v5/lib/source.js index 2cd4bca694..dafa90fe89 100644 --- a/packages/ci-v5/lib/source.js +++ b/packages/ci-v5/lib/source.js @@ -30,7 +30,6 @@ async function prepareSource(ref, context, heroku) { } async function urlExists(url) { - // eslint-disable-next-line no-return-await return await got.head(url) } diff --git a/packages/ci-v5/lib/test-run.js b/packages/ci-v5/lib/test-run.js index bb065d600f..0132c6c727 100644 --- a/packages/ci-v5/lib/test-run.js +++ b/packages/ci-v5/lib/test-run.js @@ -2,9 +2,7 @@ const api = require('./heroku-api') async function waitForStates(states, testRun, {heroku}) { while (!states.includes(testRun.status)) { - // eslint-disable-next-line no-await-in-loop testRun = await api.testRun(heroku, testRun.pipeline.id, testRun.number) - // eslint-disable-next-line no-await-in-loop, no-promise-executor-return await new Promise(resolve => setTimeout(resolve, 1000)) } diff --git a/packages/ci-v5/package.json b/packages/ci-v5/package.json index c465a03c51..9b3fb5cc26 100644 --- a/packages/ci-v5/package.json +++ b/packages/ci-v5/package.json @@ -56,6 +56,7 @@ "scripts": { "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "test": "mocha -R tap", "version": "oclif readme && git add README.md" diff --git a/packages/ci-v5/test/lib/utils-test.js b/packages/ci-v5/test/lib/utils-test.js index a2a72c7bd5..a0558ba647 100644 --- a/packages/ci-v5/test/lib/utils-test.js +++ b/packages/ci-v5/test/lib/utils-test.js @@ -40,7 +40,6 @@ describe('Utils', function () { describe('#dig', function () { it('is undefined given an undefined object', function () { - // eslint-disable-next-line unicorn/no-useless-undefined expect(Utils.dig(undefined)).to.be.undefined }) diff --git a/packages/ci/src/utils/test-run.ts b/packages/ci/src/utils/test-run.ts index 92bcd94182..5d836fda94 100644 --- a/packages/ci/src/utils/test-run.ts +++ b/packages/ci/src/utils/test-run.ts @@ -204,7 +204,6 @@ async function waitForStates(states: string[], testRun: Heroku.TestRun, command: let newTestRun = testRun while (!states.includes(newTestRun.status!.toString())) { - // eslint-disable-next-line no-await-in-loop const {body: bodyTestRun} = await command.heroku.get(`/pipelines/${testRun.pipeline!.id}/test-runs/${testRun.number}`) newTestRun = bodyTestRun } diff --git a/packages/ci/test/commands/ci/info.test.ts b/packages/ci/test/commands/ci/info.test.ts index c939fe8cc4..25867c4dff 100644 --- a/packages/ci/test/commands/ci/info.test.ts +++ b/packages/ci/test/commands/ci/info.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/prefer-string-slice */ import {expect, test} from '@oclif/test' describe('ci:info', () => { diff --git a/packages/ci/test/commands/ci/last.test.ts b/packages/ci/test/commands/ci/last.test.ts index 2b71860d44..78161d94cd 100644 --- a/packages/ci/test/commands/ci/last.test.ts +++ b/packages/ci/test/commands/ci/last.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/prefer-string-slice */ import {expect, test} from '@oclif/test' describe('ci:last', () => { diff --git a/packages/ci/test/commands/ci/rerun.test.ts b/packages/ci/test/commands/ci/rerun.test.ts index e08aa1ce1e..35b7ea4559 100644 --- a/packages/ci/test/commands/ci/rerun.test.ts +++ b/packages/ci/test/commands/ci/rerun.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/prefer-string-slice */ import {test, expect} from '@oclif/test' import * as git from '../../../src/utils/git' diff --git a/packages/ci/test/commands/ci/run.test.ts b/packages/ci/test/commands/ci/run.test.ts index 8ae711a83e..93213abc84 100644 --- a/packages/ci/test/commands/ci/run.test.ts +++ b/packages/ci/test/commands/ci/run.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable unicorn/prefer-string-slice */ import {expect, test} from '@oclif/test' import * as fs from 'async-file' @@ -50,7 +49,6 @@ describe('ci:run', () => { const fsFake = { stat: () => Promise.resolve({size: 500}), - // eslint-disable-next-line @typescript-eslint/no-empty-function createReadStream: () => ({pipe: () => {}}), } diff --git a/packages/cli/src/file.ts b/packages/cli/src/file.ts index 4f1f21ec15..b7af39cd2b 100644 --- a/packages/cli/src/file.ts +++ b/packages/cli/src/file.ts @@ -41,7 +41,7 @@ export async function removeEmptyDirs(dir: string): Promise { } const dirs = files.filter(f => f.stat.isDirectory()).map(f => f.path) - // eslint-disable-next-line no-await-in-loop, unicorn/no-array-callback-reference + // eslint-disable-next-line unicorn/no-array-callback-reference for (const p of dirs.map(removeEmptyDirs)) await p files = await ls(dir) if (files.length === 0) await remove(dir) diff --git a/packages/cli/src/hooks/update/plugin-migrate.ts b/packages/cli/src/hooks/update/plugin-migrate.ts index c9119ed1ff..ff37751f11 100644 --- a/packages/cli/src/hooks/update/plugin-migrate.ts +++ b/packages/cli/src/hooks/update/plugin-migrate.ts @@ -30,7 +30,6 @@ export const migrate: Hook<'init'> = async function () { const {manifest} = await fs.readJSON(p) for (const plugin of Object.keys(manifest.plugins)) { process.stderr.write(`heroku-cli: migrating ${plugin}\n`) - // eslint-disable-next-line no-await-in-loop await exec('heroku', ['plugins:install', plugin]) } } @@ -44,7 +43,6 @@ export const migrate: Hook<'init'> = async function () { const {manifest} = await fs.readJSON(path.join(pluginsDir, 'link.json')) for (const {root} of Object.values(manifest.plugins) as any) { process.stderr.write(`heroku-cli: migrating ${root}\n`) - // eslint-disable-next-line no-await-in-loop await exec('heroku', ['plugins:link', root]) } } diff --git a/packages/config/src/commands/config/edit.ts b/packages/config/src/commands/config/edit.ts index 5d8878a92d..dc6fb4e83a 100644 --- a/packages/config/src/commands/config/edit.ts +++ b/packages/config/src/commands/config/edit.ts @@ -36,7 +36,6 @@ function removeDeleted(newConfig: UploadConfig, original: Config) { } export function stringToConfig(s: string): Config { - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries return s.split('\n').reduce((config: Config, line: string): Config => { const error = () => { throw new Error(`Invalid line: ${line}`) diff --git a/packages/config/test/commands/config/edit.test.ts b/packages/config/test/commands/config/edit.test.ts index 085942e9f7..f041b07652 100644 --- a/packages/config/test/commands/config/edit.test.ts +++ b/packages/config/test/commands/config/edit.test.ts @@ -36,10 +36,8 @@ describe('config:edit', () => { return Promise.resolve() }) sandbox.stub(cli.action, 'start') - // eslint-disable-next-line @typescript-eslint/no-empty-function .value(() => {}) sandbox.stub(cli.action, 'stop') - // eslint-disable-next-line @typescript-eslint/no-empty-function .value(() => {}) }) diff --git a/packages/container-registry-v5/commands/index.js b/packages/container-registry-v5/commands/index.js index 1ee58c517b..d491613ab9 100644 --- a/packages/container-registry-v5/commands/index.js +++ b/packages/container-registry-v5/commands/index.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line func-names module.exports = function index(pkg) { return { topic: pkg.topic, diff --git a/packages/container-registry-v5/commands/pull.js b/packages/container-registry-v5/commands/pull.js index f064e23659..185ba51894 100644 --- a/packages/container-registry-v5/commands/pull.js +++ b/packages/container-registry-v5/commands/pull.js @@ -22,7 +22,6 @@ let pull = async function (context) { for (let process of context.args) { let tag = `${registry}/${context.app}/${process}` cli.styledHeader(`Pulling ${process} as ${tag}`) - // eslint-disable-next-line no-await-in-loop await Sanbashi.pullImage(tag) } } diff --git a/packages/container-registry-v5/commands/push.js b/packages/container-registry-v5/commands/push.js index 95186a7c64..b6c983d8b6 100644 --- a/packages/container-registry-v5/commands/push.js +++ b/packages/container-registry-v5/commands/push.js @@ -86,7 +86,6 @@ let push = async function (context, heroku) { } let flagsArg = context.flags.arg - // eslint-disable-next-line no-negated-condition let buildArg = (flagsArg !== undefined) ? flagsArg.split(',') : [] try { @@ -97,7 +96,6 @@ let push = async function (context, heroku) { cli.styledHeader(`Building ${job.name} (${job.dockerfile})`) } - // eslint-disable-next-line no-await-in-loop await Sanbashi.buildImage(job.dockerfile, job.resource, buildArg, context.flags['context-path']) } } catch (error) { @@ -113,7 +111,6 @@ let push = async function (context, heroku) { cli.styledHeader(`Pushing ${job.name} (${job.dockerfile})`) } - // eslint-disable-next-line no-await-in-loop await Sanbashi.pushImage(job.resource) } diff --git a/packages/container-registry-v5/commands/release.js b/packages/container-registry-v5/commands/release.js index 0b5d4dde67..23416a0460 100644 --- a/packages/container-registry-v5/commands/release.js +++ b/packages/container-registry-v5/commands/release.js @@ -44,7 +44,6 @@ let release = async function (context, heroku) { let image = `${context.app}/${process}` let tag = 'latest' - // eslint-disable-next-line no-await-in-loop let imageResp = await heroku.request({ host: `registry.${herokuHost}`, path: `/v2/${image}/manifests/${tag}`, diff --git a/packages/container-registry-v5/commands/rm.js b/packages/container-registry-v5/commands/rm.js index 95388b33ea..1e5eb43eab 100644 --- a/packages/container-registry-v5/commands/rm.js +++ b/packages/container-registry-v5/commands/rm.js @@ -31,7 +31,6 @@ let rm = async function (context, heroku) { headers: {Accept: 'application/vnd.heroku+json; version=3.docker-releases'}, body: {docker_image: null}, }) - // eslint-disable-next-line no-await-in-loop await cli.action(`Removing container ${container} for ${cli.color.app(context.app)}`, r) } } diff --git a/packages/container-registry-v5/lib/sanbashi.js b/packages/container-registry-v5/lib/sanbashi.js index fe9e709a10..80b40b00da 100644 --- a/packages/container-registry-v5/lib/sanbashi.js +++ b/packages/container-registry-v5/lib/sanbashi.js @@ -8,7 +8,6 @@ const Child = require('child_process') const debug = require('./debug') const DOCKERFILE_REGEX = /\bDockerfile(.\w*)?$/ -// eslint-disable-next-line @typescript-eslint/no-empty-function let Sanbashi = function () {} Sanbashi.getDockerfiles = function (rootdir, recursive) { @@ -47,7 +46,6 @@ Sanbashi.getJobs = function (resourceRoot, dockerfiles) { return a.depth - b.depth || a.postfix - b.postfix }) // group all Dockerfiles for the same process type together - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries .reduce((jobs, job) => { jobs[job.name] = jobs[job.name] || [] jobs[job.name].push(job) @@ -67,7 +65,6 @@ Sanbashi.chooseJobs = async function (jobs) { choices: group.map(j => j.dockerfile), message: `Found multiple Dockerfiles with process type ${processType}. Please choose one to build and push `, } - // eslint-disable-next-line no-await-in-loop let answer = await Inquirer.prompt(prompt) chosenJobs.push(group.find(o => o.dockerfile === answer[processType])) } else { @@ -127,7 +124,6 @@ Sanbashi.version = function () { return Sanbashi .cmd('docker', ['version', '-f', '{{.Client.Version}}'], {output: true}) .then(version => version.split(/\./)) - // eslint-disable-next-line radix .then(([major, minor]) => [Number.parseInt(major) || 0, Number.parseInt(minor) || 0]) // ensure exactly 2 components } diff --git a/packages/container-registry-v5/package.json b/packages/container-registry-v5/package.json index c222785745..f190375349 100644 --- a/packages/container-registry-v5/package.json +++ b/packages/container-registry-v5/package.json @@ -55,6 +55,7 @@ "depcheck": "depcheck || true", "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "test": "cross-env TZ=utc nyc mocha", "version": "oclif readme && git add README.md" diff --git a/packages/container-registry-v5/test/commands/login.js b/packages/container-registry-v5/test/commands/login.js index 747d6f861c..a27964bc05 100644 --- a/packages/container-registry-v5/test/commands/login.js +++ b/packages/container-registry-v5/test/commands/login.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'login') diff --git a/packages/container-registry-v5/test/commands/logout.js b/packages/container-registry-v5/test/commands/logout.js index baeebfa402..a7222c5b42 100644 --- a/packages/container-registry-v5/test/commands/logout.js +++ b/packages/container-registry-v5/test/commands/logout.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'logout') diff --git a/packages/container-registry-v5/test/commands/pull.js b/packages/container-registry-v5/test/commands/pull.js index eafaa92cfb..211d0d2011 100644 --- a/packages/container-registry-v5/test/commands/pull.js +++ b/packages/container-registry-v5/test/commands/pull.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'pull') diff --git a/packages/container-registry-v5/test/commands/push.js b/packages/container-registry-v5/test/commands/push.js index 7f21c569ac..9f4201445e 100644 --- a/packages/container-registry-v5/test/commands/push.js +++ b/packages/container-registry-v5/test/commands/push.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'push') diff --git a/packages/container-registry-v5/test/commands/release.js b/packages/container-registry-v5/test/commands/release.js index 4611372381..021bd27fdf 100644 --- a/packages/container-registry-v5/test/commands/release.js +++ b/packages/container-registry-v5/test/commands/release.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'release') diff --git a/packages/container-registry-v5/test/commands/rm.js b/packages/container-registry-v5/test/commands/rm.js index 1cdb98401e..dda2bfa28b 100644 --- a/packages/container-registry-v5/test/commands/rm.js +++ b/packages/container-registry-v5/test/commands/rm.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach */ +/* globals beforeEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'rm') diff --git a/packages/container-registry-v5/test/commands/run.js b/packages/container-registry-v5/test/commands/run.js index 511566d948..28eecd3f7f 100644 --- a/packages/container-registry-v5/test/commands/run.js +++ b/packages/container-registry-v5/test/commands/run.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const cmd = require('../..').commands.find(c => c.topic === 'container' && c.command === 'run') diff --git a/packages/git/src/git.ts b/packages/git/src/git.ts index f16b028548..a2a17eb2e7 100644 --- a/packages/git/src/git.ts +++ b/packages/git/src/git.ts @@ -36,7 +36,6 @@ export default class Git { } remoteFromGitConfig() { - // eslint-disable-next-line @typescript-eslint/no-empty-function return this.exec(['config', 'heroku.remote']).catch(() => {}) } diff --git a/packages/local/src/fork-foreman.ts b/packages/local/src/fork-foreman.ts index dfd040f3f3..e2babdf771 100644 --- a/packages/local/src/fork-foreman.ts +++ b/packages/local/src/fork-foreman.ts @@ -27,7 +27,6 @@ export function fork(argv: string[]): Promise { return new Promise(resolve => { nf.on('exit', function (code: number) { - // eslint-disable-next-line unicorn/no-process-exit, no-process-exit if (code !== 0) process.exit(code) resolve() }) diff --git a/packages/oauth-v5/lib/clients.js b/packages/oauth-v5/lib/clients.js index bed976d845..d52b456260 100644 --- a/packages/oauth-v5/lib/clients.js +++ b/packages/oauth-v5/lib/clients.js @@ -12,7 +12,6 @@ function insecureURL(uri) { } function validateURL(uri) { - // eslint-disable-next-line node/no-deprecated-api let u = url.parse(uri) if (!u.protocol) throw new Error('Invalid URL') if (insecureURL(u)) throw new Error('Unsupported callback URL. Clients have to use HTTPS for non-local addresses.') diff --git a/packages/oauth-v5/lib/commands/sessions/destroy.js b/packages/oauth-v5/lib/commands/sessions/destroy.js index d10c611bfc..37a74205ed 100644 --- a/packages/oauth-v5/lib/commands/sessions/destroy.js +++ b/packages/oauth-v5/lib/commands/sessions/destroy.js @@ -4,7 +4,6 @@ let cli = require('heroku-cli-util') async function run(context, heroku) { let id = context.args.id - // eslint-disable-next-line wrap-iife await cli.action(`Destroying ${cli.color.cyan(id)}`, async function () { await heroku.request({ method: 'DELETE', diff --git a/packages/oauth-v5/package.json b/packages/oauth-v5/package.json index bffe17f231..c117a2bbcd 100644 --- a/packages/oauth-v5/package.json +++ b/packages/oauth-v5/package.json @@ -51,7 +51,9 @@ }, "repository": "heroku/cli", "scripts": { + "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "test": "cross-env TZ=UTC nyc mocha", "version": "oclif readme && git add README.md" diff --git a/packages/oauth-v5/test/clients.js b/packages/oauth-v5/test/clients.js index 6ea3df4ce8..93fcf6fc57 100644 --- a/packages/oauth-v5/test/clients.js +++ b/packages/oauth-v5/test/clients.js @@ -1,6 +1,4 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it */ const {expect} = require('chai') let clients = require('../lib/clients') diff --git a/packages/oauth-v5/test/clients/create.js b/packages/oauth-v5/test/clients/create.js index d047c5ebca..dc50806c15 100644 --- a/packages/oauth-v5/test/clients/create.js +++ b/packages/oauth-v5/test/clients/create.js @@ -1,7 +1,5 @@ /* eslint-env mocha */ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach */ const cli = require('heroku-cli-util') const {expect} = require('chai') diff --git a/packages/oauth-v5/test/clients/destroy.js b/packages/oauth-v5/test/clients/destroy.js index b338658ac6..cc52e2508d 100644 --- a/packages/oauth-v5/test/clients/destroy.js +++ b/packages/oauth-v5/test/clients/destroy.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach */ +/* globals beforeEach */ const cli = require('heroku-cli-util') let nock = require('nock') diff --git a/packages/oauth-v5/test/clients/index.js b/packages/oauth-v5/test/clients/index.js index e169f52416..64e981382c 100644 --- a/packages/oauth-v5/test/clients/index.js +++ b/packages/oauth-v5/test/clients/index.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const {expect} = require('chai') diff --git a/packages/oauth-v5/test/clients/info.js b/packages/oauth-v5/test/clients/info.js index 14e7b94725..5024a52c1a 100644 --- a/packages/oauth-v5/test/clients/info.js +++ b/packages/oauth-v5/test/clients/info.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const {expect} = require('chai') diff --git a/packages/oauth-v5/test/clients/rotate.js b/packages/oauth-v5/test/clients/rotate.js index 4dfc5d1440..2f4463d1a1 100644 --- a/packages/oauth-v5/test/clients/rotate.js +++ b/packages/oauth-v5/test/clients/rotate.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const nock = require('nock') diff --git a/packages/oauth-v5/test/clients/update.js b/packages/oauth-v5/test/clients/update.js index 05bac87415..4a6387a51c 100644 --- a/packages/oauth-v5/test/clients/update.js +++ b/packages/oauth-v5/test/clients/update.js @@ -1,6 +1,5 @@ 'use strict' -// eslint-disable-next-line no-redeclare -/* globals describe it beforeEach afterEach */ +/* globals beforeEach afterEach */ const cli = require('heroku-cli-util') const nock = require('nock') diff --git a/packages/orgs-v5/commands/access/add.js b/packages/orgs-v5/commands/access/add.js index 4520b3ce7a..2b280db253 100644 --- a/packages/orgs-v5/commands/access/add.js +++ b/packages/orgs-v5/commands/access/add.js @@ -18,7 +18,6 @@ async function run(context, heroku) { teamFeatures = await heroku.get(`/teams/${teamName}/features`) } - // eslint-disable-next-line unicorn/prefer-array-some if (teamFeatures.find(feature => feature.name === 'org-access-controls')) { if (!permissions) error.exit(1, 'Missing argument: permissions') @@ -66,7 +65,6 @@ module.exports = [ hidden: true, run: () => { cli.error(`This command is now ${cli.color.cyan('heroku access:add')}`) - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(1) }, }, diff --git a/packages/orgs-v5/commands/access/index.js b/packages/orgs-v5/commands/access/index.js index 4fa407fa55..9b88da832f 100644 --- a/packages/orgs-v5/commands/access/index.js +++ b/packages/orgs-v5/commands/access/index.js @@ -85,7 +85,6 @@ module.exports = [ hidden: true, run: () => { cli.error(`This command is now ${cli.color.cyan('heroku access')}`) - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(1) }, }, diff --git a/packages/orgs-v5/commands/access/remove.js b/packages/orgs-v5/commands/access/remove.js index 1bcabed422..cf87ffd4fb 100644 --- a/packages/orgs-v5/commands/access/remove.js +++ b/packages/orgs-v5/commands/access/remove.js @@ -27,7 +27,6 @@ module.exports = [ hidden: true, run: () => { cli.error(`This command is now ${cli.color.cyan('heroku access:remove')}`) - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(1) }, }, diff --git a/packages/orgs-v5/commands/apps/transfer.js b/packages/orgs-v5/commands/apps/transfer.js index e72587fc94..6191c3fc51 100644 --- a/packages/orgs-v5/commands/apps/transfer.js +++ b/packages/orgs-v5/commands/apps/transfer.js @@ -42,7 +42,6 @@ async function run(context, heroku) { personalToPersonal: Utils.isValidEmail(recipient) && !Utils.isteamApp(app.owner), bulk: true, }) - // eslint-disable-next-line no-await-in-loop await appTransfer.start() } catch (error) { cli.error(error) @@ -104,7 +103,6 @@ module.exports = [ hidden: true, run: () => { cli.error(`This command is now ${cli.color.cyan('heroku apps:transfer')}`) - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(1) }, }, diff --git a/packages/orgs-v5/commands/members/add.js b/packages/orgs-v5/commands/members/add.js index 48fcb481ae..648e1b77ab 100644 --- a/packages/orgs-v5/commands/members/add.js +++ b/packages/orgs-v5/commands/members/add.js @@ -27,7 +27,6 @@ async function run(context, heroku) { await cli.action(`Inviting ${cli.color.cyan(email)} to ${cli.color.magenta(groupName)} as ${cli.color.green(role)}`, request) } - // eslint-disable-next-line unicorn/prefer-array-some if (teamInfo.type === 'team' && groupFeatures.find(feature => { return feature.name === 'team-invite-acceptance' && feature.enabled })) { diff --git a/packages/orgs-v5/commands/members/index.js b/packages/orgs-v5/commands/members/index.js index 922091dc37..20501e11d7 100644 --- a/packages/orgs-v5/commands/members/index.js +++ b/packages/orgs-v5/commands/members/index.js @@ -14,7 +14,6 @@ async function run(context, heroku) { if (teamInfo.type === 'team') { let orgFeatures = await heroku.get(`/teams/${groupName}/features`) - // eslint-disable-next-line unicorn/prefer-array-some if (orgFeatures.find(feature => feature.name === 'team-invite-acceptance' && feature.enabled)) { teamInvites = await heroku.request({ headers: { diff --git a/packages/orgs-v5/commands/members/remove.js b/packages/orgs-v5/commands/members/remove.js index d8ce5bd477..1fbf18a087 100644 --- a/packages/orgs-v5/commands/members/remove.js +++ b/packages/orgs-v5/commands/members/remove.js @@ -39,12 +39,10 @@ async function run(context, heroku) { if (teamInfo.type === 'team') { let teamFeatures = await heroku.get(`/teams/${groupName}/features`) - // eslint-disable-next-line unicorn/prefer-array-some teamInviteFeatureEnabled = Boolean(teamFeatures.find(feature => feature.name === 'team-invite-acceptance' && feature.enabled)) if (teamInviteFeatureEnabled) { let invites = await teamInvites() - // eslint-disable-next-line unicorn/prefer-array-some isInvitedUser = Boolean(invites.find(m => m.user.email === email)) } } diff --git a/packages/orgs-v5/lib/error.js b/packages/orgs-v5/lib/error.js index 07f23aacd1..313207401e 100644 --- a/packages/orgs-v5/lib/error.js +++ b/packages/orgs-v5/lib/error.js @@ -23,7 +23,6 @@ function exit(code, message) { if (mocking) { throw new ErrorExit(code) } else { - // eslint-disable-next-line no-process-exit, unicorn/no-process-exit process.exit(code) } } diff --git a/packages/orgs-v5/lib/utils.js b/packages/orgs-v5/lib/utils.js index ce75bd3d09..0c1f8c69b5 100644 --- a/packages/orgs-v5/lib/utils.js +++ b/packages/orgs-v5/lib/utils.js @@ -37,7 +37,6 @@ let printGroupsJSON = function (group) { let teamInfo = async function (context, heroku) { let teamName = context.flags.team if (!teamName) error.exit(1, 'No team or org specified.\nRun this command with --team') - // eslint-disable-next-line no-return-await return await heroku.get(`/teams/${teamName}`) } diff --git a/packages/orgs-v5/package.json b/packages/orgs-v5/package.json index 7b4b7b089e..776676d16a 100644 --- a/packages/orgs-v5/package.json +++ b/packages/orgs-v5/package.json @@ -51,7 +51,8 @@ "nock": "^10.0.6", "nyc": "^15.1.0", "oclif": "3.8.1", - "proxyquire": "^2.1.0" + "proxyquire": "^2.1.0", + "sinon": "^6.3.5" }, "files": [ "oclif.manifest.json", @@ -67,7 +68,9 @@ "main": "index.js", "repository": "heroku/cli", "scripts": { + "lint": "eslint . --ext .js --config ../../.eslintrc --ignore-path ../../.eslintignore", "postpublish": "rm oclif.manifest.json", + "posttest": "yarn lint", "prepack": "oclif manifest", "test": "nyc mocha", "version": "oclif readme && git add README.md" diff --git a/packages/orgs-v5/test/commands/access/remove.js b/packages/orgs-v5/test/commands/access/remove.js index 140751e5d6..9279379b39 100644 --- a/packages/orgs-v5/test/commands/access/remove.js +++ b/packages/orgs-v5/test/commands/access/remove.js @@ -1,5 +1,5 @@ 'use strict' -/* globals beforeEach afterEach context cli nock expect */ +/* globals after before beforeEach afterEach context nock expect */ let cli = require('heroku-cli-util') let cmd = require('../../../commands/access/remove')[0] @@ -33,7 +33,7 @@ describe('heroku access:remove', () => { before(() => { cliErrorStub = sinon.stub(cli, 'error').returns(() => {}) cmd2 = proxyquire(('../../../commands/access/remove'), { - 'cli': cliErrorStub + cli: cliErrorStub, }) processStub = sinon.stub(process, 'exit').returns(() => {}) cli.mockConsole() @@ -46,7 +46,7 @@ describe('heroku access:remove', () => { it('errors when attempting to use old command', () => { cmd2[1].run({ - app: 'myapp' + app: 'myapp', }) expect(cliErrorStub.called).to.equal(true) }) diff --git a/packages/orgs-v5/test/commands/apps/leave.js b/packages/orgs-v5/test/commands/apps/leave.js index 74b95ee488..d8bc93db7a 100644 --- a/packages/orgs-v5/test/commands/apps/leave.js +++ b/packages/orgs-v5/test/commands/apps/leave.js @@ -1,5 +1,5 @@ 'use strict' -/* globals beforeEach afterEach cli nock context expect */ +/* globals after before beforeEach afterEach cli nock context expect */ let cmd = require('../../../commands/apps/leave')[0] let stubGet = require('../../stub/get') @@ -48,12 +48,12 @@ describe('heroku apps:leave', () => { after(() => nock.cleanAll()) it('shows an error if the heroku.delete() operation returns an error', () => { - return cmd.run({ app: 'myapp' }) - .then(() => apiGetUserAccount.done()) - .then(() => apiDeletePersonalAppCollaborator.done()) - .catch(function (err) { - expect(err).to.be.an.instanceof(Error) - }) + return cmd.run({app: 'myapp'}) + .then(() => apiGetUserAccount.done()) + .then(() => apiDeletePersonalAppCollaborator.done()) + .catch(function (error) { + expect(error).to.be.an.instanceof(Error) + }) }) }) }) diff --git a/packages/orgs-v5/test/commands/orgs/open.js b/packages/orgs-v5/test/commands/orgs/open.js index 1debe8bcc1..04c6d0c523 100644 --- a/packages/orgs-v5/test/commands/orgs/open.js +++ b/packages/orgs-v5/test/commands/orgs/open.js @@ -1,3 +1,4 @@ +/* globals beforeEach afterEach nock */ let cli = require('heroku-cli-util') const sinon = require('sinon') const expect = require('chai').expect @@ -5,13 +6,14 @@ let stubGet = require('../../stub/get') const proxyquire = require('proxyquire') let cmd let apiGetOrgInfo +let openStub describe('heroku org:open', () => { beforeEach(() => { apiGetOrgInfo = stubGet.teamInfo() openStub = sinon.stub(cli, 'open').callsFake(() => {}) cmd = proxyquire('../../../commands/orgs/open', { - 'cli': openStub + cli: openStub, }) cli.mockConsole() }) @@ -26,13 +28,13 @@ describe('heroku org:open', () => { }) it('shows an error if team flag is not passed', function () { - cmd.run({}).catch((err) => { - expect(err).to.be.instanceOf(Error) + cmd.run({}).catch(error => { + expect(error).to.be.instanceOf(Error) }) }) it('opens org in dashboard via browser if team flag is passed', function () { - return cmd.run({ flags: { team: 'myteam' } }) + return cmd.run({flags: {team: 'myteam'}}) .then(() => apiGetOrgInfo.done()) .then(() => expect(openStub.called).to.equal(true)) }) diff --git a/packages/orgs-v5/test/stub/delete.js b/packages/orgs-v5/test/stub/delete.js index fbef8641b2..9db1c7ae17 100644 --- a/packages/orgs-v5/test/stub/delete.js +++ b/packages/orgs-v5/test/stub/delete.js @@ -14,12 +14,12 @@ function collaboratorsPersonalApp(app, email) { .delete(`/apps/${app}/collaborators/${email}`).reply(200, {}) } -function collaboratorsPersonalAppDeleteFailure (app, email) { +function collaboratorsPersonalAppDeleteFailure(app, email) { return nock('https://api.heroku.com:443', {}) .delete(`/apps/${app}/collaborators/${email}`).reply(404, {}) } -function teamInvite (email = 'foo@email.com') { +function teamInvite(email = 'foo@email.com') { return nock('https://api.heroku.com:443', { reqheaders: {Accept: 'application/vnd.heroku+json; version=3.team-invitations'}, }) diff --git a/packages/pipelines/src/api.ts b/packages/pipelines/src/api.ts index 5fdc22449d..c2b8b2b75d 100644 --- a/packages/pipelines/src/api.ts +++ b/packages/pipelines/src/api.ts @@ -1,6 +1,5 @@ import {APIClient} from '@heroku-cli/command' import * as Heroku from '@heroku-cli/schema' -// eslint-disable-next-line @typescript-eslint/no-unused-vars import http from 'http-call' import keyBy from 'lodash.keyby' diff --git a/packages/pipelines/src/commands/pipelines/diff.ts b/packages/pipelines/src/commands/pipelines/diff.ts index 20e2f38980..a1f91ba859 100644 --- a/packages/pipelines/src/commands/pipelines/diff.ts +++ b/packages/pipelines/src/commands/pipelines/diff.ts @@ -51,7 +51,7 @@ async function diff(targetApp: AppInfo, downstreamApp: AppInfo, githubToken: str cli.styledHeader(`${color.app(targetApp.name)} is ahead of ${color.app(downstreamApp.name)} by ${githubDiff.ahead_by} commit${githubDiff.ahead_by === 1 ? '' : 's'}`) const mapped = githubDiff.commits.map((commit: any) => { return { - sha: commit.sha.substring(0, 7), // eslint-disable-line unicorn/prefer-string-slice + sha: commit.sha.substring(0, 7), date: commit.commit.author.date, author: commit.commit.author.name, message: commit.commit.message.split('\n')[0], @@ -120,7 +120,7 @@ export default class PipelinesDiff extends Command { const coupling = await getCoupling(this.heroku, targetAppName) .then(res => res.body) - .catch(() => undefined) // eslint-disable-line unicorn/no-useless-undefined + .catch(() => undefined) if (!coupling) { cli.error(`This app (${targetAppName}) does not seem to be a part of any pipeline`) @@ -179,7 +179,6 @@ export default class PipelinesDiff extends Command { // Diff [{target, downstream[0]}, {target, downstream[1]}, .., {target, downstream[n]}] const downstreamAppsInfo = appInfo.slice(1) for (const downstreamAppInfo of downstreamAppsInfo) { - // eslint-disable-next-line no-await-in-loop await diff( targetAppInfo, downstreamAppInfo, githubAccount.github.token, this.config.userAgent, ) diff --git a/packages/pipelines/src/commands/pipelines/promote.ts b/packages/pipelines/src/commands/pipelines/promote.ts index 9c1e9f095c..408a436122 100644 --- a/packages/pipelines/src/commands/pipelines/promote.ts +++ b/packages/pipelines/src/commands/pipelines/promote.ts @@ -13,7 +13,6 @@ import keyBy from '../../key-by' const cli = CliUx.ux export const sleep = (time: number) => { - // eslint-disable-next-line no-promise-executor-return return new Promise(resolve => setTimeout(resolve, time)) } @@ -30,7 +29,6 @@ function findAppInPipeline(apps: Array, target: string) { const PROMOTION_ORDER = ['development', 'staging', 'production'] -// eslint-disable-next-line no-promise-executor-return const wait = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms)) function isComplete(promotionTarget: Heroku.PipelinePromotionTarget) { @@ -151,7 +149,6 @@ async function streamReleaseCommand(heroku: APIClient, targets: Array, targetAppNameOrId) => { assertNotPromotingToSelf(appNameOrId, targetAppNameOrId) const app = findAppInPipeline(allApps, targetAppNameOrId) @@ -249,7 +244,6 @@ export default class Promote extends Command { const appsByID = keyBy(allApps, 'id') - // eslint-disable-next-line unicorn/prefer-object-from-entries, unicorn/no-array-reduce const styledTargets = promotionTargets.reduce(function (memo: Heroku.App, target: Heroku.App) { const app = appsByID[target.app.id] const details = [target.status] diff --git a/packages/pipelines/src/key-by.ts b/packages/pipelines/src/key-by.ts index 28d852f763..09c4040a23 100644 --- a/packages/pipelines/src/key-by.ts +++ b/packages/pipelines/src/key-by.ts @@ -1,7 +1,6 @@ export default function keyBy(list: any, propertyOrCb: any) { const isCallback = typeof propertyOrCb === 'function' - // eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-object-from-entries return list.reduce((memo: any, item: any) => { const key = isCallback ? propertyOrCb(item) : item[propertyOrCb] memo[key] = item diff --git a/packages/pipelines/src/setup/create-apps.ts b/packages/pipelines/src/setup/create-apps.ts index cc8687d415..6adcdc4211 100644 --- a/packages/pipelines/src/setup/create-apps.ts +++ b/packages/pipelines/src/setup/create-apps.ts @@ -2,7 +2,6 @@ import Heroku from '@heroku-cli/schema' import {CliUx} from '@oclif/core' -// eslint-disable-next-line @typescript-eslint/no-unused-vars import http from 'http-call' import {createAppSetup} from '../api' diff --git a/packages/pipelines/src/setup/poll-app-setups.ts b/packages/pipelines/src/setup/poll-app-setups.ts index 484b1e37e4..2197944c5b 100644 --- a/packages/pipelines/src/setup/poll-app-setups.ts +++ b/packages/pipelines/src/setup/poll-app-setups.ts @@ -3,7 +3,6 @@ import * as api from '../api' const cli = require('heroku-cli-util') function wait(ms: any) { - // eslint-disable-next-line no-promise-executor-return return new Promise((resolve: (value?: any) => void) => setTimeout(resolve, ms)) } diff --git a/packages/ps/src/commands/ps/wait.ts b/packages/ps/src/commands/ps/wait.ts index 279ca49b3e..5ede6a89a0 100644 --- a/packages/ps/src/commands/ps/wait.ts +++ b/packages/ps/src/commands/ps/wait.ts @@ -54,7 +54,6 @@ export default class Wait extends Command { const interval = flags['wait-interval'] as number while (1 as any) { - // eslint-disable-next-line no-await-in-loop const {body: dynos} = await this.heroku.get(`/apps/${flags.app}/dynos`) const relevantDynos = dynos .filter(dyno => dyno.type !== 'release') @@ -84,7 +83,6 @@ export default class Wait extends Command { CliUx.ux.action.status = releasedFraction - // eslint-disable-next-line no-await-in-loop await CliUx.ux.wait(interval * 1000) } } diff --git a/packages/ps/test/commands/wait.test.ts b/packages/ps/test/commands/wait.test.ts index 7354dbd3c6..8dd328dc64 100644 --- a/packages/ps/test/commands/wait.test.ts +++ b/packages/ps/test/commands/wait.test.ts @@ -64,7 +64,6 @@ describe('heroku ps:wait', () => { {release: CURRENT, state: 'up', type: 'web'}, ]), ) - // eslint-disable-next-line @typescript-eslint/no-empty-function .stub(CliUx.ux, 'wait', () => () => {}) .command(['ps:wait', '--app', APP_NAME]) .it('waits for all dynos to be on latest release', ctx => { @@ -113,7 +112,6 @@ describe('heroku ps:wait', () => { {release: CURRENT, state: 'up', type: 'run'}, ]), ) - // eslint-disable-next-line @typescript-eslint/no-empty-function .stub(CliUx.ux, 'wait', () => () => {}) .command(['ps:wait', '--with-run', '--app', APP_NAME]) .it('includes run dynos with the --with-run flag', ctx => { diff --git a/packages/run/src/lib/dyno.ts b/packages/run/src/lib/dyno.ts index f50fc91a95..c34c72d9b4 100644 --- a/packages/run/src/lib/dyno.ts +++ b/packages/run/src/lib/dyno.ts @@ -12,7 +12,6 @@ import * as net from 'net' import {Duplex, Transform} from 'stream' import * as tls from 'tls' import * as tty from 'tty' -// eslint-disable-next-line node/no-deprecated-api import {URL, parse} from 'url' import {buildEnvFromFlag} from '../lib/helpers' diff --git a/packages/run/src/lib/log-displayer.ts b/packages/run/src/lib/log-displayer.ts index 3432d3225c..786a8527d9 100644 --- a/packages/run/src/lib/log-displayer.ts +++ b/packages/run/src/lib/log-displayer.ts @@ -78,7 +78,6 @@ function readLogs(logplexURL: string) { async function logDisplayer(heroku: APIClient, options: LogDisplayerOptions) { process.stdout.on('error', err => { if (err.code === 'EPIPE') { - // eslint-disable-next-line unicorn/no-process-exit, no-process-exit process.exit(0) } else { CliUx.ux.error(err.stack, {exit: 1}) diff --git a/packages/status/src/commands/status.ts b/packages/status/src/commands/status.ts index 1615191cce..b49acbe069 100644 --- a/packages/status/src/commands/status.ts +++ b/packages/status/src/commands/status.ts @@ -5,7 +5,6 @@ import HTTP from 'http-call' import {maxBy} from '../util' -// eslint-disable-next-line unicorn/prefer-string-slice const capitalize = (str: string) => str.substr(0, 1).toUpperCase() + str.substr(1) const printStatus = (status: string) => { diff --git a/yarn.lock b/yarn.lock index 5f8a8f816a..85e7b3d4ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2504,6 +2504,11 @@ resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz" integrity sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow== +"@sindresorhus/is@^4.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + "@sinonjs/commons@^1", "@sinonjs/commons@^1.4.0": version "1.4.0" resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz" @@ -2575,6 +2580,13 @@ dependencies: defer-to-connect "^1.0.1" +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2612,6 +2624,16 @@ dependencies: "@types/color-name" "*" +"@types/cacheable-request@^6.0.1": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" + integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "^3.1.4" + "@types/node" "*" + "@types/responselike" "^1.0.0" + "@types/chai@*", "@types/chai@4.1.7", "@types/chai@^4", "@types/chai@^4.1.7": version "4.1.7" resolved "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz" @@ -2681,6 +2703,11 @@ "@types/tough-cookie" "*" form-data "^2.5.0" +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + "@types/inquirer@7.3.0": version "7.3.0" resolved "https://registry.npmjs.org/@types/inquirer/-/inquirer-7.3.0.tgz" @@ -2704,6 +2731,13 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/keyv@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + "@types/lodash.flatten@^4.4.6": version "4.4.6" resolved "https://registry.npmjs.org/@types/lodash.flatten/-/lodash.flatten-4.4.6.tgz" @@ -2801,6 +2835,13 @@ resolved "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.4.0.tgz" integrity sha512-bsuR5rj81NxgJ1w+Z5mgHlcIFBJKa2ChtbFbd1xDXxNJaBqYocAL53vsQ9T/CIZOSEs4A3WK7VMvzOOsG5cbJQ== +"@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/shell-escape@^0.2.0": version "0.2.0" resolved "https://registry.npmjs.org/@types/shell-escape/-/shell-escape-0.2.0.tgz" @@ -3826,6 +3867,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + cacheable-request@^2.1.1: version "2.1.4" resolved "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz" @@ -3852,6 +3898,19 @@ cacheable-request@^6.0.0: normalize-url "^3.1.0" responselike "^1.0.2" +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + caching-transform@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz" @@ -4757,6 +4816,13 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + dedent@^0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" @@ -4815,6 +4881,11 @@ defer-to-connect@^1.0.1: resolved "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.1.tgz" integrity sha512-2e0FJesseUqQj671gvZWfUyxpnFx/5n4xleamlpCD3U6Fm5dh5qzmmLNxNhtmHF06+SYVHH8QU6FACffYTnj0Q== +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" @@ -6459,6 +6530,13 @@ get-stream@^4.0.0, get-stream@^4.1.0: dependencies: pump "^3.0.0" +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + get-stream@^6.0.0: version "6.0.1" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" @@ -7197,6 +7275,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" @@ -8131,6 +8217,11 @@ json-buffer@3.0.0: resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" @@ -8265,6 +8356,13 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +keyv@^4.0.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" + integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== + dependencies: + json-buffer "3.0.1" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" @@ -8602,6 +8700,11 @@ lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz" integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" @@ -8871,6 +8974,11 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" @@ -9457,6 +9565,11 @@ normalize-url@^3.1.0: resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-3.3.0.tgz" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== + npm-bundled@^1.1.1: version "1.1.2" resolved "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.2.tgz" @@ -9935,6 +10048,11 @@ p-cancelable@^1.0.0: resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.0.0.tgz" integrity sha512-USgPoaC6tkTGlS831CxsVdmZmyb8tR1D+hStI84MyckLOzfJlYQUweomrwE3D8T7u5u5GVuW064LT501wHTYYA== +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + p-defer@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz" @@ -10711,6 +10829,11 @@ quick-lru@^4.0.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + ramda@^0.27.1: version "0.27.2" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.2.tgz#84463226f7f36dc33592f6f4ed6374c48306c3f1" @@ -11055,6 +11178,11 @@ requires-port@^1.0.0: resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" @@ -11124,6 +11252,13 @@ responselike@1.0.2, responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== + dependencies: + lowercase-keys "^2.0.0" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz"