Conversation
| "debug": "meteor run --inspect", | ||
| "debug-brk": "meteor run --inspect-brk", | ||
| "lint": "eslint .", | ||
| "lint-fix": "eslint . --fix", |
There was a problem hiding this comment.
I've removed the fix job because it can be done like this: meteor npm run core-lint -- --fix or meteor npm run livechat-lint -- --fix
| template.preparing.set(false); | ||
| }); | ||
| }; | ||
| return file; |
There was a problem hiding this comment.
This return is unnecessary, you can change the map to a forEach
| , userData); | ||
| : obj[currKey] = obj[currKey] || {} | ||
| , userData) | ||
| ); |
There was a problem hiding this comment.
This looks strange, the userData would be the second parameter of the reduce right?
| currentTracker = Tracker.autorun(function(c) { | ||
| const user = Meteor.user(); | ||
| if ((user && user.username == null) || user == null && RocketChat.settings.get('Accounts_AllowAnonymousRead') === false) { | ||
| if ((user == null || user.username == null) && RocketChat.settings.get('Accounts_AllowAnonymousRead') === false) { |
There was a problem hiding this comment.
I'm not sure about this change, It will allow users without username on servers with anonymous read true to open a room instead of show the screen to select usernames right?
There was a problem hiding this comment.
ok.. the logic change was unintended.. fixing
| unreadsFrom = subscription.ls; | ||
| } | ||
| userMentions = subscription.userMentions; | ||
| ({ userMentions } = subscription); |
|
|
||
| if (access || joined) { | ||
| msgs = room.msgs; | ||
| ({ msgs } = room); |
| unreadsFrom = dm.ls; | ||
| } | ||
| userMentions = dm.userMentions; | ||
| ({ userMentions } = dm); |
|
|
||
| if (access || joined) { | ||
| msgs = room.msgs; | ||
| ({ msgs } = room); |
| return value; | ||
| } else if (typeof data === 'object') { | ||
| value = hljs.highlight('json', JSON.stringify(data, null, 2)).value; | ||
| ({ value } = hljs.highlight('json', JSON.stringify(data, null, 2))); |
| if (e.target.files == null || files.length === 0) { | ||
| if (e.dataTransfer.files != null) { | ||
| files = e.dataTransfer.files; | ||
| ({ files } = e.dataTransfer); |
| if (files == null || files.length === 0) { | ||
| if (e.dataTransfer != null && e.dataTransfer.files != null) { | ||
| files = e.dataTransfer.files; | ||
| ({ files } = e.dataTransfer); |
| const loginResult = await AccountsServer.loginWithUser({ id }); | ||
|
|
||
| tokens = loginResult.tokens; | ||
| ({ tokens } = loginResult); |
| const loginResult = await AccountsServer.loginWithUser({ id: user.id }); | ||
|
|
||
| tokens = loginResult.tokens; | ||
| ({ tokens } = loginResult); |
|
|
||
| if (access || joined) { | ||
| msgs = room.msgs; | ||
| ({ msgs } = room); |
f3e1b56 to
5ed4e08
Compare
5ed4e08 to
df6bbee
Compare
|
Out of curiosity.. the destructuring... Why: Isn't it normally just: I know reverted. But just curious :) |
|
wow.. same moment I merged 😂 so @geekgonecrazy for destructuring without declaration, the parenthesis are required: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Assignment_without_declaration |
|
so, correct: const { msgs } = room;
// or
let msgs;
({ msgs } = room); |
|
Ah! I think the cases I've done have been consts. Thanks! :) |
Add the remaining lint fixes that weren't able to fix automatically, so this ones needs more carful and reviewing.
I have also added a specific job for linting livechat widget, since its under a hidden folder (
.app) it was being ignored by the regular lint command.For easy reviewing, here is a list of rules being applied:
{"object": true, "array": false}Closes #10565