a11smiles / GitSync

Logical operator can be refactored to optional chain JS-W1044
Anti-pattern
Minor
3 months ago3 months old
Prefer using an optional chain expression instead, as it's more concise and easier to read
 62                ...inputAdo.ado
 63            },
 64            github: {
 65                ...(configJSON && configJSON.github ? configJSON.github : {}), 66                ...inputGitHub.github
 67            }
 68        };
Prefer using an optional chain expression instead, as it's more concise and easier to read
 58            ...payload,
 59            ...env,
 60            ado: {
 61                ...(configJSON && configJSON.ado ? configJSON.ado : {}), 62                ...inputAdo.ado
 63            },
 64            github: {
Prefer using an optional chain expression instead, as it's more concise and easier to read
 54        let inputAdo = !!core.getInput('ado') ? JSON.parse(core.getInput('ado')) : { ado: {}};
 55        let inputGitHub = !!core.getInput('github') ? JSON.parse(core.getInput('github')) : { github: {}};
 56        let config = {
 57            log_level: (configJSON && configJSON.log_level ? configJSON.log_level : undefined),  58            ...payload,
 59            ...env,
 60            ado: {
Prefer using an optional chain expression instead, as it's more concise and easier to read
 26
 27            // Temporary fix until support of PRs
 28            if ((config.issue.node_id && config.issue.node_id.startsWith("PR_")) ||
 29                (config.issue.nodeId && config.issue.nodeId.startsWith("PR_"))) { 30                // Log and skip PRs (comments)
 31                log.info(`Action is performed on PR #${config.issue.number}. Skipping...`);
 32            } else {
Prefer using an optional chain expression instead, as it's more concise and easier to read
 25            log.debug(config);
 26
 27            // Temporary fix until support of PRs
 28            if ((config.issue.node_id && config.issue.node_id.startsWith("PR_")) || 29                (config.issue.nodeId && config.issue.nodeId.startsWith("PR_"))) {
 30                // Log and skip PRs (comments)
 31                log.info(`Action is performed on PR #${config.issue.number}. Skipping...`);