Skip to content

Commit 8827da2

Browse files
chore: fix warnings
1 parent e7d212b commit 8827da2

15 files changed

+27
-30
lines changed

src/client/metadataApiDeploy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export class MetadataApiDeploy extends MetadataTransfer<
152152
}
153153
const connection = await this.getConnection();
154154
// Recasting to use the project's version of the type
155-
return connection.metadata.checkDeployStatus(this.id, true) as unknown as MetadataApiDeployStatus;
155+
return (await connection.metadata.checkDeployStatus(this.id, true)) as unknown as MetadataApiDeployStatus;
156156
}
157157

158158
/**

src/client/metadataApiRetrieve.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class RetrieveResult implements MetadataTransferResult {
4141
* @param response The metadata retrieve response from the server
4242
* @param components The ComponentSet of retrieved source components
4343
* @param localComponents The ComponentSet used to create the retrieve request
44+
* @param partialDeleteFileResponses any partially deleted file responses
4445
*/
4546
public constructor(
4647
public readonly response: MetadataApiRetrieveStatus,

src/client/metadataTransfer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export abstract class MetadataTransfer<
4646
private transferId: Options['id'];
4747
private event = new EventEmitter();
4848
private usernameOrConnection: string | Connection;
49-
private apiVersion?: string;
49+
private readonly apiVersion?: string;
5050

5151
public constructor({ usernameOrConnection, components, apiVersion, id }: Options) {
5252
this.usernameOrConnection = usernameOrConnection;

src/convert/metadataConverter.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export class MetadataConverter {
2828
public static readonly DESTRUCTIVE_CHANGES_POST_XML_FILE = 'destructiveChangesPost.xml';
2929
public static readonly DESTRUCTIVE_CHANGES_PRE_XML_FILE = 'destructiveChangesPre.xml';
3030
public static readonly DEFAULT_PACKAGE_PREFIX = 'metadataPackage';
31-
32-
private registry: RegistryAccess;
31+
private readonly registry: RegistryAccess;
3332

3433
public constructor(registry = new RegistryAccess()) {
3534
this.registry = registry;
@@ -42,9 +41,7 @@ export class MetadataConverter {
4241
): Promise<ConvertResult> {
4342
try {
4443
const cs = comps instanceof ComponentSet ? comps : new ComponentSet(comps, this.registry);
45-
const components = (
46-
(comps instanceof ComponentSet ? Array.from(comps.getSourceComponents()) : comps) as SourceComponent[]
47-
).filter((comp) => comp.type.isAddressable !== false);
44+
const components = cs.getSourceComponents().filter((comp) => comp.type.isAddressable !== false);
4845

4946
if (output.type !== 'merge' && output.packageName) {
5047
cs.fullName = output.packageName;

src/convert/streams.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export abstract class ComponentWriter extends Writable {
118118
protected rootDestination?: SourcePath;
119119
protected logger: Logger;
120120

121-
public constructor(rootDestination?: SourcePath) {
121+
protected constructor(rootDestination?: SourcePath) {
122122
super({ objectMode: true });
123123
this.rootDestination = rootDestination;
124124
this.logger = Logger.childFromRoot(this.constructor.name);

src/convert/transformers/metadataTransformerFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Messages.importMessagesDirectory(__dirname);
2020
const messages = Messages.loadMessages('@salesforce/source-deploy-retrieve', 'sdr');
2121

2222
export class MetadataTransformerFactory {
23-
private registry: RegistryAccess;
24-
private context: ConvertContext;
23+
private readonly registry: RegistryAccess;
24+
private readonly context: ConvertContext;
2525

2626
public constructor(registry: RegistryAccess, context = new ConvertContext()) {
2727
this.registry = registry;

src/registry/registryAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Messages.importMessagesDirectory(__dirname);
1717
const messages = Messages.loadMessages('@salesforce/source-deploy-retrieve', 'sdr');
1818

1919
export class RegistryAccess {
20-
private registry: MetadataRegistry;
20+
private readonly registry: MetadataRegistry;
2121
private strictFolderTypes?: MetadataType[];
2222
private folderContentTypes?: MetadataType[];
2323
private aliasTypes?: MetadataType[];

src/resolve/adapters/baseSourceAdapter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export abstract class BaseSourceAdapter implements SourceAdapter {
9494
protected parseAsRootMetadataXml(path: SourcePath): MetadataXml | undefined {
9595
const metaXml = this.parseMetadataXml(path);
9696
if (metaXml) {
97-
let isRootMetadataXml = false;
97+
let isRootMetadataXml: boolean;
9898
if (this.type.strictDirectoryName) {
9999
const parentPath = dirname(path);
100100
const typeDirName = basename(this.type.inFolder ? dirname(parentPath) : parentPath);
@@ -138,6 +138,7 @@ export abstract class BaseSourceAdapter implements SourceAdapter {
138138
*
139139
* @param component Component to populate properties on
140140
* @param trigger Path that `getComponent` was called with
141+
* @param isResolvingSource if you're resolving a local source file
141142
*/
142143
protected abstract populate(
143144
trigger: SourcePath,
@@ -153,7 +154,7 @@ export abstract class BaseSourceAdapter implements SourceAdapter {
153154
*
154155
* .../tabs/MyTab.tab
155156
*
156-
* @param path File path of a metadata component
157+
* @param type
157158
*/
158159
const parseAsContentMetadataXml =
159160
(type: MetadataType) =>

src/resolve/adapters/decomposedSourceAdapter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class DecomposedSourceAdapter extends MixedContentSourceAdapter {
9292
triggerIsAChild &&
9393
this.type.children &&
9494
!this.type.children.types[childTypeId].unaddressableWithoutParent &&
95+
// make sure isAddressable is truly set to 'false' not just undefined or omitted
9596
this.type.children.types[childTypeId].isAddressable !== false
9697
) {
9798
if (strategy === 'folderPerType' || strategy === 'topLevel' || isResolvingSource) {

src/resolve/adapters/mixedContentSourceAdapter.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export class MixedContentSourceAdapter extends BaseSourceAdapter {
9191
* folder will be returned. Intended to be used exclusively for MixedContent types.
9292
*
9393
* @param path Path to trim
94-
* @param type MetadataType to determine content for
9594
*/
9695
protected trimPathToContent(path: SourcePath): SourcePath {
9796
const pathParts = path.split(sep);

0 commit comments

Comments
 (0)