Skip to content

Commit

Permalink
fix(lint): fix issues raised by linter
Browse files Browse the repository at this point in the history
  • Loading branch information
azlam-abdulsalam committed Mar 2, 2024
1 parent 4d62bff commit 9f7d9ab
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class PicklistAnalyzer implements PackageAnalyzer {
}
}

if (components) {
if (components && components.length > 0) {
for (const fieldComponent of components) {
let customField = fieldComponent.parseXmlSync().CustomField;
//issues/1367
Expand Down
1 change: 1 addition & 0 deletions packages/sfp-cli/src/impl/dependency/ShrinkImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class ShrinkImpl {
for (let i = 0; i < updatedDependencies.length; i++) {
if (updatedDependencies[i].package == temp.package) {
updatedDependencies.splice(i, 1);
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/sfp-cli/src/impl/validate/ApexTestValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class ApexTestValidator {
return { id: null, result: true, message: "No Tests To Run" };
}

if (testOptions == undefined) {
if (!testOptions) {
return { id: null, result: true, message: "No Tests To Run" };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ export default class UserPermissionBuilder {
}
private addRequiredObjectAccess(profileOrPermissionSet: any, objectAccessRequired: any) {
if (
profileOrPermissionSet.objectPermissions == null ||
profileOrPermissionSet.objectPermissions == undefined ||
!profileOrPermissionSet.objectPermissions ||
!Array.isArray(profileOrPermissionSet.objectPermissions)
) {
profileOrPermissionSet.objectPermissions = objectAccessRequired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class ProfileWriter {
} else {
let data = [];
for (let i = 0; i < profileObj[key].length; i++) {
let element = this.removeArrayNatureOnValue(profileObj[key][i]);
let element:string = this.removeArrayNatureOnValue(profileObj[key][i]);
if (element !== '') {
data.push(element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ export default class ProfileComponentReconciler {
let cmpObj = profileObj.layoutAssignments[count];
let exist =
(await layoutRetreiver.isComponentExistsInProjectDirectoryOrInOrg(cmpObj.layout)) &&
(cmpObj.recordType == null ||
cmpObj.recordType == undefined ||
(!cmpObj.recordType ||
(await recordTypeRetriever.isComponentExistsInProjectDirectoryOrInOrg(cmpObj.recordType)));
if (exist) {
validArray.push(cmpObj);
Expand Down
2 changes: 1 addition & 1 deletion packages/sfprofiles/src/impl/source/profileMerge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export default class ProfileMerge extends ProfileActions {

private removeUnwantedPermissions(profileObjFromServer: Profile, metadatas: any) {
const getPermissionsArray = (permissions: any) => {
if(permissions == null || permissions == undefined) {
if(!permissions) {
permissions = [];
} else if(!Array.isArray(permissions)) {
permissions = [permissions];
Expand Down

0 comments on commit 9f7d9ab

Please sign in to comment.