Skip to content

Conversation

Yasir-Rafique
Copy link
Contributor

This PR applies formatting and linting to the broadcast module using the new Prettier and ESLint configurations, aligned with the backend style guide.

What was done:

  • Ran Prettier (.prettierrc) on src/backend/src/modules/broadcast
  • Ran ESLint (.eslintrc.cjs) with recommended plugins
  • No changes were made to code logic or behavior. Only formatting/linting

Auto-enforced rules include:

  • 4-space indentation
  • Semicolons
  • Trailing commas
  • Line length (warn at 100 chars)
  • Import order
  • JSDoc presence (warnings only)

Manual review still needed for:

  • File naming conventions
  • Special variable naming (like svc_)
  • Copyright header
  • Empty blocks with //NOOP

Notes on Linting Warnings:

  • no-unused-vars: Detected unused variables in BroadcastService.js
  • no-prototype-builtins: Detected direct use of hasOwnProperty in SLink.js

These are left as-is to avoid code logic changes in this formatting PR, but flagged for future cleanup.

@KernelDeimos
Copy link
Contributor

Hi, apologies for the slow turn-around on this - there's been a lot of work to do the past few weeks. This PR does not entirely address my concerns in #1341 about the style guide. I can tell at a glance that it mostly doesn't follow the backend style guide.

@Yasir-Rafique
Copy link
Contributor Author

Hi @KernelDeimos, thanks for the feedback! 🙏

You are right. This PR doesn’t yet fully enforce every aspect of the backend style guide. Per our earlier discussion here the intent of this PR was to apply the auto-enforceable rules (via Prettier + ESLint), while leaving the manual conventions (like copyright headers, svc_ prefixes, file naming, and JSDoc requirements) for follow-up steps.

Specifically, this PR covered:

Prettier formatting (4-space indentation, semicolons, trailing commas, line length, spacing/braces)
ESLint rules for import order, unused vars, prototype builtins
Initial JSDoc warnings

And left for future cleanup/documentation:

Copyright header in each file
Special variable/file naming (svc_, PascalCase/kebab-case)
JSDoc completion for backend services/methods
Empty blocks with // NOOP

If it makes sense, I can:

Extend this PR to add the copyright header + file naming changes, or

Keep this PR focused on auto-formatting, and open a follow-up PR to address the manual style guide items.

Happy to go whichever way you prefer.

@Yasir-Rafique
Copy link
Contributor Author

Hello @KernelDeimos
Any follow-up on my last message?

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