Skip to content

Commit

Permalink
add trailingComma: all
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Apr 14, 2023
1 parent 152da40 commit e1c7e3f
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 240 deletions.
2 changes: 1 addition & 1 deletion examples/copy-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ s3Client.copyObject(
}
console.log('Successfully copied the object:')
console.log('etag = ' + data.etag + ', lastModified = ' + data.lastModified)
}
},
)
2 changes: 1 addition & 1 deletion examples/fget-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ s3Client.fGetObject(
return console.log(e)
}
console.log('success')
}
},
)
2 changes: 1 addition & 1 deletion examples/get-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ s3Client.getObject(
dataStream.on('error', function (err) {
console.log(err)
})
}
},
)
2 changes: 1 addition & 1 deletion examples/presigned-getobject-request-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ s3Client.presignedGetObject(
function (e, presignedUrl) {
if (e) return console.log(e)
console.log(presignedUrl)
}
},
)
2 changes: 1 addition & 1 deletion examples/remove-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ s3Client.removeObject(
return console.log(e)
}
console.log('Success')
}
},
)

// force delete object/prefix
Expand Down
2 changes: 1 addition & 1 deletion examples/set-object-legal-hold.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ s3Client.setObjectLegalHold(
return console.log('Unable to set legal hold config for the object version', err)
}
console.log('Success')
}
},
)
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const compileJS = (src, dest) => {
},
],
],
})
}),
)
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(dest))
Expand Down Expand Up @@ -71,7 +71,7 @@ exports.test = gulp.series(testCompile, () => {
exit: true,
reporter: 'spec',
ui: 'bdd',
})
}),
)
})

Expand Down Expand Up @@ -102,7 +102,7 @@ exports.functionalTest = gulp.series(testCompile, () => {
exit: true,
reporter: 'spec',
ui: 'bdd',
})
}),
)
})

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"printWidth": 120,
"singleQuote": true,
"endOfLine": "lf",
"trailingComma": "all",
"semi": false
},
"lint-staged": {
Expand Down
4 changes: 2 additions & 2 deletions src/main/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class CopySourceOptions {
throw new errors.InvalidObjectNameError('Source start must be non-negative, and start must be at most end.')
} else if ((this.MatchRange && !isNumber(this.Start)) || !isNumber(this.End)) {
throw new errors.InvalidObjectNameError(
'MatchRange is specified. But Invalid Start and End values are specified. '
'MatchRange is specified. But Invalid Start and End values are specified. ',
)
}

Expand Down Expand Up @@ -679,7 +679,7 @@ export class CopyDestinationOptions {

if (!_.isEmpty(this.Mode) && ![RETENTION_MODES.GOVERNANCE, RETENTION_MODES.COMPLIANCE].includes(this.Mode)) {
throw new errors.InvalidObjectNameError(
`Invalid Mode specified for destination object it should be one of [GOVERNANCE,COMPLIANCE]`
`Invalid Mode specified for destination object it should be one of [GOVERNANCE,COMPLIANCE]`,
)
}

Expand Down
34 changes: 17 additions & 17 deletions src/main/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class Client {
}
if (!isBoolean(params.useSSL)) {
throw new errors.InvalidArgumentError(
`Invalid useSSL flag type : ${params.useSSL}, expected to be of type "boolean"`
`Invalid useSSL flag type : ${params.useSSL}, expected to be of type "boolean"`,
)
}

Expand Down Expand Up @@ -138,7 +138,7 @@ export class Client {
if (params.transport) {
if (!isObject(params.transport)) {
throw new errors.InvalidArgumentError(
`Invalid transport type : ${params.transport}, expected to be type "object"`
`Invalid transport type : ${params.transport}, expected to be type "object"`,
)
}
transport = params.transport
Expand Down Expand Up @@ -839,7 +839,7 @@ export class Client {
ended = true
}
readStream._read()
}
},
)
})
}
Expand Down Expand Up @@ -924,7 +924,7 @@ export class Client {
var query = `uploadId=${removeUploadId}`
this.makeRequest({ method, bucketName, objectName, query }, '', [204], '', false, (e) => cb(e))
},
cb
cb,
)
}

Expand Down Expand Up @@ -1007,7 +1007,7 @@ export class Client {
cb(new Error('Size mismatch between downloaded file and the object'))
},
],
rename
rename,
)
}

Expand Down Expand Up @@ -1257,7 +1257,7 @@ export class Client {
return cb(e)
}
cb(null, partsDone, uploadId)
}
},
)
},
// all parts uploaded, complete the multipart upload
Expand All @@ -1268,7 +1268,7 @@ export class Client {
return
}
callback(err, ...rest)
}
},
)
}

Expand Down Expand Up @@ -1902,7 +1902,7 @@ export class Client {
}
return result
},
{ listOfList: [], list: [] }
{ listOfList: [], list: [] },
)

