Skip to content

Commit

Permalink
Fix more lints
Browse files Browse the repository at this point in the history
  • Loading branch information
eablack committed Sep 9, 2024
1 parent a979acf commit 1a4de1f
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/pg/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Heroku from '@heroku-cli/schema'
import pghost from '../../lib/pg/host'
import {getAddon, all} from '../../lib/pg/fetcher'
import {configVarNamesFromValue, databaseNameFromUrl} from '../../lib/pg/util'
import {AddOnAttachmentWithConfigVarsAndPlan, AddOnWithRelatedData, PgDatabaseTenant, TenantInfo} from '../../lib/pg/types'
import {AddOnAttachmentWithConfigVarsAndPlan, AddOnWithRelatedData, PgDatabaseTenant} from '../../lib/pg/types'

type DBObject = {
addon: AddOnAttachmentWithConfigVarsAndPlan | AddOnWithRelatedData,
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/pipelines/promote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function isFailed(promotionTarget: Heroku.PipelinePromotionTarget) {

function pollPromotionStatus(heroku: APIClient, id: string, needsReleaseCommand: boolean): Promise<Array<Heroku.PipelinePromotionTarget>> {
return heroku.get<Array<Heroku.PipelinePromotionTarget>>(`/pipeline-promotions/${id}/promotion-targets`).then(function ({body: targets}) {
if (targets.every(isComplete)) { // eslint-disable-line unicorn/no-array-callback-reference
if (targets.every(isComplete)) {
return targets
}

Expand Down Expand Up @@ -116,7 +116,7 @@ async function getRelease(heroku: APIClient, app: string, releaseId: string): Pr
}

async function streamReleaseCommand(heroku: APIClient, targets: Array<Heroku.App>, promotion: any) {
if (targets.length !== 1 || targets.every(isComplete)) { // eslint-disable-line unicorn/no-array-callback-reference
if (targets.length !== 1 || targets.every(isComplete)) {
return pollPromotionStatus(heroku, promotion.id, false)
}

Expand Down Expand Up @@ -254,7 +254,7 @@ export default class Promote extends Command {
return memo
}, {})

if (promotionTargets.every(isSucceeded)) { // eslint-disable-line unicorn/no-array-callback-reference
if (promotionTargets.every(isSucceeded)) {
ux.log('\nPromotion successful')
} else {
ux.warn('\nPromotion to some apps failed')
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/commands/ps/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {APIClient, Command, flags} from '@heroku-cli/command'
import {ux} from '@oclif/core'
import * as Heroku from '@heroku-cli/schema'
import {sortBy, compact} from 'lodash'
import {HTTPError} from 'http-call'
import heredoc from 'tsheredoc'

const COST_MONTHLY: Record<string, number> = {
Expand Down Expand Up @@ -57,7 +56,6 @@ const displayFormation = async (heroku: APIClient, app: string) => {

return {
// this rule does not realize `size` isn't used on an array
/* eslint-disable unicorn/explicit-length-check */
type: color.green(d.type || ''),
size: color.cyan(d.size),
qty: color.yellow(`${d.quantity}`),
Expand Down
11 changes: 8 additions & 3 deletions packages/cli/test/unit/commands/addons/index.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ import * as Heroku from '@heroku-cli/schema'

describe('addons', function () {
describe('--all', function () {
const addons = [
fixtures.addons['www-db'], fixtures.addons['www-redis'], fixtures.addons['api-redis'],
]
let addons: Heroku.AddOn[]

beforeEach(function () {
addons = [
fixtures.addons['www-db'], fixtures.addons['www-redis'], fixtures.addons['api-redis'],
]
})

context('with add-ons', function () {
beforeEach(function () {
nock('https://api.heroku.com', {reqheaders: {'Accept-Expansion': 'addon_service,plan'}})
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/test/unit/commands/addons/open.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import Cmd from '../../../../src/commands/addons/open'
import * as path from 'node:path'

describe('The addons:open command', function () {
const urlOpenerStub = sinon.stub(Cmd, 'urlOpener').callsFake(async (_: string) => {})
// const urlOpenerStub = sinon.stub(Cmd, 'urlOpener').callsFake(async (_: string) => {})
let urlOpenerStub: sinon.SinonStub

beforeEach(function () {
urlOpenerStub = sinon.stub(Cmd, 'urlOpener').callsFake(async () => {})
urlOpenerStub.reset()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe('heroku certs:auto:enable', function () {

beforeEach(function () {
clock = lolex.install()
clock.setTimeout = function (fn, _timeout) {
clock.setTimeout = function (fn) {
fn()
return 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ describe('heroku certs:auto', function () {

beforeEach(function () {
clock = lolex.install()
clock.setTimeout = function (fn, _timeout) {
clock.setTimeout = function (fn) {
fn()
return 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('container:login', function () {
})

it('logs to the docker registry with an old version', async function () {
const version = sandbox.stub(DockerHelper, 'version').returns(new Promise(function (resolve, _) {
const version = sandbox.stub(DockerHelper, 'version').returns(new Promise(function (resolve) {
resolve([17, 0])
}))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {stdout, stderr} from 'stdout-stderr'
import {stdout} from 'stdout-stderr'
import Cmd from '../../../../src/commands/container/pull'
import runCommand from '../../../helpers/runCommand'
import * as sinon from 'sinon'
Expand Down

0 comments on commit 1a4de1f

Please sign in to comment.