Merge pull request #3470 from overleaf/eslint

Upgrade and configure ESLint

GitOrigin-RevId: ad5aeaf85e72c847a125ff3a9db99a12855e38aa
This commit is contained in:
Alf Eaton
2020-12-16 03:08:28 +00:00
committed by Copybot
parent 1fcf94c3b9
commit 2ff1cf43d6
264 changed files with 3356 additions and 6520 deletions
@@ -83,11 +83,7 @@ attemptInvoicesCollection(error => {
throw error
}
console.log(
`DONE (DRY_RUN=${DRY_RUN}). ${
INVOICES_COLLECTED.length
} invoices collection attempts for ${USERS_COLLECTED.length} users. ${
INVOICES_COLLECTED_SUCCESS.length
} successful collections`
`DONE (DRY_RUN=${DRY_RUN}). ${INVOICES_COLLECTED.length} invoices collection attempts for ${USERS_COLLECTED.length} users. ${INVOICES_COLLECTED_SUCCESS.length} successful collections`
)
console.dir(
{
@@ -55,12 +55,8 @@ const printAccountCSV = (account, callback) => {
first_name: account.first_name,
last_name: account.last_name,
hosted_login_token: account.hosted_login_token,
billing_info_url: `https://sharelatex.recurly.com/account/billing_info/edit?ht=${
account.hosted_login_token
}`,
account_management_url: `https://sharelatex.recurly.com/account/${
account.hosted_login_token
}`,
billing_info_url: `https://sharelatex.recurly.com/account/billing_info/edit?ht=${account.hosted_login_token}`,
account_management_url: `https://sharelatex.recurly.com/account/${account.hosted_login_token}`,
current_period_ends_at: `${endAt.getFullYear()}-${endAt.getMonth() +
1}-${endAt.getDate()}`,
current_period_ends_at_segment: parseInt(
@@ -42,9 +42,7 @@ const ScriptLogger = {
printProgress: () => {
console.warn(
`Subscriptions checked: ${
ScriptLogger.checkedSubscriptionsCount
}. Mismatches: ${ScriptLogger.mismatchSubscriptionsCount}`
`Subscriptions checked: ${ScriptLogger.checkedSubscriptionsCount}. Mismatches: ${ScriptLogger.mismatchSubscriptionsCount}`
)
},
+1 -3
View File
@@ -30,9 +30,7 @@ const ScriptLogger = {
printProgress: () => {
console.warn(
`Users checked: ${ScriptLogger.checkedUsersCount}. Mismatches: ${
ScriptLogger.mismatchUsersCount
}`
`Users checked: ${ScriptLogger.checkedUsersCount}. Mismatches: ${ScriptLogger.mismatchUsersCount}`
)
},
@@ -42,11 +42,7 @@ async function syncUserEntitlements(userEntitlements, cachedEntitlements) {
cachedEntitlment.hasEntitlement !== samlIdentifier.hasEntitlement
) {
console.log(
`cached entitlement mismatch for user ${
userEntitlement.userId
} mongo(${samlIdentifier.hasEntitlement}) postgres(${
cachedEntitlment.hasEntitlement
})`
`cached entitlement mismatch for user ${userEntitlement.userId} mongo(${samlIdentifier.hasEntitlement}) postgres(${cachedEntitlment.hasEntitlement})`
)
await syncUserEntitlement(
userEntitlement.userId,
@@ -80,9 +76,7 @@ async function syncUserEntitlements(userEntitlements, cachedEntitlements) {
)
if (!email) {
console.log(
`missing email entry for samlIdentifier for user ${
userEntitlement.userId
}`
`missing email entry for samlIdentifier for user ${userEntitlement.userId}`
)
}
}
@@ -103,9 +97,7 @@ async function syncUserEntitlements(userEntitlements, cachedEntitlements) {
)
if (!samlIdentifier || !samlIdentifier.hasEntitlement) {
console.log(
`cached entitlement mismatch for user ${
userEntitlement.userId
} mongo(false) postgres(true)`
`cached entitlement mismatch for user ${userEntitlement.userId} mongo(false) postgres(true)`
)
await syncUserEntitlement(
userEntitlement.userId,
@@ -118,9 +110,7 @@ async function syncUserEntitlements(userEntitlements, cachedEntitlements) {
// entitlements were not exported
else {
console.log(
`missing cached entitlement in mongo for user ${
cachedEntitlment.userId
}`
`missing cached entitlement in mongo for user ${cachedEntitlment.userId}`
)
}
}
@@ -138,9 +128,7 @@ async function syncUserEntitlement(userId, email, hasEntitlement) {
}
} catch (err) {
console.error(
`error setting entitlement: ${userId}, ${email}, ${hasEntitlement} - ${
err.message
}`
`error setting entitlement: ${userId}, ${email}, ${hasEntitlement} - ${err.message}`
)
}
}
+1 -3
View File
@@ -69,9 +69,7 @@ async function checkCert(ukamfDB, providerId) {
// check expiration on configured certificate
const certificate = Certificate.fromPEM(
Buffer.from(
`-----BEGIN CERTIFICATE-----\n${
body.sso_cert
}\n-----END CERTIFICATE-----`,
`-----BEGIN CERTIFICATE-----\n${body.sso_cert}\n-----END CERTIFICATE-----`,
'utf8'
)
)
@@ -36,9 +36,7 @@ async function main() {
const certificate = Certificate.fromPEM(
Buffer.from(
`-----BEGIN CERTIFICATE-----\n${
samlConfig.cert
}\n-----END CERTIFICATE-----`,
`-----BEGIN CERTIFICATE-----\n${samlConfig.cert}\n-----END CERTIFICATE-----`,
'utf8'
)
)