Skip to content

Commit 3e933c3

Browse files
committed
chore: updates from devScripts
1 parent 12533fc commit 3e933c3

18 files changed

Lines changed: 888 additions & 1463 deletions

File tree

.eslintignore

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

.eslintrc.cjs

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

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from 'eslint-config-salesforce-typescript';

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,15 @@
143143
"@oclif/plugin-command-snapshot": "^5.3.34",
144144
"@oclif/test": "^4.1.21",
145145
"@salesforce/cli-plugins-testkit": "^5.3.64",
146-
"@salesforce/dev-scripts": "^11.0.4",
146+
"@salesforce/dev-scripts": "^13.0.2",
147147
"@salesforce/plugin-command-reference": "^3.1.131",
148148
"@salesforce/types": "^1.8.0",
149+
"@types/chai": "^4.3.17",
150+
"@types/mocha": "^10.0.10",
151+
"@types/node": "^18",
152+
"@types/sinon": "^10.0.20",
153+
"eslint": "^10.4.0",
154+
"eslint-config-salesforce-typescript": "^6.0.0",
149155
"eslint-plugin-sf-plugin": "^1.20.33",
150156
"oclif": "^4.23.29",
151157
"ts-node": "^10.9.2",
@@ -193,6 +199,7 @@
193199
"src/**/*.ts",
194200
"test/**/*.ts",
195201
"messages/**",
202+
"**/eslint.config.*",
196203
"**/.eslint*",
197204
"**/tsconfig.json"
198205
],

src/batcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export class Batcher {
141141
const newBatch = job.createBatch();
142142

143143
return new Promise((resolve, reject) => {
144-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
144+
145145
newBatch.on('error', (err: Error) => {
146146
// reword no external id error message to direct it to org user rather than api user
147147
if (err.message.startsWith('External ID was blank')) {
@@ -175,7 +175,7 @@ export class Batcher {
175175
);
176176

177177
if (!wait) {
178-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
178+
179179
newBatch.on(
180180
'queue',
181181
// we're using an async method on an event listener which doesn't fit the .on method parameter types

src/commands/data/delete/record.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default class Delete extends SfCommand<SaveResult> {
7272
? flags['target-org'].getConnection(flags['api-version']).tooling
7373
: flags['target-org'].getConnection(flags['api-version']);
7474
// "where flag" will be defined if sobjectId is not
75-
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id as string);
75+
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id);
7676
const result = await conn.sobject(flags.sobject).destroy(sObjectId);
7777
if (result.success) {
7878
this.log(messages.getMessage('deleteSuccess', [sObjectId]));

src/commands/data/get/record.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ export default class Get extends SfCommand<Record> {
7070
? flags['target-org'].getConnection(flags['api-version']).tooling
7171
: flags['target-org'].getConnection(flags['api-version']);
7272
try {
73-
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id as string);
73+
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id);
7474
const result = await conn.sobject(flags.sobject).retrieve(sObjectId);
7575
if (!this.jsonEnabled()) {
76-
logNestedObject(new Ux({ jsonEnabled: this.jsonEnabled() }), result as never);
76+
logNestedObject(new Ux({ jsonEnabled: this.jsonEnabled() }), result);
7777
}
7878
this.spinner.stop();
7979
return toAnyJson(result) as Record;

src/commands/data/query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const recursivelyFindColumns = (data: JsonArray): Field[] => {
258258
}
259259
columns.push(field);
260260
} else {
261-
columns.push({ fieldType: FieldType.field, name } as Field);
261+
columns.push({ fieldType: FieldType.field, name });
262262
}
263263
}
264264
return columns;

src/commands/data/update/record.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default class Update extends SfCommand<SaveResult> {
8686
? flags['target-org'].getConnection(flags['api-version']).tooling
8787
: flags['target-org'].getConnection(flags['api-version']);
8888
// oclif isn't smart of enough to know that if record-id is not set, then where is set
89-
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id as string);
89+
const sObjectId = flags['record-id'] ?? ((await query(conn, flags.sobject, flags.where as string)).Id);
9090
try {
9191
const updateObject = { ...stringToDictionary(flags.values), Id: sObjectId };
9292
const result = await conn

src/reporters/query/humanReporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ function prepData(
8484
const row: Record<string, unknown> = {};
8585
fields.forEach((field) => {
8686
if (field in record) {
87-
row[field] = (record[field] as string) ?? '';
87+
row[field] = (record[field]) ?? '';
8888
} else {
8989
// if not, try to find it query
90-
row[field] = (get(record, field) as string) ?? '';
90+
row[field] = (get(record, field)) ?? '';
9191
}
9292
});
9393
return row;

0 commit comments

Comments
 (0)