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

Enable array-callback-return ESLint rule #212

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 8 additions & 4 deletions src/deploy/hash-files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})
12 changes: 8 additions & 4 deletions src/deploy/hash-fns.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
})
})
4 changes: 3 additions & 1 deletion src/deploy/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})