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

Commit fc193a1

Browse files
authored
Merge pull request #241 from netlify/chore/no-mutating-methods
Enable `fp/no-mutating-methods` ESLint rule
2 parents 2edd766 + 38030aa commit fc193a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module.exports = {
1212
'fp/no-class': 0,
1313
'fp/no-let': 0,
1414
'fp/no-loops': 0,
15-
'fp/no-mutating-methods': 0,
1615
'fp/no-mutation': 0,
1716
'fp/no-this': 0,
1817
'promise/no-callback-in-promise': 0,

src/deploy/hasher_segments.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const objWriter = require('flush-write-stream').obj
1+
const flushWriteStream = require('flush-write-stream')
22
const hasha = require('hasha')
33
const transform = require('parallel-transform')
44
const objFilterCtor = require('through2-filter').objCtor
@@ -28,13 +28,14 @@ const fileNormalizerCtor = ({ assetType = 'file' }) =>
2828
// A writable stream segment ctor that normalizes file paths, and writes shaMap's
2929
const manifestCollectorCtor = (filesObj, shaMap, { statusCb, assetType }) => {
3030
if (!statusCb || !assetType) throw new Error('Missing required options')
31-
return objWriter((fileObj, _, cb) => {
31+
return flushWriteStream.obj((fileObj, _, cb) => {
3232
filesObj[fileObj.normalizedPath] = fileObj.hash
3333

3434
// We map a hash to multiple fileObj's because the same file
3535
// might live in two different locations
3636

3737
if (Array.isArray(shaMap[fileObj.hash])) {
38+
// eslint-disable-next-line fp/no-mutating-methods
3839
shaMap[fileObj.hash].push(fileObj)
3940
} else {
4041
shaMap[fileObj.hash] = [fileObj]

0 commit comments

Comments
 (0)