From aaa6ba2e6793c667c917e07fe67c4c325bcb40bc Mon Sep 17 00:00:00 2001
From: eliassjogreen
Date: Tue, 2 Feb 2021 18:59:00 +0100
Subject: [PATCH] feat: fix linting errors
---
CHANGELOG.md | 4 ++--
README.md | 4 ++--
tty_async.ts | 26 +++++++++++++-------------
tty_sync.ts | 28 ++++++++++++++--------------
wcwidth.ts | 12 ++++++------
5 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 38cc4fc..ad4831e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,8 +2,8 @@
All notable changes to this project will be documented in this file.
-The format is based on [Keep a Changelog],
-and this project adheres to [Semantic Versioning].
+The format is based on [Keep a Changelog], and this project adheres to
+[Semantic Versioning].
## [0.1.1] - 2020-11-21
diff --git a/README.md b/README.md
index 6f2f8f5..ecfd7df 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,6 @@
-
```typescript
import * as tty from "https://deno.land/x/tty/mod.ts";
@@ -29,7 +28,8 @@ setInterval(() => {
### contribution
-Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.
+Pull request, issues and feedback are very welcome. Code style is formatted with
+deno fmt and commit messages are done following Conventional Commits spec.
### licence
diff --git a/tty_async.ts b/tty_async.ts
index a053745..31cf575 100644
--- a/tty_async.ts
+++ b/tty_async.ts
@@ -2,26 +2,26 @@ import { encode } from "./util.ts";
import {
AsyncStream,
- RESTORE,
- ESC,
- POSITION,
- HIDE,
- SHOW,
- SCROLL_UP,
- SCROLL_DOWN,
- CLEAR_UP,
CLEAR_DOWN,
CLEAR_LEFT,
- CLEAR_RIGHT,
CLEAR_LINE,
+ CLEAR_RIGHT,
CLEAR_SCREEN,
- NEXT_LINE,
- PREV_LINE,
- HOME,
- UP,
+ CLEAR_UP,
DOWN,
+ ESC,
+ HIDE,
+ HOME,
LEFT,
+ NEXT_LINE,
+ POSITION,
+ PREV_LINE,
+ RESTORE,
RIGHT,
+ SCROLL_DOWN,
+ SCROLL_UP,
+ SHOW,
+ UP,
} from "./mod.ts";
export async function write(str: string, writer: AsyncStream): Promise {
diff --git a/tty_sync.ts b/tty_sync.ts
index 803bbc1..98cb0ab 100644
--- a/tty_sync.ts
+++ b/tty_sync.ts
@@ -1,27 +1,27 @@
import { encode } from "./util.ts";
import {
- SyncStream,
- RESTORE,
- ESC,
- POSITION,
- HIDE,
- SHOW,
- SCROLL_UP,
- SCROLL_DOWN,
- CLEAR_UP,
CLEAR_DOWN,
CLEAR_LEFT,
- CLEAR_RIGHT,
CLEAR_LINE,
+ CLEAR_RIGHT,
CLEAR_SCREEN,
- NEXT_LINE,
- PREV_LINE,
- HOME,
- UP,
+ CLEAR_UP,
DOWN,
+ ESC,
+ HIDE,
+ HOME,
LEFT,
+ NEXT_LINE,
+ POSITION,
+ PREV_LINE,
+ RESTORE,
RIGHT,
+ SCROLL_DOWN,
+ SCROLL_UP,
+ SHOW,
+ SyncStream,
+ UP,
} from "./mod.ts";
export function writeSync(str: string, writer: SyncStream): void {
diff --git a/wcwidth.ts b/wcwidth.ts
index 8dbffc2..4221830 100644
--- a/wcwidth.ts
+++ b/wcwidth.ts
@@ -35,9 +35,9 @@ export function wcswidth(
const opts = { nul, control };
if (typeof str !== "string") return wcwidth(str, opts);
- var s = 0;
- for (var i = 0; i < str.length; i++) {
- var n = wcwidth(str.charCodeAt(i), opts);
+ let s = 0;
+ for (let i = 0; i < str.length; i++) {
+ const n = wcwidth(str.charCodeAt(i), opts);
if (n < 0) return -1;
s += n;
}
@@ -75,9 +75,9 @@ function wcwidth(ucs: number, { nul = 0, control = 0 }: Defaults = {}): number {
}
function bisearch(ucs: number): boolean {
- var min = 0;
- var max = combining.length - 1;
- var mid;
+ let min = 0;
+ let max = combining.length - 1;
+ let mid;
if (ucs < combining[0][0] || ucs > combining[max][1]) return false;