From dcd01dd02530df0e799eb4227087680ffeb80d74 Mon Sep 17 00:00:00 2001 From: Vincent LE GOFF Date: Wed, 24 Apr 2019 13:41:23 +0200 Subject: Eslint fixes (denoland/deno_std#356) Make warnings fail Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc --- prettier/main.ts | 8 +++++--- prettier/main_test.ts | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'prettier') diff --git a/prettier/main.ts b/prettier/main.ts index f4a2232cc..a11501de1 100755 --- a/prettier/main.ts +++ b/prettier/main.ts @@ -188,7 +188,7 @@ async function checkSourceFiles( const results = await Promise.all(checks); - if (results.every(result => result)) { + if (results.every((result): boolean => result)) { console.log("Every file is formatted"); exit(0); } else { @@ -240,10 +240,12 @@ async function main(opts): Promise { } const options = { flags: "g" }; const skip = Array.isArray(ignore) - ? ignore.map((i: string) => glob(i, options)) + ? ignore.map((i: string): RegExp => glob(i, options)) : [glob(ignore, options)]; const match = - args.length > 0 ? args.map((a: string) => glob(a, options)) : undefined; + args.length > 0 + ? args.map((a: string): RegExp => glob(a, options)) + : undefined; const files = walk(".", { match, skip }); try { if (check) { diff --git a/prettier/main_test.ts b/prettier/main_test.ts index 3d5d54d66..0c8cca712 100644 --- a/prettier/main_test.ts +++ b/prettier/main_test.ts @@ -45,7 +45,7 @@ async function clearTestdataChanges(): Promise { await xrun({ args: ["git", "checkout", testdata] }).status(); } -test(async function testPrettierCheckAndFormatFiles() { +test(async function testPrettierCheckAndFormatFiles(): Promise { await clearTestdataChanges(); const files = [ @@ -73,7 +73,7 @@ Formatting ./prettier/testdata/1.js` await clearTestdataChanges(); }); -test(async function testPrettierCheckAndFormatDirs() { +test(async function testPrettierCheckAndFormatDirs(): Promise { await clearTestdataChanges(); const dirs = [join(testdata, "foo"), join(testdata, "bar")]; @@ -99,7 +99,7 @@ Formatting ./prettier/testdata/foo/1.js` await clearTestdataChanges(); }); -test(async function testPrettierOptions() { +test(async function testPrettierOptions(): Promise { await clearTestdataChanges(); const file0 = join(testdata, "opts", "0.ts"); -- cgit v1.2.3