mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
eslint/decaf cleanup
GitOrigin-RevId: 6ce1f67e9d60f45f7532042b60e06734574870f8
This commit is contained in:
parent
add98c889c
commit
c6e5f3dda6
16 changed files with 11 additions and 119 deletions
|
@ -1,5 +1,3 @@
|
|||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const { ProjectSchema } = require('./Project')
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const DocSchema = new Schema({
|
||||
name: { type: String, default: 'new doc' }
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const FileSchema = new Schema({
|
||||
name: {
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const { DocSchema } = require('./Doc')
|
||||
const { FileSchema } = require('./File')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const FolderSchema = new Schema({
|
||||
name: { type: String, default: 'new folder' }
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
max-len,
|
||||
handle-callback-err
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const mongoose = require('mongoose')
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const OauthApplicationSchema = new Schema(
|
||||
{
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/* eslint-disable
|
||||
max-len,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
/* eslint-disable
|
||||
camelcase,
|
||||
max-len,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const _ = require('underscore')
|
||||
const { FolderSchema } = require('./Folder.js')
|
||||
const logger = require('logger-sharelatex')
|
||||
const concreteObjectId = require('mongoose').Types.ObjectId
|
||||
const Errors = require('../Features/Errors/Errors')
|
||||
|
||||
|
@ -132,16 +118,16 @@ const ProjectSchema = new Schema({
|
|||
auditLog: [AuditLogEntrySchema]
|
||||
})
|
||||
|
||||
ProjectSchema.statics.getProject = function(project_or_id, fields, callback) {
|
||||
if (project_or_id._id != null) {
|
||||
return callback(null, project_or_id)
|
||||
ProjectSchema.statics.getProject = function(projectOrId, fields, callback) {
|
||||
if (projectOrId._id != null) {
|
||||
return callback(null, projectOrId)
|
||||
} else {
|
||||
try {
|
||||
concreteObjectId(project_or_id.toString())
|
||||
concreteObjectId(projectOrId.toString())
|
||||
} catch (e) {
|
||||
return callback(new Errors.NotFoundError(e.message))
|
||||
}
|
||||
return this.findById(project_or_id, fields, callback)
|
||||
return this.findById(projectOrId, fields, callback)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/* eslint-disable
|
||||
max-len,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
max-len,
|
||||
handle-callback-err
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const mongoose = require('mongoose')
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
/* eslint-disable
|
||||
handle-callback-err,
|
||||
max-len,
|
||||
handle-callback-err
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const { TeamInviteSchema } = require('./TeamInvite')
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const SystemMessageSchema = new Schema({
|
||||
content: { type: String, default: '' }
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const mongoose = require('mongoose')
|
||||
const Settings = require('settings-sharelatex')
|
||||
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const TeamInviteSchema = new Schema({
|
||||
email: { type: String, required: true },
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
/* eslint-disable
|
||||
max-len,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const { Project } = require('./Project')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const _ = require('underscore')
|
||||
const mongoose = require('mongoose')
|
||||
const uuid = require('uuid')
|
||||
const { Schema } = mongoose
|
||||
|
@ -134,6 +126,6 @@ const conn = mongoose.createConnection(Settings.mongo.url, {
|
|||
|
||||
const User = conn.model('User', UserSchema)
|
||||
|
||||
const model = mongoose.model('User', UserSchema)
|
||||
mongoose.model('User', UserSchema)
|
||||
exports.User = User
|
||||
exports.UserSchema = UserSchema
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
const Settings = require('settings-sharelatex')
|
||||
const mongoose = require('mongoose')
|
||||
const { Schema } = mongoose
|
||||
const { ObjectId } = Schema
|
||||
|
||||
const UserStubSchema = new Schema({
|
||||
email: { type: String, default: '' },
|
||||
|
@ -24,5 +18,6 @@ const conn = mongoose.createConnection(Settings.mongo.url, {
|
|||
|
||||
const UserStub = conn.model('UserStub', UserStubSchema)
|
||||
|
||||
const model = mongoose.model('UserStub', UserStubSchema)
|
||||
mongoose.model('UserStub', UserStubSchema)
|
||||
exports.UserStub = UserStub
|
||||
exports.UserStubSchema = UserStubSchema
|
||||
|
|
Loading…
Reference in a new issue