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
@@ -28,15 +28,15 @@ describe('AuthorizationManager', function () {
'../Collaborators/CollaboratorsHandler': (this.CollaboratorsHandler = {}),
'../Project/ProjectGetter': (this.ProjectGetter = {}),
'../../models/User': {
User: (this.User = {})
User: (this.User = {}),
},
'../TokenAccess/TokenAccessHandler': (this.TokenAccessHandler = {
validateTokenForAnonymousAccess: sinon
.stub()
.callsArgWith(2, null, false, false)
.callsArgWith(2, null, false, false),
}),
'settings-sharelatex': { passwordStrengthOptions: {} }
}
'settings-sharelatex': { passwordStrengthOptions: {} },
},
})
this.user_id = 'user-id-1'
this.project_id = 'project-id-1'
@@ -49,7 +49,7 @@ describe('AuthorizationManager', function () {
const notRestrictedScenarios = [
[null, 'readAndWrite', false],
['id', 'readAndWrite', true],
['id', 'readOnly', false]
['id', 'readOnly', false],
]
const restrictedScenarios = [
[null, 'readOnly', false],
@@ -57,7 +57,7 @@ describe('AuthorizationManager', function () {
[null, false, true],
[null, false, false],
['id', false, true],
['id', false, false]
['id', false, false],
]
for (var notRestrictedArgs of notRestrictedScenarios) {
expect(
@@ -13,30 +13,30 @@ describe('AuthorizationMiddleware', function () {
this.token = 'some-token'
this.AuthenticationController = {
getLoggedInUserId: sinon.stub().returns(this.userId),
isUserLoggedIn: sinon.stub().returns(true)
isUserLoggedIn: sinon.stub().returns(true),
}
this.AuthorizationManager = {}
this.HttpErrorHandler = {
forbidden: sinon.stub()
forbidden: sinon.stub(),
}
this.TokenAccessHandler = {
getRequestToken: sinon.stub().returns(this.token)
getRequestToken: sinon.stub().returns(this.token),
}
this.ObjectId = {
isValid: sinon.stub().withArgs(this.project_id).returns(true)
isValid: sinon.stub().withArgs(this.project_id).returns(true),
}
this.AuthorizationManager = {}
this.AuthorizationMiddleware = SandboxedModule.require(MODULE_PATH, {
requires: {
'./AuthorizationManager': this.AuthorizationManager,
mongodb: {
ObjectId: this.ObjectId
ObjectId: this.ObjectId,
},
'../Errors/HttpErrorHandler': this.HttpErrorHandler,
'../Authentication/AuthenticationController': this
.AuthenticationController,
'../TokenAccess/TokenAccessHandler': this.TokenAccessHandler
}
'../TokenAccess/TokenAccessHandler': this.TokenAccessHandler,
},
})
this.req = {}
this.res = {}
@@ -87,7 +87,7 @@ describe('AuthorizationMiddleware', function () {
const METHODS_TO_TEST = {
ensureUserCanReadProject: 'canUserReadProject',
ensureUserCanWriteProjectSettings: 'canUserWriteProjectSettings',
ensureUserCanWriteProjectContent: 'canUserWriteProjectContent'
ensureUserCanWriteProjectContent: 'canUserWriteProjectContent',
}
Object.entries(METHODS_TO_TEST).forEach(
([middlewareMethod, managerMethod]) => {