if (result.list.length > 0) {
Expand Down Expand Up @@ -1945,7 +1945,7 @@ export class Client {
})
})
},
cb
cb,
)
}

Expand Down Expand Up @@ -2068,7 +2068,7 @@ export class Client {
this.sessionToken,
region,
requestDate,
expires
expires,
)
} catch (pe) {
return cb(pe)
Expand Down Expand Up @@ -2530,7 +2530,7 @@ export class Client {
// Ignore the 'data' event so that the stream closes. (nodejs stream requirement)
response.on('data', () => {})
cb(null, result)
}
},
)
}
if (multipart) {
Expand Down Expand Up @@ -3005,7 +3005,7 @@ export class Client {
if (configKeys.length > 0) {
if (_.difference(configKeys, ['unit', 'mode', 'validity']).length !== 0) {
throw new TypeError(
`lockConfigOpts.mode,lockConfigOpts.unit,lockConfigOpts.validity all the properties should be specified.`
`lockConfigOpts.mode,lockConfigOpts.unit,lockConfigOpts.validity all the properties should be specified.`,
)
} else {
config.Rule = {
Expand Down Expand Up @@ -3515,7 +3515,7 @@ export class Client {

if (sourceFilesLength < 1 || sourceFilesLength > PART_CONSTRAINTS.MAX_PARTS_COUNT) {
throw new errors.InvalidArgumentError(
`"There must be as least one and up to ${PART_CONSTRAINTS.MAX_PARTS_COUNT} source objects.`
`"There must be as least one and up to ${PART_CONSTRAINTS.MAX_PARTS_COUNT} source objects.`,
)
}

Expand Down Expand Up @@ -3547,7 +3547,7 @@ export class Client {
let totalParts = 0

const sourceObjStats = sourceObjList.map((srcItem) =>
me.statObject(srcItem.Bucket, srcItem.Object, getStatOptions(srcItem))
me.statObject(srcItem.Bucket, srcItem.Object, getStatOptions(srcItem)),
)

return Promise.all(sourceObjStats)
Expand All @@ -3566,7 +3566,7 @@ export class Client {
const srcEnd = srcConfig.End
if (srcEnd >= srcCopySize || srcStart < 0) {
throw new errors.InvalidArgumentError(
`CopySrcOptions ${index} has invalid segment-to-copy [${srcStart}, ${srcEnd}] (size is ${srcCopySize})`
`CopySrcOptions ${index} has invalid segment-to-copy [${srcStart}, ${srcEnd}] (size is ${srcCopySize})`,
)
}
srcCopySize = srcEnd - srcStart + 1
Expand All @@ -3575,7 +3575,7 @@ export class Client {
// Only the last source may be less than `absMinPartSize`
if (srcCopySize < PART_CONSTRAINTS.ABS_MIN_PART_SIZE && index < sourceFilesLength - 1) {
throw new errors.InvalidArgumentError(
`CopySrcOptions ${index} is too small (${srcCopySize}) and it is not the last part.`
`CopySrcOptions ${index} is too small (${srcCopySize}) and it is not the last part.`,
)
}

Expand All @@ -3593,7 +3593,7 @@ export class Client {
// Do we need more parts than we are allowed?
if (totalParts > PART_CONSTRAINTS.MAX_PARTS_COUNT) {
throw new errors.InvalidArgumentError(
`Your proposed compose object requires more than ${PART_CONSTRAINTS.MAX_PARTS_COUNT} parts`
`Your proposed compose object requires more than ${PART_CONSTRAINTS.MAX_PARTS_COUNT} parts`,
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/transformers.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getConcater(parser, emitError) {
}
}
cb()
}
},
)
}

Expand Down Expand Up @@ -151,7 +151,7 @@ export function getHashSummer(enableSHA256) {
this.push(hashData)
this.push(null)
cb()
}
},
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/xml-parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ export function parseSelectObjectContentResponse(res) {
if (preludeCrcByteValue !== calculatedPreludeCrc) {
// Handle Header CRC mismatch Error
throw new Error(
`Header Checksum Mismatch, Prelude CRC of ${preludeCrcByteValue} does not equal expected CRC of ${calculatedPreludeCrc}`
`Header Checksum Mismatch, Prelude CRC of ${preludeCrcByteValue} does not equal expected CRC of ${calculatedPreludeCrc}`,
)
}

Expand All @@ -635,7 +635,7 @@ export function parseSelectObjectContentResponse(res) {
// Handle message CRC Error
if (messageCrcByteValue !== calculatedCrc) {
throw new Error(
`Message Checksum Mismatch, Message CRC of ${messageCrcByteValue} does not equal expected CRC of ${calculatedCrc}`
`Message Checksum Mismatch, Message CRC of ${messageCrcByteValue} does not equal expected CRC of ${calculatedCrc}`,
)
}
payloadStream = readableStream(payLoadBuffer)
Expand Down
Loading

0 comments on commit e1c7e3f

Please sign in to comment.