From 8322b5a968063f16b8b04072442fd7b6e2c5a95a Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 13 Jun 2021 03:50:12 -0400 Subject: [PATCH] Removes eslint ignores --- src/git/models/commit.ts | 3 +-- src/quickpicks/commitQuickPickItems.ts | 3 +-- src/system/string.ts | 7 ++----- src/views/nodes/commitFileNode.ts | 6 +----- src/views/nodes/mergeConflictFileNode.ts | 3 +-- src/views/nodes/rebaseStatusNode.ts | 3 +-- src/views/nodes/resultsFileNode.ts | 3 +-- src/views/nodes/stashNode.ts | 3 +-- src/views/nodes/statusFileNode.ts | 6 ++---- src/webviews/apps/rebase/rebase.ts | 3 +-- src/webviews/rebaseEditor.ts | 3 +-- 11 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index 18e2332..f527b2e 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -235,8 +235,7 @@ export abstract class GitCommit implements GitRevisionReference { @memoize() getShortMessage() { - // eslint-disable-next-line no-template-curly-in-string - return CommitFormatter.fromTemplate('${message}', this, { messageTruncateAtNewLine: true }); + return CommitFormatter.fromTemplate(`\${message}`, this, { messageTruncateAtNewLine: true }); } @memoize() diff --git a/src/quickpicks/commitQuickPickItems.ts b/src/quickpicks/commitQuickPickItems.ts index 31a5a83..06a644e 100644 --- a/src/quickpicks/commitQuickPickItems.ts +++ b/src/quickpicks/commitQuickPickItems.ts @@ -14,8 +14,7 @@ export class CommitFilesQuickPickItem extends CommandQuickPickItem { super( { label: commit.getShortMessage(), - // eslint-disable-next-line no-template-curly-in-string - description: CommitFormatter.fromTemplate('${author}, ${ago} $(git-commit) ${id}', commit), + description: CommitFormatter.fromTemplate(`\${author}, \${ago} $(git-commit) \${id}`, commit), detail: `$(files) ${commit.getFormattedDiffStatus({ expand: true, separator: ', ', diff --git a/src/system/string.ts b/src/system/string.ts index 2e82a49..e8da82b 100644 --- a/src/system/string.ts +++ b/src/system/string.ts @@ -209,8 +209,7 @@ export function getTokensFromTemplate(template: string) { return tokens; } -// eslint-disable-next-line no-template-curly-in-string -const tokenSanitizeReplacement = "$${$1=this.$1,($1 == null ? '' : $1)}"; +const tokenSanitizeReplacement = `$\${$1=this.$1,($1 == null ? '' : $1)}`; const interpolationMap = new Map(); export function interpolate(template: string, context: object | undefined): string { @@ -232,9 +231,7 @@ const AsyncFunction = Object.getPrototypeOf(async function () { /* noop */ }).constructor; -const tokenSanitizeReplacementAsync = - // eslint-disable-next-line no-template-curly-in-string - "$${$1=this.$1,($1 == null ? '' : typeof $1.then === 'function' ? (($1 = await $1),$1 == null ? '' : $1) : $1)}"; +const tokenSanitizeReplacementAsync = `$\${$1=this.$1,($1 == null ? '' : typeof $1.then === 'function' ? (($1 = await $1),$1 == null ? '' : $1) : $1)}`; const interpolationAsyncMap = new Map(); diff --git a/src/views/nodes/commitFileNode.ts b/src/views/nodes/commitFileNode.ts index 72c651b..ba5afbd 100644 --- a/src/views/nodes/commitFileNode.ts +++ b/src/views/nodes/commitFileNode.ts @@ -125,11 +125,7 @@ export class CommitFileNode implements item.description = this.description; item.contextValue = `${ContextValues.File}+conflicted`; item.tooltip = StatusFileFormatter.fromTemplate( - // eslint-disable-next-line no-template-curly-in-string - '${file}\n${directory}/\n\n${status}${ (originalPath)} in Index (staged)', + `\${file}\n\${directory}/\n\n\${status}\${ (originalPath)} in Index (staged)`, this.file, ); // Use the file icon and decorations diff --git a/src/views/nodes/rebaseStatusNode.ts b/src/views/nodes/rebaseStatusNode.ts index be09226..6dcbbdc 100644 --- a/src/views/nodes/rebaseStatusNode.ts +++ b/src/views/nodes/rebaseStatusNode.ts @@ -200,8 +200,7 @@ export class RebaseCommitNode extends ViewRefNode implements FileNo if (this._hasStagedChanges) { item.contextValue += '+staged'; item.tooltip = StatusFileFormatter.fromTemplate( - // eslint-disable-next-line no-template-curly-in-string - '${file}\n${directory}/\n\n${status}${ (originalPath)} in Index (staged)', + `\${file}\n\${directory}/\n\n\${status}\${ (originalPath)} in Index (staged)`, this.file, ); } else { item.contextValue += '+unstaged'; item.tooltip = StatusFileFormatter.fromTemplate( - // eslint-disable-next-line no-template-curly-in-string - '${file}\n${directory}/\n\n${status}${ (originalPath)} in Working Tree', + `\${file}\n\${directory}/\n\n\${status}\${ (originalPath)} in Working Tree`, this.file, ); } diff --git a/src/webviews/apps/rebase/rebase.ts b/src/webviews/apps/rebase/rebase.ts index aad25d9..0a8c34d 100644 --- a/src/webviews/apps/rebase/rebase.ts +++ b/src/webviews/apps/rebase/rebase.ts @@ -36,8 +36,7 @@ const rebaseActionsMap = new Map([ ]); class RebaseEditor extends App { - // eslint-disable-next-line no-template-curly-in-string - private readonly commitTokenRegex = new RegExp(encodeURIComponent('${commit}')); + private readonly commitTokenRegex = new RegExp(encodeURIComponent(`\${commit}`)); constructor() { super('RebaseEditor', (window as any).bootstrap); diff --git a/src/webviews/rebaseEditor.ts b/src/webviews/rebaseEditor.ts index f18a7b9..07eb52d 100644 --- a/src/webviews/rebaseEditor.ts +++ b/src/webviews/rebaseEditor.ts @@ -575,8 +575,7 @@ async function parseRebaseTodo( authors: [...authors.values()], commits: commits, commands: { - // eslint-disable-next-line no-template-curly-in-string - commit: ShowQuickCommitCommand.getMarkdownCommandArgs('${commit}', repoPath), + commit: ShowQuickCommitCommand.getMarkdownCommandArgs(`\${commit}`, repoPath), }, }; }