Adapt code for eslint-config-standard 17

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-05-01 21:14:27 +02:00
parent 66ab5ab51b
commit d26dcd04a1
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
24 changed files with 82 additions and 82 deletions

View file

@ -21,12 +21,12 @@ const ot = require('./ot')
// public
const realtime = {
io: null,
onAuthorizeSuccess: onAuthorizeSuccess,
onAuthorizeFail: onAuthorizeFail,
secure: secure,
connection: connection,
getStatus: getStatus,
isReady: isReady,
onAuthorizeSuccess,
onAuthorizeFail,
secure,
connection,
getStatus,
isReady,
maintenance: true
}
@ -160,7 +160,7 @@ function finishUpdateNote (note, _note, callback) {
const body = note.server.document
const title = note.title = models.Note.parseNoteTitle(body)
const values = {
title: title,
title,
content: body,
authorship: note.authorship,
lastchangeuserId: note.lastchangeuser,
@ -242,7 +242,7 @@ function getStatus (callback) {
})
models.User.count().then(function (regcount) {
return callback
// eslint-disable-next-line node/no-callback-literal
// eslint-disable-next-line n/no-callback-literal
? callback({
onlineNotes: Object.keys(notes).length,
onlineUsers: Object.keys(users).length,
@ -251,9 +251,9 @@ function getStatus (callback) {
registeredUsers: regcount,
onlineRegisteredUsers: regaddresses.length,
distinctOnlineRegisteredUsers: distinctregaddresses.length,
isConnectionBusy: isConnectionBusy,
isConnectionBusy,
connectionSocketQueueLength: connectionSocketQueue.length,
isDisconnectBusy: isDisconnectBusy,
isDisconnectBusy,
disconnectSocketQueueLength: disconnectSocketQueue.length
})
: null
@ -303,7 +303,7 @@ function emitOnlineUsers (socket) {
if (user) { users.push(buildUserOutData(user)) }
})
const out = {
users: users
users
}
realtime.io.to(noteId).emit('online users', out)
}
@ -458,7 +458,7 @@ function startConnection (socket) {
where: {
id: noteId
},
include: include
include
}).then(function (note) {
if (!note) {
return failConnection(404, 'note not found', socket)
@ -492,18 +492,18 @@ function startConnection (socket) {
id: noteId,
alias: note.alias,
title: note.title,
owner: owner,
ownerprofile: ownerprofile,
owner,
ownerprofile,
permission: note.permission,
lastchangeuser: lastchangeuser,
lastchangeuserprofile: lastchangeuserprofile,
lastchangeuser,
lastchangeuserprofile,
socks: [],
users: {},
tempUsers: {},
createtime: moment(createtime).valueOf(),
updatetime: moment(updatetime).valueOf(),
server: server,
authors: authors,
server,
authors,
authorship: note.authorship
}
@ -523,7 +523,7 @@ function failConnection (code, err, socket) {
connectNextSocket()
// emit error info
socket.emit('info', {
code: code
code
})
return socket.disconnect(true)
}
@ -665,12 +665,12 @@ function operationCallback (socket, operation) {
if (!note.authors[userId]) {
models.Author.findOrCreate({
where: {
noteId: noteId,
userId: userId
noteId,
userId
},
defaults: {
noteId: noteId,
userId: userId,
noteId,
userId,
color: user.color
}
}).spread(function (author, created) {
@ -739,7 +739,7 @@ function connection (socket) {
id: socket.id,
address: socket.handshake.headers['x-forwarded-for'] || socket.handshake.address,
'user-agent': socket.handshake.headers['user-agent'],
color: color,
color,
cursor: null,
login: false,
userid: null,
@ -784,7 +784,7 @@ function connection (socket) {
if (permission === 'freely' && !config.allowAnonymous && !config.allowAnonymousEdits) return
note.permission = permission
models.Note.update({
permission: permission
permission
}, {
where: {
id: noteId
@ -794,7 +794,7 @@ function connection (socket) {
return
}
const out = {
permission: permission
permission
}
realtime.io.to(note.id).emit('permission', out)
for (let i = 0, l = note.socks.length; i < l; i++) {
@ -870,7 +870,7 @@ function connection (socket) {
if (user) { users.push(buildUserOutData(user)) }
})
const out = {
users: users
users
}
socket.emit('online users', out)
})