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
5 changes: 0 additions & 5 deletions .eslintrc.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from 'eslint-config-salesforce-typescript';

export default [{ ignores: ['test/nuts/repros/'] }, ...config];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@
},
"devDependencies": {
"@salesforce/cli-plugins-testkit": "^5.3.39",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/dev-scripts": "^13.0.1",
"@salesforce/schemas": "^1.10.3",
"@types/graceful-fs": "^4.1.9",
"esbuild": "^0.25.11",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^1.20.33",
"ts-node": "^10.9.2",
"ts-patch": "^3.3.0",
Expand Down Expand Up @@ -111,6 +113,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
5 changes: 1 addition & 4 deletions src/shared/local/localShadowRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,7 @@ export class ShadowRepo {
}

if (deletedFiles.length) {
// Using a cache here speeds up the performance by ~24.4%
let cache = {};
const cache = {};

for (const filepath of [...new Set(IS_WINDOWS ? deletedFiles.map(normalize).map(ensurePosix) : deletedFiles)]) {
try {
Expand All @@ -297,8 +296,6 @@ export class ShadowRepo {
redirectToCliRepoError(e);
}
}
// clear cache
cache = {};
}

try {
Expand Down
6 changes: 3 additions & 3 deletions src/shared/local/moveDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ const toFileInfo = async ({

const headRef = await git.resolveRef({ fs, dir: projectPath, gitdir: gitDir, ref: 'HEAD' });
const [addedInfo, deletedInfo] = await Promise.all([
await Promise.all(Array.from(added).map(getHashForAddedFile(projectPath))),
await Promise.all(Array.from(deleted).map(getHashFromActualFileContents(gitDir)(projectPath)(headRef))),
Promise.all(Array.from(added).map(getHashForAddedFile(projectPath))),
Promise.all(Array.from(deleted).map(getHashFromActualFileContents(gitDir)(projectPath)(headRef))),
]);

return { addedInfo, deletedInfo };
Expand Down Expand Up @@ -225,7 +225,7 @@ const resolveType =
.flatMap((filename) => {
try {
return resolver.getComponentsFromPath(filename);
} catch (e) {
} catch {
const logger = Logger.childFromRoot('ShadowRepo.compareTypes');
logger.warn(`unable to resolve ${filename}`);
return undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/localComponentSetArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const getComponentSets = ({
.getComponentsFromPath(resolve(projectPath, component.content))
.filter(isDefined)
.map((nonDeletedComponent) => componentSet.add(nonDeletedComponent));
} catch (e) {
} catch {
logger.warn(
`unable to find component at ${component.content}. That's ok if it was supposed to be deleted`
);
Expand All @@ -148,7 +148,7 @@ export const getComponentSets = ({
.flatMap((filename) => {
try {
return resolverForNonDeletes.getComponentsFromPath(resolve(projectPath, filename));
} catch (e) {
} catch {
logger.warn(`unable to resolve ${filename}`);
return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/metadataKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const registrySupportsType =
// this must use getTypeByName because findType doesn't support addressable child types (ex: customField!)
registry.getTypeByName(type);
return true;
} catch (e) {
} catch {
void Lifecycle.getInstance().emitWarning(`Unable to find type ${type} in registry`);
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/populateTypesAndNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const populateTypesAndNames =
.flatMap((filename) => {
try {
return resolver.getComponentsFromPath(filename);
} catch (e) {
} catch {
logger.warn(`unable to resolve ${filename}`);
return undefined;
}
Expand Down
1 change: 1 addition & 0 deletions src/shared/remote/remoteSourceTrackingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export class RemoteSourceTrackingService {
}

if (someResultsReturned && consecutiveEmptyResults >= CONSECUTIVE_EMPTY_POLLING_RESULT_LIMIT) {
// eslint-disable-next-line @typescript-eslint/only-throw-error -- NotRetryableError from ts-retry-promise doesn't extend Error
throw new NotRetryableError(`Polling found no results for ${consecutiveEmptyResults} consecutive attempts`);
}

Expand Down
14 changes: 7 additions & 7 deletions src/sourceTracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ export class SourceTracking extends AsyncCreatable {
*/
public async localChangesAsComponentSet(byPackageDir?: boolean): Promise<ComponentSet[]> {
const [projectConfig] = await Promise.all([
this.project.resolveProjectConfig() as {
this.project.resolveProjectConfig() as Promise<{
sourceApiVersion?: string;
pushPackageDirectoriesSequentially?: boolean;
},
}>,
this.ensureLocalTracking(),
]);
const sourceApiVersion = projectConfig.sourceApiVersion;
Expand Down Expand Up @@ -206,9 +206,9 @@ export class SourceTracking extends AsyncCreatable {
state: 'nondelete',
format: 'SourceComponent',
}),
this.project.resolveProjectConfig() as {
this.project.resolveProjectConfig() as Promise<{
sourceApiVersion?: string;
},
}>,
]);
const componentSet = new ComponentSet(
applyIgnore ? sourceBackedComponents.filter(noFileIsIgnored(this.forceIgnore)) : sourceBackedComponents,
Expand Down Expand Up @@ -321,7 +321,7 @@ export class SourceTracking extends AsyncCreatable {
.flatMap((filename) => {
try {
return resolver.getComponentsFromPath(filename);
} catch (e) {
} catch {
this.logger.warn(`unable to resolve ${filename}`);
return undefined;
}
Expand Down Expand Up @@ -705,8 +705,8 @@ export class SourceTracking extends AsyncCreatable {
// Events are attached to a singleton (sfdx-core's Lifecycle), so when
// instantiating `SourceTracking` multiple times in the same process we need
// each instance starts clean.
lifecycle.removeAllListeners('scopedPreDeploy')
lifecycle.removeAllListeners('scopedPreRetrieve')
lifecycle.removeAllListeners('scopedPreDeploy');
lifecycle.removeAllListeners('scopedPreRetrieve');

// the only thing STL uses pre events for is to check conflicts. So if you don't care about conflicts, don't listen!
if (!this.ignoreConflicts) {
Expand Down
9 changes: 0 additions & 9 deletions test/.eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions test/nuts/local/localTrackingFileMovesDecomposedChild.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { expect } from 'chai';
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { ShadowRepo } from '../../../src/shared/local/localShadowRepo';

/* eslint-disable no-unused-expressions */

describe('ignores moved files that are children of a decomposed metadata type', () => {
const FIELD = path.join('fields', 'Account__c.field-meta.xml');
let session: TestSession;
Expand Down
2 changes: 0 additions & 2 deletions test/nuts/local/localTrackingFileMovesImage.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { expect } from 'chai';
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { ShadowRepo } from '../../../src/shared/local/localShadowRepo';

/* eslint-disable no-unused-expressions */

describe('it detects image file moves ', () => {
const registry = new RegistryAccess();
let session: TestSession;
Expand Down
2 changes: 0 additions & 2 deletions test/nuts/local/localTrackingFileMovesScale.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import { expect } from 'chai';
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { ShadowRepo } from '../../../src/shared/local/localShadowRepo';

/* eslint-disable no-unused-expressions */

const dirCount = 20;
const classesPerDir = 50;
const classCount = dirCount * classesPerDir;
Expand Down
2 changes: 1 addition & 1 deletion test/nuts/local/localTrackingScenario.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe('end-to-end-test for local tracking', () => {
it('changes remain after bad commit (simulate a failed deploy)', async () => {
try {
await shouldThrow(repo.commitChanges({ deployedFiles: ['badFilename'] }));
} catch (err) {
} catch {
await repo.getStatus(true);
expect(await repo.getChangedRows()).to.have.lengthOf(3);
expect(await repo.getChangedFilenames()).to.have.lengthOf(3);
Expand Down
1 change: 0 additions & 1 deletion test/unit/localDetectMovedFiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import sinon from 'sinon';
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { ShadowRepo } from '../../src/shared/local/localShadowRepo';

/* eslint-disable no-unused-expressions */
config.truncateThreshold = 0;
afterEach(() => {
// Restore the default sandbox here
Expand Down
2 changes: 0 additions & 2 deletions test/unit/localShadowRepo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import sinon from 'sinon';
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
import { ShadowRepo } from '../../src/shared/local/localShadowRepo';

/* eslint-disable no-unused-expressions */

afterEach(() => {
// Restore the default sandbox here
sinon.restore();
Expand Down
1 change: 0 additions & 1 deletion test/unit/remote/remoteSourceTracking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable camelcase */

import { writeFile, mkdir, readFile } from 'node:fs/promises';
import { existsSync, rmSync } from 'node:fs';
Expand Down
Loading
Loading