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

WebUI: enforce coding styles #20828

Merged
merged 8 commits into from
May 28, 2024
Merged

WebUI: enforce coding styles #20828

merged 8 commits into from
May 28, 2024

Conversation

Chocobo1
Copy link
Member

@Chocobo1 Chocobo1 commented May 11, 2024

  • WebUI: enforce string quotes coding style
  • WebUI: enforce usage of const whenever possible
  • WebUI: prefer arrow function in callbacks
  • WebUI: use assignment operator shorthand
  • WebUI: iterate over own properties only
  • WebUI: simplify code
  • WebUI: don't auto infer radix parameter
  • WebUI: add missing break

@Chocobo1 Chocobo1 added WebUI WebUI-related issues/changes Code cleanup Clean up the code while preserving the same outcome labels May 11, 2024
@Chocobo1 Chocobo1 added this to the 5.0 milestone May 11, 2024
@Chocobo1 Chocobo1 requested a review from a team May 11, 2024 12:01
Piccirello
Piccirello previously approved these changes May 11, 2024
@@ -30,6 +30,7 @@ export default [
"no-undef": "off",
"no-unused-vars": "off",
"no-var": "error",
"prefer-arrow-callback": "error",
Copy link
Member

Choose a reason for hiding this comment

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

Wanted to note that if any of these callbacks use this, the behavior will change with this commit. I haven't gone through to audit usage of this.

@Piccirello
Copy link
Member

Please merge #20705 before this 😬

@Chocobo1
Copy link
Member Author

PR updated, resolved merge conflicts.

@Chocobo1 Chocobo1 merged commit d529950 into qbittorrent:master May 28, 2024
14 checks passed
@Chocobo1 Chocobo1 deleted the js_quotes branch May 28, 2024 17:39
@HanabishiRecca
Copy link
Contributor

I'm late here unfortunately, but for WebUI: iterate over own properties only it is probably better to use Object.entries()/Object.values() instead of for...in with Object.hasOwn().

Summary in Enumerability and ownership of properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Clean up the code while preserving the same outcome WebUI WebUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants