Browse Source

Removes eslint ignores

main
Eric Amodio 3 years ago
parent
commit
8322b5a968
11 changed files with 13 additions and 30 deletions
  1. +1
    -2
      src/git/models/commit.ts
  2. +1
    -2
      src/quickpicks/commitQuickPickItems.ts
  3. +2
    -5
      src/system/string.ts
  4. +1
    -5
      src/views/nodes/commitFileNode.ts
  5. +1
    -2
      src/views/nodes/mergeConflictFileNode.ts
  6. +1
    -2
      src/views/nodes/rebaseStatusNode.ts
  7. +1
    -2
      src/views/nodes/resultsFileNode.ts
  8. +1
    -2
      src/views/nodes/stashNode.ts
  9. +2
    -4
      src/views/nodes/statusFileNode.ts
  10. +1
    -2
      src/webviews/apps/rebase/rebase.ts
  11. +1
    -2
      src/webviews/rebaseEditor.ts

+ 1
- 2
src/git/models/commit.ts View File

@ -235,8 +235,7 @@ export abstract class GitCommit implements GitRevisionReference {
@memoize() @memoize()
getShortMessage() { 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() @memoize()

+ 1
- 2
src/quickpicks/commitQuickPickItems.ts View File

@ -14,8 +14,7 @@ export class CommitFilesQuickPickItem extends CommandQuickPickItem {
super( super(
{ {
label: commit.getShortMessage(), 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({ detail: `$(files) ${commit.getFormattedDiffStatus({
expand: true, expand: true,
separator: ', ', separator: ', ',

+ 2
- 5
src/system/string.ts View File

@ -209,8 +209,7 @@ export function getTokensFromTemplate(template: string) {
return tokens; 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<string, Function>(); const interpolationMap = new Map<string, Function>();
export function interpolate(template: string, context: object | undefined): string { export function interpolate(template: string, context: object | undefined): string {
@ -232,9 +231,7 @@ const AsyncFunction = Object.getPrototypeOf(async function () {
/* noop */ /* noop */
}).constructor; }).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<string, typeof AsyncFunction>(); const interpolationAsyncMap = new Map<string, typeof AsyncFunction>();

+ 1
- 5
src/views/nodes/commitFileNode.ts View File

@ -125,11 +125,7 @@ export class CommitFileNode
} }
private get tooltip() { private get tooltip() {
return StatusFileFormatter.fromTemplate(
// eslint-disable-next-line no-template-curly-in-string
'${file}\n${directory}/\n\n${status}${ (originalPath)}',
this.file,
);
return StatusFileFormatter.fromTemplate(`\${file}\n\${directory}/\n\n\${status}\${ (originalPath)}`, this.file);
} }
override getCommand(): Command | undefined { override getCommand(): Command | undefined {

+ 1
- 2
src/views/nodes/mergeConflictFileNode.ts View File

@ -48,8 +48,7 @@ export class MergeConflictFileNode extends ViewNode implements
item.description = this.description; item.description = this.description;
item.contextValue = `${ContextValues.File}+conflicted`; item.contextValue = `${ContextValues.File}+conflicted`;
item.tooltip = StatusFileFormatter.fromTemplate( 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, this.file,
); );
// Use the file icon and decorations // Use the file icon and decorations

+ 1
- 2
src/views/nodes/rebaseStatusNode.ts View File

@ -200,8 +200,7 @@ export class RebaseCommitNode extends ViewRefNode
// item.contextValue = ContextValues.RebaseCommit; // item.contextValue = ContextValues.RebaseCommit;
// eslint-disable-next-line no-template-curly-in-string
item.description = CommitFormatter.fromTemplate('${message}', this.commit, {
item.description = CommitFormatter.fromTemplate(`\${message}`, this.commit, {
messageTruncateAtNewLine: true, messageTruncateAtNewLine: true,
}); });
item.iconPath = new ThemeIcon('git-commit'); item.iconPath = new ThemeIcon('git-commit');

+ 1
- 2
src/views/nodes/resultsFileNode.ts View File

@ -43,8 +43,7 @@ export class ResultsFileNode extends ViewRefFileNode implements FileNode {
item.contextValue = ContextValues.ResultsFile; item.contextValue = ContextValues.ResultsFile;
item.description = this.description; item.description = this.description;
item.tooltip = StatusFileFormatter.fromTemplate( item.tooltip = StatusFileFormatter.fromTemplate(
// eslint-disable-next-line no-template-curly-in-string
'${file}\n${directory}/\n\n${status}${ (originalPath)}',
`\${file}\n\${directory}/\n\n\${status}\${ (originalPath)}`,
this.file, this.file,
); );

+ 1
- 2
src/views/nodes/stashNode.ts View File

@ -71,8 +71,7 @@ export class StashNode extends ViewRefNode
dateFormat: Container.config.defaultDateFormat, dateFormat: Container.config.defaultDateFormat,
}); });
item.contextValue = ContextValues.Stash; item.contextValue = ContextValues.Stash;
// eslint-disable-next-line no-template-curly-in-string
item.tooltip = CommitFormatter.fromTemplate('${ago} (${date})\n\n${message}', this.commit, {
item.tooltip = CommitFormatter.fromTemplate(`\${ago} (\${date})\n\n\${message}`, this.commit, {
dateFormat: Container.config.defaultDateFormat, dateFormat: Container.config.defaultDateFormat,
// messageAutolinks: true, // messageAutolinks: true,
}); });

+ 2
- 4
src/views/nodes/statusFileNode.ts View File

@ -75,15 +75,13 @@ export class StatusFileNode extends ViewNode implements FileNo
if (this._hasStagedChanges) { if (this._hasStagedChanges) {
item.contextValue += '+staged'; item.contextValue += '+staged';
item.tooltip = StatusFileFormatter.fromTemplate( 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, this.file,
); );
} else { } else {
item.contextValue += '+unstaged'; item.contextValue += '+unstaged';
item.tooltip = StatusFileFormatter.fromTemplate( 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, this.file,
); );
} }

+ 1
- 2
src/webviews/apps/rebase/rebase.ts View File

@ -36,8 +36,7 @@ const rebaseActionsMap = new Map([
]); ]);
class RebaseEditor extends App<RebaseState> { class RebaseEditor extends App<RebaseState> {
// eslint-disable-next-line no-template-curly-in-string
private readonly commitTokenRegex = new RegExp(encodeURIComponent('${commit}'));
private readonly commitTokenRegex = new RegExp(encodeURIComponent(`\${commit}`));
constructor() { constructor() {
super('RebaseEditor', (window as any).bootstrap); super('RebaseEditor', (window as any).bootstrap);

+ 1
- 2
src/webviews/rebaseEditor.ts View File

@ -575,8 +575,7 @@ async function parseRebaseTodo(
authors: [...authors.values()], authors: [...authors.values()],
commits: commits, commits: commits,
commands: { commands: {
// eslint-disable-next-line no-template-curly-in-string
commit: ShowQuickCommitCommand.getMarkdownCommandArgs('${commit}', repoPath),
commit: ShowQuickCommitCommand.getMarkdownCommandArgs(`\${commit}`, repoPath),
}, },
}; };
} }

Loading…
Cancel
Save