Skip to content

Commit a51d82e

Browse files
authored
Enforce sort-classes and unused-disable-directives as errors (#400)
perfectionist/sort-classes was warn-level and lint:agent passes --quiet, so class-member order drift was silently fixable but never blocked CI. Same for unused eslint-disable directives. Promote both to error and apply the pending --fix output across commands and tests.
1 parent 18471af commit a51d82e

22 files changed

Lines changed: 66 additions & 69 deletions

File tree

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const oclifRules = {
5252
'perfectionist/sort-interfaces': 'off',
5353
'perfectionist/sort-named-exports': 'off',
5454
'perfectionist/sort-named-imports': 'off',
55-
'perfectionist/sort-classes': 'warn',
55+
'perfectionist/sort-classes': 'error',
5656
// Disable stylistic rules that conflict with our style
5757
'@stylistic/lines-between-class-members': 'off',
5858
'@stylistic/padding-line-between-statements': 'off',

packages/b2c-cli/eslint.config.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ export default [
3434
header: headerPlugin,
3535
},
3636
linterOptions: {
37-
// Downgrade to warn - import/namespace behaves inconsistently across environments
38-
// when parsing CJS modules like marked-terminal
39-
reportUnusedDisableDirectives: 'warn',
37+
reportUnusedDisableDirectives: 'error',
4038
},
4139
rules: {
4240
'header/header': ['error', 'block', copyrightHeader],

packages/b2c-cli/src/commands/auth/client/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import {t} from '../../../i18n/index.js';
2121
* Use --renew to enable automatic token renewal for later use with `auth client renew`.
2222
*/
2323
export default class AuthClient extends BaseCommand<typeof AuthClient> {
24-
static hiddenAliases = ['client:auth'];
25-
2624
static description = t('commands.auth.client.description', 'Authenticate an API client and save session');
2725

2826
static examples = [
@@ -79,6 +77,8 @@ export default class AuthClient extends BaseCommand<typeof AuthClient> {
7977
}),
8078
};
8179

80+
static hiddenAliases = ['client:auth'];
81+
8282
protected override loadConfiguration() {
8383
const scopes = this.flags['auth-scope'] as string[] | undefined;
8484
return loadConfig(

packages/b2c-cli/src/commands/auth/client/renew.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {t} from '../../../i18n/index.js';
1919
* to client_credentials grant using the stored base64-encoded client:secret.
2020
*/
2121
export default class AuthClientRenew extends BaseCommand<typeof AuthClientRenew> {
22-
static hiddenAliases = ['client:auth:renew'];
23-
2422
static description = t('commands.auth.client.renew.description', 'Renew the client authentication token');
2523

2624
static examples = ['<%= config.bin %> <%= command.id %>'];
@@ -34,6 +32,8 @@ export default class AuthClientRenew extends BaseCommand<typeof AuthClientRenew>
3432
}),
3533
};
3634

35+
static hiddenAliases = ['client:auth:renew'];
36+
3737
protected override loadConfiguration() {
3838
return loadConfig(
3939
{accountManagerHost: this.flags['account-manager-host'] as string | undefined},

packages/b2c-cli/src/commands/auth/client/token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ interface AuthClientTokenOutput {
2525
* Mirrors sfcc-ci `client:auth:token` command behavior.
2626
*/
2727
export default class AuthClientToken extends BaseCommand<typeof AuthClientToken> {
28-
static hiddenAliases = ['client:auth:token'];
29-
3028
static description = t(
3129
'commands.auth.client.token.description',
3230
'Return the current authentication token (stateful)',
@@ -36,6 +34,8 @@ export default class AuthClientToken extends BaseCommand<typeof AuthClientToken>
3634

3735
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --json'];
3836

37+
static hiddenAliases = ['client:auth:token'];
38+
3939
async run(): Promise<AuthClientTokenOutput> {
4040
this.logger.debug('[StatefulAuth] Reading stored session from stateful store');
4141

packages/b2c-cli/src/commands/auth/login.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import {t, withDocs} from '../../i18n/index.js';
1515
* until it expires or you run auth:logout.
1616
*/
1717
export default class AuthLogin extends BaseCommand<typeof AuthLogin> {
18-
static hiddenAliases = ['auth:login'];
19-
2018
static args = {
2119
clientId: Args.string({
2220
description: 'Client ID for OAuth (falls back to SFCC_CLIENT_ID env var)',
@@ -48,6 +46,8 @@ export default class AuthLogin extends BaseCommand<typeof AuthLogin> {
4846
}),
4947
};
5048

49+
static hiddenAliases = ['auth:login'];
50+
5151
protected override loadConfiguration() {
5252
const scopes = this.flags['auth-scope'] as string[] | undefined;
5353
return loadConfig(

packages/b2c-cli/src/commands/auth/logout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import {t, withDocs} from '../../i18n/index.js';
1313
* (client credentials or implicit) when configured.
1414
*/
1515
export default class AuthLogout extends BaseCommand<typeof AuthLogout> {
16-
static hiddenAliases = ['auth:logout'];
17-
1816
static description = withDocs(
1917
t('commands.auth.logout.description', 'Clear stored session (stateful auth)'),
2018
'/cli/auth.html#b2c-auth-logout',
2119
);
2220

2321
static examples = ['<%= config.bin %> <%= command.id %>'];
2422

23+
static hiddenAliases = ['auth:logout'];
24+
2525
async run(): Promise<void> {
2626
clearStoredSession();
2727
this.log(t('commands.auth.logout.success', 'Logged out. Stored session cleared.'));

packages/b2c-cli/src/commands/cap/pull.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ import {
1414
import {t, withDocs} from '../../i18n/index.js';
1515

1616
export default class CapPull extends JobCommand<typeof CapPull> {
17-
static description = withDocs(
18-
t('commands.cap.pull.description', 'Pull installed Commerce Apps from a B2C Commerce instance'),
19-
'/cli/cap.html#b2c-cap-pull',
20-
);
21-
2217
static args = {
2318
appName: Args.string({
2419
description: 'Commerce App feature name to pull (e.g. avalara-tax). If omitted, pulls all registry apps.',
2520
required: false,
2621
}),
2722
};
2823

24+
static description = withDocs(
25+
t('commands.cap.pull.description', 'Pull installed Commerce Apps from a B2C Commerce instance'),
26+
'/cli/cap.html#b2c-cap-pull',
27+
);
28+
2929
static enableJsonFlag = true;
3030

3131
static examples = [

packages/b2c-cli/src/commands/code/activate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import {activateCodeVersion, reloadCodeVersion} from '@salesforce/b2c-tooling-sd
99
import {t, withDocs} from '../../i18n/index.js';
1010

1111
export default class CodeActivate extends InstanceCommand<typeof CodeActivate> {
12-
static hiddenAliases = ['code:activate'];
13-
1412
static args = {
1513
codeVersion: Args.string({
1614
description: 'Code version ID to activate',
@@ -39,6 +37,8 @@ export default class CodeActivate extends InstanceCommand<typeof CodeActivate> {
3937
}),
4038
};
4139

40+
static hiddenAliases = ['code:activate'];
41+
4242
async run(): Promise<void> {
4343
this.requireOAuthCredentials();
4444

packages/b2c-cli/src/commands/code/delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import {t, withDocs} from '../../i18n/index.js';
1010
import {confirm} from '../../prompts.js';
1111

1212
export default class CodeDelete extends InstanceCommand<typeof CodeDelete> {
13-
static hiddenAliases = ['code:delete'];
14-
1513
static args = {
1614
codeVersion: Args.string({
1715
description: 'Code version ID to delete',
@@ -39,6 +37,8 @@ export default class CodeDelete extends InstanceCommand<typeof CodeDelete> {
3937
}),
4038
};
4139

40+
static hiddenAliases = ['code:delete'];
41+
4242
protected operations = {
4343
confirm,
4444
deleteCodeVersion,

0 commit comments

Comments
 (0)