Skip to content

New eslint rules#10565

Closed
sampaiodiego wants to merge 8 commits intodevelopfrom
new-eslint-rules
Closed

New eslint rules#10565
sampaiodiego wants to merge 8 commits intodevelopfrom
new-eslint-rules

Conversation

@sampaiodiego
Copy link
Copy Markdown
Member

@sampaiodiego sampaiodiego commented Apr 23, 2018

I'm proposing adding this bunch of new eslint rules to better standardize our code base and also making PR reviews a bit easier (since we don't need to care about much of code styling).

Since this is still a proposition, I'm not worried of fixing the issues. I have fixed most of them using --fix, but some need manual fix which I'm willing to do since we all approve the new rules.

For easy reviewing, I'm proposing adding the following rules:

@RocketChat/core please evaluate.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10565 April 23, 2018 22:53 Inactive
Copy link
Copy Markdown
Contributor

@graywolf336 graywolf336 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reason for disagreeing with this one is because we are an Open Source project and often times the first time people contribute to an open source project is to our repository. Thus, I strongly feel that we should have coding style rules that make it easier for new developers to understand what is going on.

.eslintrc Outdated
"no-void": 2,
"no-var": 2,
"no-multiple-empty-lines": [2, { "max": 2 }],
"arrow-parens": [2, "as-needed", { "requireForBlockBody": true }],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this and I think it should be always.

@sampaiodiego sampaiodiego temporarily deployed to rocket-chat-pr-10565 April 23, 2018 23:33 Inactive
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@RocketChat RocketChat deleted a comment Apr 23, 2018
@sampaiodiego sampaiodiego temporarily deployed to rocket-chat-pr-10565 April 24, 2018 03:07 Inactive
@RocketChat RocketChat deleted a comment Apr 24, 2018
@engelgabriel engelgabriel added this to the 0.66.0 milestone Jun 2, 2018
@theorenck theorenck modified the milestones: 0.66.0, Short-term Jul 31, 2018
@sampaiodiego sampaiodiego temporarily deployed to rocket-chat-pr-10565 August 13, 2018 12:52 Inactive
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@RocketChat RocketChat deleted a comment Aug 13, 2018
@sampaiodiego
Copy link
Copy Markdown
Member Author

guys, I've added a new rule no-mixed-operators based on airbnb

the pull request is ready to be reviewed.. I recommend looking at particularly commits, since most of the fixes were by --fix, so here is a short list of what I've changed manually:

# Conflicts:
#	.eslintrc
#	packages/chatpal-search/server/provider/provider.js
#	packages/meteor-accounts-saml/saml_rocketchat.js
#	packages/rocketchat-api/server/v1/im.js
#	packages/rocketchat-api/server/v1/users.js
#	packages/rocketchat-authorization/server/models/Roles.js
#	packages/rocketchat-channel-settings/server/functions/saveRoomType.js
#	packages/rocketchat-custom-oauth/server/custom_oauth_server.js
#	packages/rocketchat-emoji/client/lib/EmojiPicker.js
#	packages/rocketchat-file-upload/server/lib/FileUpload.js
#	packages/rocketchat-integrations/server/lib/triggerHandler.js
#	packages/rocketchat-ldap/client/loginHelper.js
#	packages/rocketchat-ldap/server/sync.js
#	packages/rocketchat-lib/server/functions/saveUser.js
#	packages/rocketchat-lib/server/lib/debug.js
#	packages/rocketchat-lib/server/methods/sendInvitationEmail.js
#	packages/rocketchat-lib/server/models/_Base.js
#	packages/rocketchat-lib/server/startup/settings.js
#	packages/rocketchat-mailer/server/functions/sendMail.js
#	packages/rocketchat-nrr/nrr.js
#	packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.js
#	packages/rocketchat-sandstorm/server/powerbox.js
#	packages/rocketchat-search/server/index.js
#	packages/rocketchat-setup-wizard/client/setupWizard.js
#	packages/rocketchat-ui-admin/client/adminInfo.js
#	packages/rocketchat-ui-flextab/client/tabs/membersList.js
#	packages/rocketchat-ui-flextab/client/tabs/uploadedFilesList.js
#	packages/rocketchat-ui-flextab/client/tabs/userInfo.js
#	packages/rocketchat-ui-message/client/message.js
#	packages/rocketchat-ui-message/client/messageBox.js
#	packages/rocketchat-webrtc/client/WebRTCClass.js
#	server/configuration/accounts_meld.js
#	server/lib/accounts.js
#	tests/end-to-end/api/01-users.js
#	tests/end-to-end/ui/13-permissions.js

subject = RocketChat.placeholders.replace(subject);
html = RocketChat.placeholders.replace(html, {
name: s.escapeHTML(userData.name),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change right?

encoding = 'base64';
image = fileData.image;
contentType = fileData.contentType;
({ image } = fileData);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need parenthesis in these cases?

@sampaiodiego
Copy link
Copy Markdown
Member Author

closing this in favor of #11804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants