Skip to content

Commit 0b95e23

Browse files
bgagentclaude
andcommitted
style: apply eslint --fix from CI's self-mutation guard
CI runs `mise run build`, which invokes `eslint --fix` and then fails if the working tree changed (self-mutation guard). Three cosmetic lints needed applying: - Import-order: DynamoDBClient and CliError moved earlier in their files to satisfy alphabetic-by-package ordering - formatJson import added in alphabetic position in linear.ts - Three template literals with no interpolation converted to single-quoted strings in oauth-callback-server.ts and linear.ts (eslint quotes rule prefers single-quotes when no template variables are used) Pure mechanical fixes; no behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1e4788f commit 0b95e23

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

cdk/src/handlers/shared/linear-oauth-resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
* SOFTWARE.
1818
*/
1919

20+
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
2021
import {
2122
GetSecretValueCommand,
2223
PutSecretValueCommand,
2324
SecretsManagerClient,
2425
} from '@aws-sdk/client-secrets-manager';
25-
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
2626
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb';
2727
import { logger } from './logger';
2828

cli/src/commands/linear.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { Command } from 'commander';
3333
import { ApiClient } from '../api-client';
3434
import { loadConfig, loadCredentials } from '../config';
3535
import { CliError } from '../errors';
36+
import { formatJson } from '../format';
3637
import {
3738
buildAuthorizationUrl,
3839
computeExpiresAt,
@@ -42,7 +43,6 @@ import {
4243
StoredLinearOauthToken,
4344
} from '../linear-oauth';
4445
import { awaitOauthCallback, CALLBACK_URL } from '../oauth-callback-server';
45-
import { formatJson } from '../format';
4646

4747
/** Default label that triggers an ABCA task when applied to a Linear issue. */
4848
const DEFAULT_LABEL_FILTER = 'bgagent';
@@ -85,7 +85,7 @@ export function renderLinearAppTemplate(opts: LinearAppTemplateOptions = {}): st
8585
'',
8686
'Open https://linear.app/settings/api/applications/new and paste:',
8787
'',
88-
` Application name: bgagent`,
88+
' Application name: bgagent',
8989
` Developer name: ${developerName}`,
9090
` Developer URL: ${developerUrl}`,
9191
` Description: ${description}`,
@@ -97,7 +97,7 @@ export function renderLinearAppTemplate(opts: LinearAppTemplateOptions = {}): st
9797
' Public: OFF',
9898
' Client credentials: OFF',
9999
' Webhooks: ON ← REQUIRED for actor=app',
100-
` Webhook URL: https://example.com/placeholder ← any HTTPS URL`,
100+
' Webhook URL: https://example.com/placeholder ← any HTTPS URL',
101101
' (You do NOT need to subscribe to any events for the OAuth flow itself)',
102102
'',
103103
'Click Save, copy the Client ID and Client Secret, then return here.',
@@ -243,7 +243,7 @@ export function makeLinearCommand(): Command {
243243
.action((opts) => {
244244
if (opts.botName && !/\[bot\]$/.test(opts.botName)) {
245245
console.error(
246-
`Error: --bot-name must end with the literal "[bot]" suffix `
246+
'Error: --bot-name must end with the literal "[bot]" suffix '
247247
+ `(Linear requires this for actor=app). Got: ${opts.botName}`,
248248
);
249249
process.exit(1);
@@ -293,7 +293,7 @@ export function makeLinearCommand(): Command {
293293
if (!SLUG_RE.test(slug)) {
294294
throw new CliError(
295295
`Invalid workspace slug '${slug}'. Must be 4-50 chars matching [a-zA-Z0-9_-]. `
296-
+ `This is the Linear urlKey, e.g. 'acme' from linear.app/acme/...`,
296+
+ 'This is the Linear urlKey, e.g. \'acme\' from linear.app/acme/...',
297297
);
298298
}
299299
const config = loadConfig();
@@ -318,7 +318,7 @@ export function makeLinearCommand(): Command {
318318
if (missing.length > 0) {
319319
throw new CliError(
320320
`Stack '${stackName}' is missing outputs ${missing.join(', ')}. `
321-
+ `Re-deploy with the 2.0b CDK changes (mise //cdk:deploy).`,
321+
+ 'Re-deploy with the 2.0b CDK changes (mise //cdk:deploy).',
322322
);
323323
}
324324

@@ -333,7 +333,7 @@ export function makeLinearCommand(): Command {
333333
} catch (err) {
334334
throw new CliError(
335335
`Could not read Cognito sub from cached id_token: ${err instanceof Error ? err.message : String(err)}. `
336-
+ `Run \`bgagent login\` to refresh credentials.`,
336+
+ 'Run `bgagent login` to refresh credentials.',
337337
);
338338
}
339339

@@ -415,14 +415,14 @@ export function makeLinearCommand(): Command {
415415
// is updated separately to expose both shapes.
416416
if (!callback.code || !callback.state) {
417417
throw new CliError(
418-
`Localhost callback did not surface code/state. This indicates the callback `
419-
+ `server module is in legacy AgentCore-only mode; rebuild the CLI.`,
418+
'Localhost callback did not surface code/state. This indicates the callback '
419+
+ 'server module is in legacy AgentCore-only mode; rebuild the CLI.',
420420
);
421421
}
422422
if (callback.state !== state) {
423423
throw new CliError(
424424
`OAuth state mismatch (expected '${state}', got '${callback.state}'). `
425-
+ `Possible CSRF attack or stale tab — re-run setup.`,
425+
+ 'Possible CSRF attack or stale tab — re-run setup.',
426426
);
427427
}
428428

@@ -442,16 +442,16 @@ export function makeLinearCommand(): Command {
442442
const identity = await queryLinearIdentity(`Bearer ${tokenResponse.access_token}`);
443443
if (!identity) {
444444
throw new CliError(
445-
`Linear viewer query rejected the access token. This is unexpected — token was just issued. `
446-
+ `Re-run \`bgagent linear setup\` if Linear's API is recovering from a transient outage.`,
445+
'Linear viewer query rejected the access token. This is unexpected — token was just issued. '
446+
+ 'Re-run `bgagent linear setup` if Linear\'s API is recovering from a transient outage.',
447447
);
448448
}
449449
console.log(` ✓ (${identity.organization.name ?? identity.organization.urlKey ?? identity.organization.id})`);
450450

451451
if (identity.organization.urlKey && identity.organization.urlKey !== slug) {
452452
console.log(
453453
` ⚠ Slug '${slug}' does not match Linear's urlKey '${identity.organization.urlKey}'. `
454-
+ `Re-run with the correct slug to keep the registry key aligned with Linear.`,
454+
+ 'Re-run with the correct slug to keep the registry key aligned with Linear.',
455455
);
456456
}
457457

@@ -535,7 +535,7 @@ export function makeLinearCommand(): Command {
535535
}
536536
if (!webhookSecret.startsWith('lin_wh_')) {
537537
throw new CliError(
538-
`Webhook signing secrets start with 'lin_wh_'. Got something different — re-check the Linear webhook detail page.`,
538+
'Webhook signing secrets start with \'lin_wh_\'. Got something different — re-check the Linear webhook detail page.',
539539
);
540540
}
541541
await sm.send(new PutSecretValueCommand({

cli/src/oauth-callback-server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ export async function awaitOauthCallback(
170170
res.once('finish', () => {
171171
settle(() => reject(new CliError(
172172
`OAuth callback received without session_id or code/state. Got URL: ${req.url}. `
173-
+ `If you saw an error on Linear's consent screen, that's likely the root cause; `
174-
+ `re-run \`bgagent linear setup\` after fixing the Linear app config.`,
173+
+ 'If you saw an error on Linear\'s consent screen, that\'s likely the root cause; '
174+
+ 're-run `bgagent linear setup` after fixing the Linear app config.',
175175
)));
176176
});
177177
res.end(FAILURE_HTML);
@@ -190,7 +190,7 @@ export async function awaitOauthCallback(
190190
if ('code' in err && err.code === 'EADDRINUSE') {
191191
settle(() => reject(new CliError(
192192
`Port ${CALLBACK_PORT} is in use. Another bgagent setup may be running, `
193-
+ `or another local service has bound it. Stop it and re-run \`bgagent linear setup\`.`,
193+
+ 'or another local service has bound it. Stop it and re-run `bgagent linear setup`.',
194194
)));
195195
} else {
196196
settle(() => reject(err));
@@ -200,8 +200,8 @@ export async function awaitOauthCallback(
200200
const timer = setTimeout(() => {
201201
settle(() => reject(new CliError(
202202
`Timed out waiting ${Math.round(timeoutMs / 1000)}s for OAuth callback. `
203-
+ `Either you closed the browser before authorizing, or Linear's consent flow `
204-
+ `couldn't complete. Re-run \`bgagent linear setup\`.`,
203+
+ 'Either you closed the browser before authorizing, or Linear\'s consent flow '
204+
+ 'couldn\'t complete. Re-run `bgagent linear setup`.',
205205
)));
206206
}, timeoutMs);
207207
timer.unref();

cli/test/linear-oauth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* SOFTWARE.
1818
*/
1919

20+
import { CliError } from '../src/errors';
2021
import {
2122
buildAuthorizationUrl,
2223
computeExpiresAt,
@@ -29,7 +30,6 @@ import {
2930
linearOauthSecretName,
3031
refreshAccessToken,
3132
} from '../src/linear-oauth';
32-
import { CliError } from '../src/errors';
3333

3434
describe('linearOauthSecretName', () => {
3535
test('prefixes with bgagent-linear-oauth-', () => {

0 commit comments

Comments
 (0)