auto-fixed prefer-const violation

This commit is contained in:
Johannes
2022-06-08 17:49:21 +02:00
parent aa23a0dbb7
commit 0656d21d11
862 changed files with 6489 additions and 6489 deletions

View File

@@ -21,7 +21,7 @@ export function incrementDecrement(delta: number): Thenable<boolean> | undefined
return editor.edit(editBuilder => {
editor.selections.forEach(selection => {
let rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active);
const rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active);
if (!rangeToReplace) {
return;
}
@@ -40,7 +40,7 @@ export function incrementDecrement(delta: number): Thenable<boolean> | undefined
*/
export function update(numString: string, delta: number): string {
let m: RegExpMatchArray | null;
let decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1;
const decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1;
let output = String((parseFloat(numString) + delta).toFixed(decimals)).replace(/\.0+$/, '');
if (m = numString.match(/^\-?(0\d+)/)) {