Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit b250cbd

Browse files
authored
Merge pull request #212 from netlify/lint/array-callback-return
Enable `array-callback-return` ESLint rule
2 parents e786d79 + 3d85263 commit b250cbd

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ module.exports = {
44
extends: '@netlify/eslint-config-node',
55
rules: {
66
// TODO: enable those rules
7-
'array-callback-return': 0,
87
complexity: 0,
98
'consistent-this': 0,
109
'id-length': 0,

src/deploy/hash-files.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ test('hashes files in a folder', async (t) => {
1010
filter: defaultFilter,
1111
})
1212
t.truthy(files['netlify.toml'], 'includes the netlify.toml file')
13-
Object.keys(files).forEach((path) => t.truthy(path, 'each file has a path'))
13+
Object.keys(files).forEach((path) => {
14+
t.truthy(path, 'each file has a path')
15+
})
1416
t.truthy(filesShaMap, 'filesShaMap is returned')
15-
Object.values(filesShaMap).forEach((fileObjArray) =>
16-
fileObjArray.forEach((fileObj) => t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')),
17-
)
17+
Object.values(filesShaMap).forEach((fileObjArray) => {
18+
fileObjArray.forEach((fileObj) => {
19+
t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')
20+
})
21+
})
1822
})

src/deploy/hash-fns.test.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ const { defaultFilter } = require('./util')
77
test('hashes files in a folder', async (t) => {
88
const { functions, fnShaMap } = await hashFns(__dirname, { filter: defaultFilter, tmpDir: tempy.directory() })
99

10-
Object.keys(functions).forEach((path) => t.truthy(path, 'each file has a path'))
10+
Object.keys(functions).forEach((path) => {
11+
t.truthy(path, 'each file has a path')
12+
})
1113
t.truthy(fnShaMap, 'fnShaMap is returned')
12-
Object.values(fnShaMap).forEach((fileObjArray) =>
13-
fileObjArray.forEach((fileObj) => t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')),
14-
)
14+
Object.values(fnShaMap).forEach((fileObjArray) => {
15+
fileObjArray.forEach((fileObj) => {
16+
t.truthy(fileObj.normalizedPath, 'fileObj have a normalizedPath field')
17+
})
18+
})
1519
})

src/deploy/util.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@ test('pass empty name to defaultFilter', (t) => {
6262
expect: true,
6363
},
6464
]
65-
cases.forEach((c) => t.is(defaultFilter(c.input), c.expect))
65+
cases.forEach((c) => {
66+
t.is(defaultFilter(c.input), c.expect)
67+
})
6668
})

0 commit comments

Comments
 (0)