a11smiles / GitSync

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
3 months ago2 years old
Unexpected string concatenation
658        log.info(`Updating issue for work item (${workItem.id})...`);
659        const octokit = new github.getOctokit(config.github.token);
660        const owner = config.GITHUB_REPOSITORY_OWNER;
661        const repo = config.GITHUB_REPOSITORY.replace(owner + "/", "");662        const converter = new showdown.Converter();
663
664        log.debug(`[WORKITEM: ${workItem.id}] Owner:`, owner);
Unexpected string concatenation
625        let context = { project: config.ado.project };
626        let wiql = {
627            query:
628                "SELECT [System.Id], [System.Description], [System.Title], [System.AssignedTo], [System.State], [System.Tags] FROM workitems WHERE [System.TeamProject] = @project " +629                "AND [System.WorkItemType] = '" + config.ado.wit + "'" +630                "AND [System.Tags] CONTAINS 'GitHub Issue' " +631                "AND [System.Tags] CONTAINS 'GitHub Repo: " + config.GITHUB_REPOSITORY + "' " +632                "AND [System.ChangedDate] > @Today - 1"633        };
634
635        log.debug("WIQL Query:", wiql);
Unexpected string concatenation
201        let context = { project: config.ado.project };
202        let wiql = {
203            query:
204                "SELECT [System.Id], [System.Description], [System.Title], [System.AssignedTo], [System.State], [System.Tags] FROM workitems WHERE [System.TeamProject] = @project " +205                "AND [System.WorkItemType] = '" + config.ado.wit + "'" +206                "AND [System.Title] CONTAINS 'GH #" + config.issue.number + ":' " +207                "AND [System.Tags] CONTAINS 'GitHub Issue' " +208                "AND [System.Tags] CONTAINS 'GitHub Repo: " + config.repository.full_name + "'"209        };
210
211        log.debug("WIQL Query:", wiql);