Skip to content

Commit 7e84cbf

Browse files
authored
refactor: apply lint formatting to auth through features commands (#3665)
* refactor: apply lint formatting to auth through features commands Applies automated lint formatting to command files in preparation for migration to eslint 9. Changes include import ordering, class property ordering, object property ordering, and whitespace cleanup. Affected command groups: auth, authorizations, autocomplete, buildpacks, certs, ci, clients, config, console, container, dashboard, domains, drains, features. * minor lint adjustment
1 parent 1debe53 commit 7e84cbf

79 files changed

Lines changed: 546 additions & 761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/commands/auth/2fa/disable.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ export default class Auth2faGenerate extends Command {
77
'twofactor:disable',
88
'2fa:disable',
99
]
10-
1110
static description = 'disables 2fa on account'
12-
1311
static example = `${color.command('heroku auth:2fa:disable')}`
1412

1513
async run() {

src/commands/auth/2fa/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {ux} from '@oclif/core/ux'
55

66
export default class TwoFactor extends Command {
77
static aliases = ['2fa', 'twofactor']
8-
98
static description = 'check 2fa status'
109

1110
async run() {

src/commands/auth/login.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import * as color from '@heroku/heroku-cli-util/color'
44

55
export default class Login extends Command {
66
static aliases = ['login']
7-
87
static description = 'login with your Heroku credentials'
9-
108
static flags = {
119
browser: flags.string({description: 'browser to open SSO with (example: "firefox", "safari")'}),
1210
'expires-in': flags.integer({char: 'e', description: 'duration of token in seconds (default 30 days)'}),

src/commands/auth/whoami.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ export default class AuthWhoami extends Command {
2323
}
2424
}
2525
}
26-

src/commands/authorizations/create.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import {display} from '../../lib/authorizations/authorizations.js'
99

1010
export default class AuthorizationsCreate extends Command {
1111
static description = 'create a new OAuth authorization'
12-
1312
static examples = [
1413
color.command('heroku authorizations:create --description "For use with Anvil"'),
1514
]
16-
1715
static flags = {
1816
description: flags.string({char: 'd', description: 'set a custom authorization'}),
1917
'expires-in': flags.string({char: 'e', description: 'set expiration in seconds (default no expiration)'}),

src/commands/authorizations/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import {ux} from '@oclif/core/ux'
55

66
export default class AuthorizationsIndex extends Command {
77
static description = 'list OAuth authorizations'
8-
98
static examples = [
109
color.command('heroku authorizations'),
1110
]
12-
1311
static flags = {
1412
json: flags.boolean({char: 'j', description: 'output in json format'}),
1513
}

src/commands/authorizations/info.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
import {Command, flags} from '@heroku-cli/command'
22
import * as Heroku from '@heroku-cli/schema'
3-
import {Args} from '@oclif/core'
43
import {hux} from '@heroku/heroku-cli-util'
4+
import {Args} from '@oclif/core'
55

66
import {display} from '../../lib/authorizations/authorizations.js'
77

88
export default class AuthorizationsInfo extends Command {
9+
static args = {
10+
id: Args.string({description: 'ID of the authorization', required: true}),
11+
}
912
static description = 'show an existing OAuth authorization'
10-
1113
static flags = {
1214
json: flags.boolean({char: 'j', description: 'output in json format'}),
1315
}
1416

15-
static args = {
16-
id: Args.string({required: true, description: 'ID of the authorization'}),
17-
}
18-
1917
async run() {
2018
const {args, flags} = await this.parse(AuthorizationsInfo)
2119

22-
const {body: authentication} = await this.heroku.get<Heroku.OAuthAuthorization>(
23-
`/oauth/authorizations/${args.id}`,
24-
)
20+
const {body: authentication} = await this.heroku.get<Heroku.OAuthAuthorization>(`/oauth/authorizations/${args.id}`)
2521

2622
if (flags.json) {
2723
hux.styledJSON(authentication)

src/commands/authorizations/revoke.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ import {Args, ux} from '@oclif/core'
55

66
export default class AuthorizationsRevoke extends Command {
77
static aliases = ['authorizations:destroy']
8-
98
static args = {
109
id: Args.string({description: 'ID of the authorization', required: true}),
1110
}
12-
1311
static description = 'revoke OAuth authorization'
14-
1512
static examples = [
1613
color.command('heroku authorizations:revoke 105a7bfa-34c3-476e-873a-b1ac3fdc12fb'),
1714
]
@@ -20,9 +17,7 @@ export default class AuthorizationsRevoke extends Command {
2017
const {args} = await this.parse(AuthorizationsRevoke)
2118

2219
ux.action.start('Revoking OAuth Authorization')
23-
const {body: auth} = await this.heroku.delete<Heroku.OAuthAuthorization>(
24-
`/oauth/authorizations/${encodeURIComponent(args.id)}`,
25-
)
20+
const {body: auth} = await this.heroku.delete<Heroku.OAuthAuthorization>(`/oauth/authorizations/${encodeURIComponent(args.id)}`)
2621
ux.action.stop(`done, revoked authorization from ${color.cyan(auth.description)}`)
2722
}
2823
}

src/commands/authorizations/rotate.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ import {Args, ux} from '@oclif/core'
55
import {display} from '../../lib/authorizations/authorizations.js'
66

77
export default class AuthorizationsRotate extends Command {
8-
static description = 'updates an OAuth authorization token'
9-
108
static args = {
11-
id: Args.string({required: true, description: 'ID of the authorization'}),
9+
id: Args.string({description: 'ID of the authorization', required: true}),
1210
}
11+
static description = 'updates an OAuth authorization token'
1312

1413
async run() {
1514
const {args} = await this.parse(AuthorizationsRotate)
1615

1716
ux.action.start('Rotating OAuth Authorization')
18-
const {body: authorization} = await this.heroku.post<Heroku.OAuthAuthorization>(
19-
`/oauth/authorizations/${encodeURIComponent(args.id)}/actions/regenerate-tokens`,
20-
)
17+
const {body: authorization} = await this.heroku.post<Heroku.OAuthAuthorization>(`/oauth/authorizations/${encodeURIComponent(args.id)}/actions/regenerate-tokens`)
2118
ux.action.stop()
2219

2320
display(authorization)

src/commands/authorizations/update.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ import {Args, ux} from '@oclif/core'
55
import {display} from '../../lib/authorizations/authorizations.js'
66

77
export default class AuthorizationsUpdate extends Command {
8+
static args = {
9+
id: Args.string({description: 'ID of the authorization', required: true}),
10+
}
811
static description = 'updates an OAuth authorization'
9-
1012
static flags = {
13+
'client-id': flags.string({dependsOn: ['client-secret'], description: 'identifier of OAuth client to set'}),
14+
'client-secret': flags.string({dependsOn: ['client-id'], description: 'secret of OAuth client to set'}),
1115
description: flags.string({char: 'd', description: 'set a custom authorization description'}),
12-
'client-id': flags.string({description: 'identifier of OAuth client to set', dependsOn: ['client-secret']}),
13-
'client-secret': flags.string({description: 'secret of OAuth client to set', dependsOn: ['client-id']}),
14-
}
15-
16-
static args = {
17-
id: Args.string({required: true, description: 'ID of the authorization'}),
1816
}
1917

2018
async run() {
@@ -34,8 +32,8 @@ export default class AuthorizationsUpdate extends Command {
3432
`/oauth/authorizations/${args.id}`,
3533
{
3634
body: {
37-
description: flags.description,
3835
client,
36+
description: flags.description,
3937
},
4038
},
4139
)

0 commit comments

Comments
 (0)