Merge pull request #3470 from overleaf/eslint
Upgrade and configure ESLint GitOrigin-RevId: ad5aeaf85e72c847a125ff3a9db99a12855e38aa
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
node/handle-callback-err,
|
||||
max-len,
|
||||
no-return-assign,
|
||||
no-unused-vars,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
node/handle-callback-err,
|
||||
max-len,
|
||||
no-return-assign,
|
||||
no-unused-vars,
|
||||
@@ -49,9 +49,7 @@ describe('ClsiFormatChecker', function() {
|
||||
},
|
||||
{
|
||||
path: 'stuff/image/image.png',
|
||||
url: `http:somewhere.com/project/${
|
||||
this.project_id
|
||||
}/file/1234124321312`,
|
||||
url: `http:somewhere.com/project/${this.project_id}/file/1234124321312`,
|
||||
modified: 'more stuff'
|
||||
}
|
||||
])
|
||||
|
||||
@@ -93,17 +93,13 @@ describe('ClsiManager', function() {
|
||||
status: (this.status = 'success'),
|
||||
outputFiles: [
|
||||
{
|
||||
url: `${this.settings.apis.clsi.url}/project/${
|
||||
this.project_id
|
||||
}/user/${this.user_id}/build/1234/output/output.pdf`,
|
||||
url: `${this.settings.apis.clsi.url}/project/${this.project_id}/user/${this.user_id}/build/1234/output/output.pdf`,
|
||||
path: 'output.pdf',
|
||||
type: 'pdf',
|
||||
build: 1234
|
||||
},
|
||||
{
|
||||
url: `${this.settings.apis.clsi.url}/project/${
|
||||
this.project_id
|
||||
}/user/${this.user_id}/build/1234/output/output.log`,
|
||||
url: `${this.settings.apis.clsi.url}/project/${this.project_id}/user/${this.user_id}/build/1234/output/output.log`,
|
||||
path: 'output.log',
|
||||
type: 'log',
|
||||
build: 1234
|
||||
@@ -134,17 +130,13 @@ describe('ClsiManager', function() {
|
||||
it('should call the callback with the status and output files', function() {
|
||||
const outputFiles = [
|
||||
{
|
||||
url: `/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/build/1234/output/output.pdf`,
|
||||
url: `/project/${this.project_id}/user/${this.user_id}/build/1234/output/output.pdf`,
|
||||
path: 'output.pdf',
|
||||
type: 'pdf',
|
||||
build: 1234
|
||||
},
|
||||
{
|
||||
url: `/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/build/1234/output/output.log`,
|
||||
url: `/project/${this.project_id}/user/${this.user_id}/build/1234/output/output.log`,
|
||||
path: 'output.log',
|
||||
type: 'log',
|
||||
build: 1234
|
||||
@@ -300,17 +292,13 @@ describe('ClsiManager', function() {
|
||||
status: (this.status = 'success'),
|
||||
outputFiles: [
|
||||
{
|
||||
url: `${this.settings.apis.clsi.url}/project/${
|
||||
this.submission_id
|
||||
}/build/1234/output/output.pdf`,
|
||||
url: `${this.settings.apis.clsi.url}/project/${this.submission_id}/build/1234/output/output.pdf`,
|
||||
path: 'output.pdf',
|
||||
type: 'pdf',
|
||||
build: 1234
|
||||
},
|
||||
{
|
||||
url: `${this.settings.apis.clsi.url}/project/${
|
||||
this.submission_id
|
||||
}/build/1234/output/output.log`,
|
||||
url: `${this.settings.apis.clsi.url}/project/${this.submission_id}/build/1234/output/output.log`,
|
||||
path: 'output.log',
|
||||
type: 'log',
|
||||
build: 1234
|
||||
@@ -421,9 +409,7 @@ describe('ClsiManager', function() {
|
||||
this.ClsiManager._makeRequest
|
||||
.calledWith(this.project_id, {
|
||||
method: 'DELETE',
|
||||
url: `${this.settings.apis.clsi.url}/project/${
|
||||
this.project_id
|
||||
}/user/${this.user_id}`
|
||||
url: `${this.settings.apis.clsi.url}/project/${this.project_id}/user/${this.user_id}`
|
||||
})
|
||||
.should.equal(true)
|
||||
})
|
||||
@@ -554,9 +540,7 @@ describe('ClsiManager', function() {
|
||||
},
|
||||
{
|
||||
path: 'images/image.png',
|
||||
url: `${this.settings.apis.filestore.url}/project/${
|
||||
this.project_id
|
||||
}/file/${this.file_1._id}`,
|
||||
url: `${this.settings.apis.filestore.url}/project/${this.project_id}/file/${this.file_1._id}`,
|
||||
modified: this.file_1.created.getTime()
|
||||
}
|
||||
]
|
||||
@@ -862,9 +846,7 @@ describe('ClsiManager', function() {
|
||||
})
|
||||
|
||||
it('should send the request to the CLSI', function() {
|
||||
const url = `${this.settings.apis.clsi.url}/project/${
|
||||
this.project_id
|
||||
}/user/${this.user_id}/compile`
|
||||
const url = `${this.settings.apis.clsi.url}/project/${this.project_id}/user/${this.user_id}/compile`
|
||||
this.ClsiManager._makeRequest
|
||||
.calledWith(this.project_id, {
|
||||
method: 'POST',
|
||||
@@ -938,9 +920,7 @@ describe('ClsiManager', function() {
|
||||
this.ClsiManager._makeRequest
|
||||
.calledWith(this.project_id, {
|
||||
method: 'GET',
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/wordcount`,
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${this.user_id}/wordcount`,
|
||||
qs: { file: 'rootfile.text', image: undefined }
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -966,9 +946,7 @@ describe('ClsiManager', function() {
|
||||
this.ClsiManager._makeRequest
|
||||
.calledWith(this.project_id, {
|
||||
method: 'GET',
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/wordcount`,
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${this.user_id}/wordcount`,
|
||||
qs: { file: 'main.tex', image: undefined }
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -992,9 +970,7 @@ describe('ClsiManager', function() {
|
||||
this.ClsiManager._makeRequest
|
||||
.calledWith(this.project_id, {
|
||||
method: 'GET',
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/wordcount`,
|
||||
url: `http://clsi.example.com/project/${this.project_id}/user/${this.user_id}/wordcount`,
|
||||
qs: { file: 'main.tex', image: this.image }
|
||||
})
|
||||
.should.equal(true)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
node/handle-callback-err,
|
||||
max-len,
|
||||
no-return-assign,
|
||||
no-unused-vars,
|
||||
|
||||
@@ -308,9 +308,7 @@ describe('CompileController', function() {
|
||||
return this.CompileController.proxyToClsi
|
||||
.calledWith(
|
||||
this.project_id,
|
||||
`/project/${this.project_id}/user/${
|
||||
this.user_id
|
||||
}/output/output.pdf`,
|
||||
`/project/${this.project_id}/user/${this.user_id}/output/output.pdf`,
|
||||
this.req,
|
||||
this.res,
|
||||
this.next
|
||||
@@ -331,9 +329,7 @@ describe('CompileController', function() {
|
||||
return this.CompileController.proxyToClsi
|
||||
.calledWith(
|
||||
this.project_id,
|
||||
`/project/${this.project_id}/user/${this.user_id}/build/${
|
||||
this.buildId
|
||||
}/output/output.pdf`,
|
||||
`/project/${this.project_id}/user/${this.user_id}/build/${this.buildId}/output/output.pdf`,
|
||||
this.req,
|
||||
this.res,
|
||||
this.next
|
||||
@@ -376,9 +372,7 @@ describe('CompileController', function() {
|
||||
file: this.file
|
||||
}
|
||||
this.req.body = {}
|
||||
this.expected_url = `/project/${this.submission_id}/build/${
|
||||
this.build_id
|
||||
}/output/${this.file}`
|
||||
this.expected_url = `/project/${this.submission_id}/build/${this.build_id}/output/${this.file}`
|
||||
return (this.CompileController.proxyToClsiWithLimits = sinon.stub())
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
node/handle-callback-err,
|
||||
max-len,
|
||||
no-return-assign,
|
||||
no-unused-vars,
|
||||
|
||||
Reference in New Issue
Block a user