diff options
author | Chris Bystrek <chris.bystrek@gmail.com> | 2018-10-05 07:29:55 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-05 07:29:55 -0400 |
commit | 6a649012bcd780f4b3adfa55647772fce0012fde (patch) | |
tree | 7b81a7f269793fa9a790b90024f888963e24cfc7 /js | |
parent | ce9148943c4ffa43252e3692014489ebcff3d51e (diff) |
Changed tools/lint.py to lint the entire js and tests directories. (#900)
* Changed tools/lint.py to lint the entire js and tests directorys and sub directories, currently it was pointing at tsconfig and would only lint files that were part of js/main.ts or node_modules/typescript/lib/lib.esnext.d.ts and their dependencies
* Broke the typescript linting out into separate steps for the main typescript programing and tests.
* Fixed linting issues in ts tests.
Diffstat (limited to 'js')
-rw-r--r-- | js/console_test.ts | 4 | ||||
-rw-r--r-- | js/make_temp_dir_test.ts | 4 | ||||
-rw-r--r-- | js/net_test.ts | 2 | ||||
-rw-r--r-- | js/read_dir_test.ts | 2 | ||||
-rw-r--r-- | js/timers_test.ts | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/js/console_test.ts b/js/console_test.ts index cbfbdb52a..a87010220 100644 --- a/js/console_test.ts +++ b/js/console_test.ts @@ -67,7 +67,7 @@ test(function consoleTestStringifyCircular() { }; nestedObj.o = circularObj; - + // tslint:disable-next-line:max-line-length const nestedObjExpected = `{ num: 1, bool: true, str: "a", method: [Function: method], asyncMethod: [AsyncFunction: asyncMethod], generatorMethod: [GeneratorFunction: generatorMethod], un: undefined, nu: null, arrowFunc: [Function: arrowFunc], extendedClass: Extended { a: 1, b: 2 }, nFunc: [Function], extendedCstr: [Function: Extended], o: { num: 2, bool: false, str: "b", method: [Function: method], un: undefined, nu: null, nested: [Circular], emptyObj: [object], arr: [object], baseClass: [object] } }`; assertEqual(stringify(1), "1"); @@ -88,11 +88,13 @@ test(function consoleTestStringifyCircular() { assertEqual(stringify(JSON), "{}"); assertEqual( stringify(console), + // tslint:disable-next-line:max-line-length "Console { printFunc: [Function], log: [Function], debug: [Function], info: [Function], dir: [Function], warn: [Function], error: [Function], assert: [Function] }" ); }); test(function consoleTestStringifyWithDepth() { + // tslint:disable-next-line:no-any const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } }; assertEqual( stringifyArgs([nestedObj], { depth: 3 }), diff --git a/js/make_temp_dir_test.ts b/js/make_temp_dir_test.ts index 082c1e65d..551d58c26 100644 --- a/js/make_temp_dir_test.ts +++ b/js/make_temp_dir_test.ts @@ -6,7 +6,7 @@ testPerm({ write: true }, function makeTempDirSyncSuccess() { const dir1 = deno.makeTempDirSync({ prefix: "hello", suffix: "world" }); const dir2 = deno.makeTempDirSync({ prefix: "hello", suffix: "world" }); // Check that both dirs are different. - assert(dir1 != dir2); + assert(dir1 !== dir2); for (const dir of [dir1, dir2]) { // Check that the prefix and suffix are applied. const lastPart = dir.replace(/^.*[\\\/]/, ""); @@ -44,7 +44,7 @@ testPerm({ write: true }, async function makeTempDirSuccess() { const dir1 = await deno.makeTempDir({ prefix: "hello", suffix: "world" }); const dir2 = await deno.makeTempDir({ prefix: "hello", suffix: "world" }); // Check that both dirs are different. - assert(dir1 != dir2); + assert(dir1 !== dir2); for (const dir of [dir1, dir2]) { // Check that the prefix and suffix are applied. const lastPart = dir.replace(/^.*[\\\/]/, ""); diff --git a/js/net_test.ts b/js/net_test.ts index 0b6db7afa..93ad6ee00 100644 --- a/js/net_test.ts +++ b/js/net_test.ts @@ -9,7 +9,7 @@ testPerm({ net: true }, function netListenClose() { }); testPerm({ net: true }, async function netDialListen() { - let addr = "127.0.0.1:4500"; + const addr = "127.0.0.1:4500"; const listener = deno.listen("tcp", addr); listener.accept().then(async conn => { await conn.write(new Uint8Array([1, 2, 3])); diff --git a/js/read_dir_test.ts b/js/read_dir_test.ts index 43430ed00..cc63eb038 100644 --- a/js/read_dir_test.ts +++ b/js/read_dir_test.ts @@ -7,7 +7,7 @@ function assertSameContent(files: FileInfo[]) { let counter = 0; for (const file of files) { - if (file.name == "subdir") { + if (file.name === "subdir") { assert(file.isDirectory()); counter++; } diff --git a/js/timers_test.ts b/js/timers_test.ts index 8d9eb0e1a..56cc56a9b 100644 --- a/js/timers_test.ts +++ b/js/timers_test.ts @@ -32,7 +32,7 @@ test(async function timeoutSuccess() { }); test(async function timeoutArgs() { - let arg = 1; + const arg = 1; await new Promise((resolve, reject) => { setTimeout( (a, b, c) => { |