Skip to content

Commit c53952c

Browse files
committed
fix: lint issues in SlasClientCommand and add pre-commit lint guidance
Fix prettier formatting and class member ordering in slas/client.ts. Add pre-commit checks section to AGENTS.md.
1 parent 44b67f0 commit c53952c

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,16 @@ See [CLI command development skill](./.claude/skills/cli-command-development/SKI
121121
- [Testing](./.claude/skills/testing/SKILL.md) - Mocha, Chai, MSW patterns
122122
- [Documentation](./.claude/skills/documentation/SKILL.md) - user guides, CLI reference, API docs
123123

124+
## Pre-Commit Checks
125+
126+
Before committing code, always run lint to catch formatting and style issues:
127+
128+
```bash
129+
pnpm run lint:agent
130+
```
131+
132+
This catches prettier formatting, import ordering, class member ordering (`perfectionist/sort-classes`), and other issues that will fail CI.
133+
124134
## Testing
125135

126136
See [testing skill](./.claude/skills/testing/SKILL.md) for patterns on writing tests with Mocha, Chai, and MSW.

packages/b2c-cli/src/utils/slas/client.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
import {Command, ux} from '@oclif/core';
77
import cliui from 'cliui';
88
import {OAuthCommand} from '@salesforce/b2c-tooling-sdk/cli';
9-
import {createSlasClient, getApiErrorMessage, DEFAULT_PUBLIC_CLIENT_ID, type SlasClient, type SlasComponents} from '@salesforce/b2c-tooling-sdk';
9+
import {
10+
createSlasClient,
11+
getApiErrorMessage,
12+
DEFAULT_PUBLIC_CLIENT_ID,
13+
type SlasClient,
14+
type SlasComponents,
15+
} from '@salesforce/b2c-tooling-sdk';
1016
import {t} from '../../i18n/index.js';
1117

1218
export type Client = SlasComponents['schemas']['Client'];
@@ -100,10 +106,6 @@ export function formatApiError(error: unknown, response: Response): string {
100106
* Provides common flags and helper methods.
101107
*/
102108
export abstract class SlasClientCommand<T extends typeof Command> extends OAuthCommand<T> {
103-
protected override getDefaultClientId(): string {
104-
return DEFAULT_PUBLIC_CLIENT_ID;
105-
}
106-
107109
/**
108110
* Ensure tenant exists, creating it if necessary.
109111
* This is required before creating SLAS clients.
@@ -171,6 +173,10 @@ export abstract class SlasClientCommand<T extends typeof Command> extends OAuthC
171173
}
172174
}
173175

176+
protected override getDefaultClientId(): string {
177+
return DEFAULT_PUBLIC_CLIENT_ID;
178+
}
179+
174180
/**
175181
* Get the SLAS client, ensuring short code is configured.
176182
*/

0 commit comments

Comments
 (0)