Skip to content

Commit 6e37e79

Browse files
svc-cli-botjfeingold35WillieRuemmele
authored
refactor: devScripts update (#1540)
* chore: updates from devScripts * fix: rejiggered eslint.config.mjs (W-23928423) --------- Co-authored-by: Jamie Feingold <jfeingold@salesforce.com> Co-authored-by: Willie Ruemmele <willieruemmele@gmail.com>
1 parent cf8cbf9 commit 6e37e79

12 files changed

Lines changed: 1292 additions & 1519 deletions

File tree

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import tsconfigs from 'eslint-config-salesforce-typescript';
2+
import plugin from 'eslint-plugin-sf-plugin';
3+
4+
const configs = [
5+
...tsconfigs,
6+
...plugin.configs.recommended,
7+
{
8+
rules: {
9+
'@typescript-eslint/no-unused-vars': [
10+
'error',
11+
{
12+
argsIgnorePattern: '^_',
13+
varsIgnorePattern: '^_',
14+
caughtErrorsIgnorePattern: '^_',
15+
},
16+
],
17+
'jsdoc/newline-after-description': 'off',
18+
},
19+
},
20+
];
21+
22+
export default configs;

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@
2121
"devDependencies": {
2222
"@oclif/plugin-command-snapshot": "^5.3.20",
2323
"@salesforce/cli-plugins-testkit": "^5.3.66",
24-
"@salesforce/dev-scripts": "^11.0.4",
24+
"@salesforce/dev-scripts": "^13.0.2",
2525
"@salesforce/plugin-command-reference": "^3.1.132",
2626
"@salesforce/ts-sinon": "^1.4.34",
27+
"@types/chai": "^4.3.17",
28+
"@types/mocha": "^10.0.10",
29+
"@types/node": "^18",
30+
"@types/sinon": "^10.0.20",
2731
"@types/which": "^3",
28-
"eslint-plugin-sf-plugin": "^1.20.33",
32+
"eslint": "^10.4.0",
33+
"eslint-config-salesforce-typescript": "^6.0.0",
34+
"eslint-plugin-sf-plugin": "^3.0.0",
2935
"oclif": "^4.23.16",
3036
"ts-node": "^10.9.2",
3137
"typescript": "^5.5.4"
@@ -154,6 +160,7 @@
154160
"src/**/*.ts",
155161
"test/**/*.ts",
156162
"messages/**",
163+
"**/eslint.config.*",
157164
"**/.eslint*",
158165
"**/tsconfig.json"
159166
],

src/commands/org/list/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default class ListAuth extends SfCommand<AuthListResults> {
7777
}
7878

7979
return mappedAuths;
80-
} catch (err) {
80+
} catch (_err) {
8181
this.log(messages.getMessage('noResultsFound'));
8282
return [];
8383
}

src/commands/org/login/jwt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export default class LoginJwt extends SfCommand<AuthFields> {
9595
public async run(): Promise<AuthFields> {
9696
const { flags } = await this.parse(LoginJwt);
9797
this.flags = flags;
98+
// eslint-disable-next-line no-useless-assignment -- assignment isn't actually useless.
9899
let result: AuthFields = {};
99100

100101
if (await common.shouldExitCommand(flags['no-prompt'])) return {};

src/commands/org/login/web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default class LoginWeb extends SfCommand<AuthFields> {
223223
}
224224

225225
// leave it because it's stubbed in the test
226-
// eslint-disable-next-line class-methods-use-this
226+
227227
private async executeLoginFlow({
228228
oauthConfig,
229229
browser,

src/hooks/diagnostics.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ type NpmExplanation = {
9494

9595
// Detects if the auth key used is crypto v1 or v2
9696
// Detects if the SF_CRYPTO_V2 env var is set and if it matches the key crypto version
97+
// eslint-disable-next-line complexity
9798
const cryptoVersionTest = async (doctor: SfDoctor): Promise<void> => {
9899
getLogger().debug('Running Crypto Version tests');
99100

@@ -164,6 +165,7 @@ const cryptoVersionTest = async (doctor: SfDoctor): Promise<void> => {
164165

165166
// Inspect CLI install and plugins to ensure all versions of `@salesforce/core` can support v2 crypto.
166167
// This uses `npm explain @salesforce/core` to ensure all versions are greater than 6.6.0.
168+
// eslint-disable-next-line complexity
167169
const supportsCliV2Crypto = async (doctor: SfDoctor): Promise<boolean> => {
168170
const diagnosis: SfDoctorDiagnosis = doctor.getDiagnosis();
169171
let coreSupportsV2 = false;

test/.eslintrc.cjs

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/commands/org/login/login.jwt.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ describe('org:login:jwt', () => {
205205
await prepareStubs({ existingAuth: true });
206206
try {
207207
await LoginJwt.run(['-u', testData.username, '-f', 'path/to/key.json', '-i', '123456', '--json']);
208-
} catch (e) {
208+
} catch (_e) {
209209
expect.fail('Should not have thrown an error');
210210
}
211211
});

0 commit comments

Comments
 (0)