Skip to content

Commit

Permalink
Upgrade linting to 2.0.0-0 (transloadit#3280)
Browse files Browse the repository at this point in the history
* Upgrade linting to 2.0.0-0

* Adjust so we can pass without error

* Fix linting

* Update header-blacklist.js

* Update index.js

* Update Uppy.js

* Update Components.js

* Update StatusBar.js

* Update Assembly.js

* Upgrade to linting 2.0.0 (final release)
  • Loading branch information
kvz committed Nov 9, 2021
1 parent 91a1227 commit 1083863
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/companion.js
Expand Up @@ -237,7 +237,7 @@ const validateConfig = (companionOptions) => {
fs.accessSync(`${companionOptions.filePath}`, fs.R_OK | fs.W_OK) // eslint-disable-line no-bitwise
} catch (err) {
throw new Error(
`No access to "${companionOptions.filePath}". Please ensure the directory exists and with read/write permissions.`
`No access to "${companionOptions.filePath}". Please ensure the directory exists and with read/write permissions.`,
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/Uploader.js
Expand Up @@ -403,7 +403,7 @@ class Uploader {
logger.debug(
`${combinedBytes} ${bytesTotal} ${formattedPercentage}%`,
'uploader.total.progress',
this.shortToken
this.shortToken,
)

if (this._paused || this.uploadStopped) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/s3.js
Expand Up @@ -248,7 +248,7 @@ module.exports = function s3 (config) {
Body: '',
Expires: config.expires,
})
})
}),
).then((urls) => {
const presignedUrls = Object.create(null)
for (let index = 0; index < partNumbersArray.length; index++) {
Expand Down
3 changes: 1 addition & 2 deletions src/server/header-blacklist.js
Expand Up @@ -40,8 +40,7 @@ const forbiddenRegex = [/^proxy-.*$/, /^sec-.*$/]
*/
const isForbiddenHeader = (header) => {
const headerLower = header.toLowerCase()
const forbidden
= forbiddenNames.indexOf(headerLower) >= 0
const forbidden = forbiddenNames.indexOf(headerLower) >= 0
|| forbiddenRegex.findIndex((regex) => regex.test(headerLower)) >= 0

if (forbidden) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/helpers/request.js
Expand Up @@ -98,7 +98,7 @@ module.exports.getRedirectEvaluator = (rawRequestURL, blockPrivateIPs) => {
const shouldRedirect = redirectURL.protocol === requestURL.protocol
if (!shouldRedirect) {
logger.info(
`blocking redirect from ${requestURL} to ${redirectURL}`, 'redirect.protection'
`blocking redirect from ${requestURL} to ${redirectURL}`, 'redirect.protection',
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/provider/drive/index.js
Expand Up @@ -173,7 +173,7 @@ class Drive extends Provider {
sharedDrives,
directory,
query,
isRoot && !query.cursor // we can only show it on the first page request, or else we will have duplicates of it
isRoot && !query.cursor, // we can only show it on the first page request, or else we will have duplicates of it
)
}

Expand Down
3 changes: 1 addition & 2 deletions src/server/provider/unsplash/index.js
Expand Up @@ -142,8 +142,7 @@ class Unsplash extends SearchProvider {
error (err, resp) {
if (resp) {
const fallbackMessage = `request to Unsplash returned ${resp.statusCode}`
const msg
= resp.body && resp.body.errors ? `${resp.body.errors}` : fallbackMessage
const msg = resp.body && resp.body.errors ? `${resp.body.errors}` : fallbackMessage
return new ProviderApiError(msg, resp.statusCode)
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/s3-client.js
Expand Up @@ -35,7 +35,7 @@ module.exports = (companionOptions) => {
s3ClientOptions.credentials = new AWS.Credentials(
s3ProviderOptions.key,
s3ProviderOptions.secret,
s3ProviderOptions.sessionToken
s3ProviderOptions.sessionToken,
)
}
s3Client = new S3(s3ClientOptions)
Expand Down
2 changes: 1 addition & 1 deletion src/standalone/index.js
Expand Up @@ -119,7 +119,7 @@ module.exports = function server (inputCompanionOptions = {}) {
if (companionOptions.redisUrl) {
const RedisStore = require('connect-redis')(session)
const redisClient = redis.client(
merge({ url: companionOptions.redisUrl }, companionOptions.redisOptions)
merge({ url: companionOptions.redisUrl }, companionOptions.redisOptions),
)
sessionOptions.store = new RedisStore({ client: redisClient })
}
Expand Down

0 comments on commit 1083863

Please sign in to comment.