From 3d852630d24aa86375e4a4bcf69334bbdd4e8878 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Wed, 9 Dec 2020 20:54:11 +0100 Subject: [PATCH] Add `array-callback-return` ESLint rule --- .eslintrc.js | 1 - src/deploy/hash-files.test.js | 12 ++++++++---- src/deploy/hash-fns.test.js | 12 ++++++++---- src/deploy/util.test.js | 4 +++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index dc12d9e..0f27bf8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,7 +4,6 @@ module.exports = { extends: '@netlify/eslint-config-node', rules: { // TODO: enable those rules - 'array-callback-return': 0, complexity: 0, 'consistent-this': 0, 'func-names': 0, diff --git a/src/deploy/hash-files.test.js b/src/deploy/hash-files.test.js index 9b8f5c6..534171f 100644 --- a/src/deploy/hash-files.test.js +++ b/src/deploy/hash-files.test.js @@ -10,9 +10,13 @@ test('hashes files in a folder', async (t) => { filter: defaultFilter, }) t.truthy(files['netlify.toml'], 'includes the netlify.toml file') - Object.keys(files).forEach((path) => t.truthy(path, 'each file has a path')) + Object.keys(files).forEach((path) => { + t.truthy(path, 'each file has a path') + }) t.truthy(filesShaMap, 'filesShaMap is returned') - Object.values(filesShaMap).forEach((fileObjArray) => - fileObjArray.forEach((fileObj) => t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')), - ) + Object.values(filesShaMap).forEach((fileObjArray) => { + fileObjArray.forEach((fileObj) => { + t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field') + }) + }) }) diff --git a/src/deploy/hash-fns.test.js b/src/deploy/hash-fns.test.js index f5d34a6..23034ed 100644 --- a/src/deploy/hash-fns.test.js +++ b/src/deploy/hash-fns.test.js @@ -7,9 +7,13 @@ const { defaultFilter } = require('./util') test('hashes files in a folder', async (t) => { const { functions, fnShaMap } = await hashFns(__dirname, { filter: defaultFilter, tmpDir: tempy.directory() }) - Object.keys(functions).forEach((path) => t.truthy(path, 'each file has a path')) + Object.keys(functions).forEach((path) => { + t.truthy(path, 'each file has a path') + }) t.truthy(fnShaMap, 'fnShaMap is returned') - Object.values(fnShaMap).forEach((fileObjArray) => - fileObjArray.forEach((fileObj) => t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')), - ) + Object.values(fnShaMap).forEach((fileObjArray) => { + fileObjArray.forEach((fileObj) => { + t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field') + }) + }) }) diff --git a/src/deploy/util.test.js b/src/deploy/util.test.js index 82a10af..c8fc594 100644 --- a/src/deploy/util.test.js +++ b/src/deploy/util.test.js @@ -62,5 +62,7 @@ test('pass empty name to defaultFilter', (t) => { expect: true, }, ] - cases.forEach((c) => t.is(defaultFilter(c.input), c.expect)) + cases.forEach((c) => { + t.is(defaultFilter(c.input), c.expect) + }) })