Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some basic JS CS #9328

Merged
merged 33 commits into from
Feb 6, 2024
Merged

Fix some basic JS CS #9328

merged 33 commits into from
Feb 6, 2024

Conversation

mvorisek
Copy link
Contributor

no functional change

@mvorisek mvorisek marked this pull request as ready for review January 30, 2024 09:37
@@ -199,16 +200,19 @@ rcube_webmail.prototype.enigma_key_create_save = function () {
// validate the form
if (!password || !confirm) {
this.alert_dialog(this.get_label('enigma.formerror'));

Copy link
Member

@alecpl alecpl Feb 2, 2024

Choose a reason for hiding this comment

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

We didn't do this for PHP and I don't like it here too.

},
{
'class': 'export',
class: 'export',
Copy link
Member

@alecpl alecpl Feb 2, 2024

Choose a reason for hiding this comment

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

I'm afraid that this will not work. 'class' is a keyword in javascript.

EDIT: Hmm.. but the browser tests pass, so maybe it was an issue in some older browsers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

citing https://eslint.org/docs/latest/rules/quote-props

There are, however, some occasions when you must use quotes:

  • If you are using an ECMAScript 3 JavaScript engine (such as IE8) and you want to use a keyword (such as if) as a property name. This restriction was removed in ECMAScript 5.
  • You want to use a non-identifier character in your property name, such as having a property with a space like "one two".

https://caniuse.com/es5 it should be fine to assume ECMAScript 5 support

@@ -532,7 +543,7 @@ rcube_webmail.prototype.enigma_add_list_row = function (r) {


/*********************************************************/
/********* Enigma Message methods *********/
/* ******** Enigma Message methods *********/
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a rule like in php, it should be fine.

Copy link
Member

Choose a reason for hiding this comment

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

That added space does not make sense. Look at the line above (with all asterisks). If we can't fix it we might consider removing these whole comment blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is f9b3ba6

IMO the comments can be helpful to place a new methods more logically as the files itself are quite large.

We did the same with PHP code, we simply made the fixer happy.

Thus I prefer to merge this PR as is.

@mvorisek mvorisek requested a review from alecpl February 2, 2024 10:04
@alecpl alecpl merged commit 332c165 into roundcube:master Feb 6, 2024
15 checks passed
@mvorisek mvorisek deleted the fix_some_js_cs branch February 6, 2024 07:34
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.

2 participants