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 --- fs/walk.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'fs/walk.ts') diff --git a/fs/walk.ts b/fs/walk.ts index 1e433e18b..b21044e72 100644 --- a/fs/walk.ts +++ b/fs/walk.ts @@ -14,15 +14,20 @@ function patternTest(patterns: RegExp[], path: string): boolean { // Forced to reset last index on regex while iterating for have // consistent results. // See: https://stackoverflow.com/a/1520853 - return patterns.some(pattern => { - let r = pattern.test(path); - pattern.lastIndex = 0; - return r; - }); + return patterns.some( + (pattern): boolean => { + let r = pattern.test(path); + pattern.lastIndex = 0; + return r; + } + ); } function include(f: FileInfo, options: WalkOptions): boolean { - if (options.exts && !options.exts.some(ext => f.path.endsWith(ext))) { + if ( + options.exts && + !options.exts.some((ext): boolean => f.path.endsWith(ext)) + ) { return false; } if (options.match && !patternTest(options.match, f.path)) { -- cgit v1.2.3