Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'eslint-config-salesforce-typescript';
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.3.20",
"@salesforce/cli-plugins-testkit": "^5.3.57",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/dev-scripts": "^13.0.2",
"@salesforce/plugin-command-reference": "^3.1.101",
"@salesforce/ts-sinon": "^1.4.34",
"@types/chai": "^4.3.17",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/sinon": "^10.0.20",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^1.20.33",
"oclif": "^4.23.16",
"ts-node": "^10.9.2",
Expand Down Expand Up @@ -152,6 +158,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
2 changes: 1 addition & 1 deletion src/commands/org/list/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ListAuth extends SfCommand<AuthListResults> {
}

return mappedAuths;
} catch (err) {
} catch {
this.log(messages.getMessage('noResultsFound'));
return [];
}
Expand Down
4 changes: 1 addition & 3 deletions src/commands/org/login/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default class LoginJwt extends SfCommand<AuthFields> {

public static readonly flags = {
username: Flags.string({
// eslint-disable-next-line sf-plugin/dash-o
char: 'o',
summary: messages.getMessage('flags.username.summary'),
required: true,
Expand Down Expand Up @@ -95,10 +94,9 @@ export default class LoginJwt extends SfCommand<AuthFields> {
public async run(): Promise<AuthFields> {
const { flags } = await this.parse(LoginJwt);
this.flags = flags;
let result: AuthFields = {};

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

let result: AuthFields;
try {
const authInfo = await this.initAuthInfo();
await authInfo.handleAliasAndDefaultSettings({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/org/login/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default class LoginWeb extends SfCommand<AuthFields> {
}

// leave it because it's stubbed in the test
// eslint-disable-next-line class-methods-use-this
private async executeLoginFlow({
oauthConfig,
browser,
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let execFile: PromisifiedExecFile;

export const hook: HookFunction = async (options) => {
getLogger().debug(`Running SfDoctor diagnostics for ${pluginName}`);
execFile = util.promisify(childProcess.execFile) as unknown as PromisifiedExecFile;
execFile = util.promisify(childProcess.execFile);
try {
await execFile('npm', ['-v']);
return await Promise.all([cryptoVersionTest(options.doctor)]);
Expand Down Expand Up @@ -79,6 +79,7 @@ type NpmExplanation = {

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

Expand Down Expand Up @@ -149,6 +150,7 @@ const cryptoVersionTest = async (doctor: SfDoctor): Promise<void> => {

// Inspect CLI install and plugins to ensure all versions of `@salesforce/core` can support v2 crypto.
// This uses `npm explain @salesforce/core` to ensure all versions are greater than 6.6.0.
// eslint-disable-next-line complexity
const supportsCliV2Crypto = async (doctor: SfDoctor): Promise<boolean> => {
const diagnosis: SfDoctorDiagnosis = doctor.getDiagnosis();
let coreSupportsV2 = false;
Expand Down
19 changes: 0 additions & 19 deletions test/.eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions test/commands/0-scratch-identify.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import * as path from 'node:path';
import { expect } from 'chai';

Expand Down
1 change: 1 addition & 0 deletions test/commands/org/list/auth.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
import { Env } from '@salesforce/kit';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/list/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup';
import { expect } from 'chai';
import { AuthInfo } from '@salesforce/core';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/access-token.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { execCmd, TestSession, prepareForJwt } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
import { Env } from '@salesforce/kit';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/access-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import { Readable } from 'node:stream';
import { AuthFields, AuthInfo, StateAggregator } from '@salesforce/core';
import { assert, expect } from 'chai';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/login.jwt.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import path from 'node:path';
import { execCmd, TestSession, prepareForJwt } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
Expand Down
3 changes: 2 additions & 1 deletion test/commands/org/login/login.jwt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import { AuthFields, AuthInfo, SfError } from '@salesforce/core';
import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup';
import { StubbedType, stubInterface } from '@salesforce/ts-sinon';
Expand Down Expand Up @@ -205,7 +206,7 @@ describe('org:login:jwt', () => {
await prepareStubs({ existingAuth: true });
try {
await LoginJwt.run(['-u', testData.username, '-f', 'path/to/key.json', '-i', '123456', '--json']);
} catch (e) {
} catch {
expect.fail('Should not have thrown an error');
}
});
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/login.sfdx-url.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { execCmd, prepareForAuthUrl, TestSession } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
import { Env } from '@salesforce/kit';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/login.sfdx-url.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import fs from 'node:fs/promises';
import { AuthFields, AuthInfo } from '@salesforce/core';
import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/login/login.web.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


/* eslint-disable @typescript-eslint/ban-ts-comment */

import { Config } from '@oclif/core';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/logout.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { execCmd, TestSession, prepareForJwt } from '@salesforce/cli-plugins-testkit';
import { expect } from 'chai';
import { Env } from '@salesforce/kit';
Expand Down
1 change: 1 addition & 0 deletions test/commands/org/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import { AuthRemover, ConfigContents, Global, Mode, Messages } from '@salesforce/core';
import { MockTestOrgData, TestContext } from '@salesforce/core/testSetup';
import { expect } from 'chai';
Expand Down
3 changes: 2 additions & 1 deletion test/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


import { ConfigContents, SfdcUrl, SfProject, Global, Mode } from '@salesforce/core';
import { assert, expect } from 'chai';
import { TestContext, uniqid } from '@salesforce/core/testSetup';
Expand All @@ -25,7 +26,7 @@ const projectSetup = async ($$: TestContext, inProject = true, contents?: Config
if (contents) {
$$.setConfigStubContents('SfProjectJson', contents);
if ($$.configStubs.SfProjectJson) {
// eslint-disable-next-line @typescript-eslint/require-await
$$.configStubs.SfProjectJson.retrieveContents = async (): Promise<ConfigContents> => contents;
}
}
Expand Down
1 change: 1 addition & 0 deletions test/hooks/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import util from 'node:util';
import fs from 'node:fs';
import { expect } from 'chai';
Expand Down
Loading
Loading