1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix max-statements-per-line issues (#9218)

See [`max-statements-per-line`](https://eslint.org/docs/rules/max-statements-per-line) for more information.

This change enables `max-statements-per-line` and fixes the issues raised by the rule.
This commit is contained in:
Whymarrh Whitby 2020-08-14 15:13:56 -02:30 committed by GitHub
parent 9e7841fa91
commit e021acdc0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 5 deletions

View File

@ -49,6 +49,7 @@ module.exports = {
'guard-for-in': 'error', 'guard-for-in': 'error',
'implicit-arrow-linebreak': 'error', 'implicit-arrow-linebreak': 'error',
'import/extensions': ['error', 'never', { 'json': 'always' }], 'import/extensions': ['error', 'never', { 'json': 'always' }],
'max-statements-per-line': ['error', { 'max': 1 }],
'no-case-declarations': 'error', 'no-case-declarations': 'error',
'no-constant-condition': 'error', 'no-constant-condition': 'error',
'no-dupe-else-if': 'error', 'no-dupe-else-if': 'error',

View File

@ -65,7 +65,8 @@ export default class DecryptMessageManager extends EventEmitter {
getUnapprovedMsgs () { getUnapprovedMsgs () {
return this.messages.filter((msg) => msg.status === 'unapproved') return this.messages.filter((msg) => msg.status === 'unapproved')
.reduce((result, msg) => { .reduce((result, msg) => {
result[msg.id] = msg; return result result[msg.id] = msg
return result
}, {}) }, {})
} }

View File

@ -62,7 +62,8 @@ export default class EncryptionPublicKeyManager extends EventEmitter {
getUnapprovedMsgs () { getUnapprovedMsgs () {
return this.messages.filter((msg) => msg.status === 'unapproved') return this.messages.filter((msg) => msg.status === 'unapproved')
.reduce((result, msg) => { .reduce((result, msg) => {
result[msg.id] = msg; return result result[msg.id] = msg
return result
}, {}) }, {})
} }

View File

@ -64,7 +64,8 @@ export default class MessageManager extends EventEmitter {
getUnapprovedMsgs () { getUnapprovedMsgs () {
return this.messages.filter((msg) => msg.status === 'unapproved') return this.messages.filter((msg) => msg.status === 'unapproved')
.reduce((result, msg) => { .reduce((result, msg) => {
result[msg.id] = msg; return result result[msg.id] = msg
return result
}, {}) }, {})
} }

View File

@ -68,7 +68,8 @@ export default class PersonalMessageManager extends EventEmitter {
getUnapprovedMsgs () { getUnapprovedMsgs () {
return this.messages.filter((msg) => msg.status === 'unapproved') return this.messages.filter((msg) => msg.status === 'unapproved')
.reduce((result, msg) => { .reduce((result, msg) => {
result[msg.id] = msg; return result result[msg.id] = msg
return result
}, {}) }, {})
} }

View File

@ -61,7 +61,8 @@ export default class TypedMessageManager extends EventEmitter {
getUnapprovedMsgs () { getUnapprovedMsgs () {
return this.messages.filter((msg) => msg.status === 'unapproved') return this.messages.filter((msg) => msg.status === 'unapproved')
.reduce((result, msg) => { .reduce((result, msg) => {
result[msg.id] = msg; return result result[msg.id] = msg
return result
}, {}) }, {})
} }