Merge pull request #3942 from overleaf/prettier-trailing-comma

Set Prettier's "trailingComma" setting to "es5"

GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
This commit is contained in:
Alf Eaton
2021-04-28 02:10:01 +00:00
committed by Copybot
parent 15011a9982
commit 1be43911b4
877 changed files with 20093 additions and 20064 deletions
@@ -52,7 +52,7 @@ module.exports = LaunchpadController = {
if (!adminUserExists) {
return res.render(Path.resolve(__dirname, '../views/launchpad'), {
adminUserExists,
authMethod
authMethod,
})
} else {
AuthenticationController.setRedirectInSession(req)
@@ -70,7 +70,7 @@ module.exports = LaunchpadController = {
return res.render(Path.resolve(__dirname, '../views/launchpad'), {
wsUrl: Settings.wsUrl,
adminUserExists,
authMethod
authMethod,
})
} else {
return res.redirect('/restricted')
@@ -108,7 +108,7 @@ module.exports = LaunchpadController = {
return EmailHandler.sendEmail('testEmail', emailOptions, function (err) {
if (err != null) {
OError.tag(err, 'error sending test email', {
email
email,
})
return next(err)
}
@@ -150,7 +150,7 @@ module.exports = LaunchpadController = {
email,
password: 'password_here',
first_name: email,
last_name: ''
last_name: '',
}
logger.log(
{ body, authMethod },
@@ -163,7 +163,7 @@ module.exports = LaunchpadController = {
if (err != null) {
OError.tag(err, 'error with registerNewUser', {
email,
authMethod
authMethod,
})
return next(err)
}
@@ -172,12 +172,12 @@ module.exports = LaunchpadController = {
{ _id: user._id },
{
$set: { isAdmin: true },
emails: [{ email }]
emails: [{ email }],
},
function (err) {
if (err != null) {
OError.tag(err, 'error setting user to admin', {
user_id: user._id
user_id: user._id,
})
return next(err)
}
@@ -233,13 +233,13 @@ module.exports = LaunchpadController = {
{
$set: {
isAdmin: true,
emails: [{ email }]
}
emails: [{ email }],
},
},
function (err) {
if (err != null) {
OError.tag(err, 'error setting user to admin', {
user_id: user._id
user_id: user._id,
})
return next(err)
}
@@ -255,12 +255,12 @@ module.exports = LaunchpadController = {
first_name: user.first_name,
last_name: user.last_name,
email: user.email,
created: Date.now()
created: Date.now(),
})
}
)
}
)
})
}
},
}
@@ -54,5 +54,5 @@ module.exports = {
'/launchpad/register_saml_admin'
)
}
}
},
}
@@ -27,13 +27,13 @@ export default App.controller(
$scope.statusChecks = {
ideJs: { status: 'inflight', error: null },
websocket: { status: 'inflight', error: null },
healthCheck: { status: 'inflight', error: null }
healthCheck: { status: 'inflight', error: null },
}
$scope.testEmail = {
emailAddress: '',
inflight: false,
status: null // | 'ok' | 'success'
status: null, // | 'ok' | 'success'
}
$scope.shouldShowAdminForm = () => !$scope.adminUserExists
@@ -53,7 +53,7 @@ export default App.controller(
return $http
.post('/launchpad/send_test_email', {
email: $scope.testEmail.emailAddress,
_csrf: window.csrfToken
_csrf: window.csrfToken,
})
.then(function (response) {
const { status } = response
@@ -103,7 +103,7 @@ export default App.controller(
const socket = io.connect(null, {
reconnect: false,
'connect timeout': 30 * 1000,
'force new connection': true
'force new connection': true,
})
socket.on('connectionAccepted', function () {
@@ -25,7 +25,7 @@ describe('LaunchpadController', function () {
_id: '323123',
first_name: 'fn',
last_name: 'ln',
save: sinon.stub().callsArgWith(0)
save: sinon.stub().callsArgWith(0),
}
this.User = {}
@@ -37,8 +37,8 @@ describe('LaunchpadController', function () {
'../../../../app/src/Features/Email/EmailHandler': (this.EmailHandler = {}),
'../../../../app/src/Features/User/UserGetter': (this.UserGetter = {}),
'../../../../app/src/models/User': { User: this.User },
'../../../../app/src/Features/Authentication/AuthenticationController': (this.AuthenticationController = {})
}
'../../../../app/src/Features/Authentication/AuthenticationController': (this.AuthenticationController = {}),
},
})
this.email = 'bob@smith.com'
@@ -46,14 +46,14 @@ describe('LaunchpadController', function () {
this.req = {
query: {},
body: {},
session: {}
session: {},
}
this.res = {
render: sinon.stub(),
redirect: sinon.stub(),
send: sinon.stub(),
sendStatus: sinon.stub()
sendStatus: sinon.stub(),
}
return (this.next = sinon.stub())
@@ -99,7 +99,7 @@ describe('LaunchpadController', function () {
return this.res.render
.calledWith(viewPath, {
adminUserExists: false,
authMethod: 'local'
authMethod: 'local',
})
.should.equal(true)
})
@@ -132,7 +132,7 @@ describe('LaunchpadController', function () {
beforeEach(function () {
this.user = {
_id: 'abcd',
email: 'abcd@example.com'
email: 'abcd@example.com',
}
this.AuthenticationController.getSessionUser = sinon
.stub()
@@ -164,7 +164,7 @@ describe('LaunchpadController', function () {
.calledWith(viewPath, {
wsUrl: undefined,
adminUserExists: true,
authMethod: 'local'
authMethod: 'local',
})
.should.equal(true)
})
@@ -322,7 +322,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -362,8 +362,8 @@ describe('LaunchpadController', function () {
{
$set: {
isAdmin: true,
emails: [{ email: this.user.email }]
}
emails: [{ email: this.user.email }],
},
}
)
.should.equal(true)
@@ -388,7 +388,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -427,7 +427,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -466,7 +466,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -501,7 +501,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -540,7 +540,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -586,7 +586,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -630,7 +630,7 @@ describe('LaunchpadController', function () {
this.req.body.password = this.password
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -672,8 +672,8 @@ describe('LaunchpadController', function () {
{
$set: {
isAdmin: true,
emails: [{ email: this.user.email }]
}
emails: [{ email: this.user.email }],
},
}
)
.should.equal(true)
@@ -710,7 +710,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -742,7 +742,7 @@ describe('LaunchpadController', function () {
email: this.email,
password: 'password_here',
first_name: this.email,
last_name: ''
last_name: '',
})
.should.equal(true)
})
@@ -754,7 +754,7 @@ describe('LaunchpadController', function () {
{ _id: this.user._id },
{
$set: { isAdmin: true },
emails: [{ email: this.user.email }]
emails: [{ email: this.user.email }],
}
)
.should.equal(true)
@@ -777,7 +777,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -812,7 +812,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -849,7 +849,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -882,7 +882,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon.stub()
this.User.updateOne = sinon.stub()
@@ -919,7 +919,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -951,7 +951,7 @@ describe('LaunchpadController', function () {
email: this.email,
password: 'password_here',
first_name: this.email,
last_name: ''
last_name: '',
})
.should.equal(true)
})
@@ -968,7 +968,7 @@ describe('LaunchpadController', function () {
this.req.body.email = this.email
this.user = {
_id: 'abcdef',
email: this.email
email: this.email,
}
this.UserRegistrationHandler.registerNewUser = sinon
.stub()
@@ -1000,7 +1000,7 @@ describe('LaunchpadController', function () {
email: this.email,
password: 'password_here',
first_name: this.email,
last_name: ''
last_name: '',
})
.should.equal(true)
})
+1 -1
View File
@@ -20,6 +20,6 @@ if (fs.existsSync(MODULES_PATH)) {
module.exports = function () {
return {
code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n')
code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n'),
}
}
+1 -1
View File
@@ -20,6 +20,6 @@ if (fs.existsSync(MODULES_PATH)) {
module.exports = function () {
return {
code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n')
code: entryPoints.map(entryPoint => `import '${entryPoint}'`).join('\n'),
}
}
@@ -34,10 +34,10 @@ module.exports = {
res.render(Path.resolve(__dirname, '../views/user/activate'), {
title: 'activate_account',
email: user.email,
token: req.query.token
token: req.query.token,
})
}
}
)
}
},
}
@@ -13,5 +13,5 @@ module.exports = {
webRouter.get('/user/activate', UserActivateController.activateAccountPage)
AuthenticationController.addEndpointToLoginWhitelist('/user/activate')
}
},
}
@@ -13,7 +13,7 @@ describe('UserActivateController', function () {
this.user = {
_id: (this.user_id = 'kwjewkl'),
features: {},
email: 'joe@example.com'
email: 'joe@example.com',
}
this.UserGetter = { getUser: sinon.stub() }
@@ -22,14 +22,14 @@ describe('UserActivateController', function () {
requires: {
'../../../../app/src/Features/User/UserGetter': this.UserGetter,
'../../../../app/src/Features/Errors/ErrorController': this
.ErrorController
}
.ErrorController,
},
})
this.req = {
query: {},
session: {
user: this.user
}
user: this.user,
},
}
this.res = {}
})