Skip to content

all: Readd no-var and object-shorthand lint rules (connects #9082) - #10245

Open
paulbert wants to merge 1 commit into
masterfrom
9082-no-var-object-shorthand
Open

all: Readd no-var and object-shorthand lint rules (connects #9082)#10245
paulbert wants to merge 1 commit into
masterfrom
9082-no-var-object-shorthand

Conversation

@paulbert

@paulbert paulbert commented Aug 5, 2026

Copy link
Copy Markdown
Member

Written using an OpenCode free model (Big Pickle). I was intending to use a local model, but didn't realize OpenCode defaulted to a free model.

Anyway adding back in a few of the lint rules, here's the model outputs after running a few queries:

Added no-var: "error" to eslint.config.mjs:243 and fixed the only violation by changing declare var module to declare const module in src/typings.d.ts:2. Lint passes.

Added object-shorthand: ["error", "always"] to eslint.config.mjs:244 and auto-fixed all 25 violations with ng lint --fix. The fixes convert key: value to shorthand (value), which is semantically identical. Lint passes.

Summary by CodeRabbit

  • Refactor

    • Standardized object property shorthand throughout the application.
    • Updated declaration syntax for improved code consistency.
    • Added linting rules to discourage legacy variable declarations and enforce shorthand syntax.
  • Bug Fixes

    • No user-facing behavior changes.

@paulbert
paulbert requested a review from Mutugiii August 5, 2026 17:03
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 433719eb-4b13-4eaf-b93c-0c935ee63ee8

📥 Commits

Reviewing files that changed from the base of the PR and between 6c3ea09 and 713d299.

📒 Files selected for processing (21)
  • eslint.config.mjs
  • src/app/chat/chat-sidebar/chat-sidebar.component.ts
  • src/app/community/community.component.ts
  • src/app/courses/courses.service.ts
  • src/app/courses/progress-courses/courses-progress-leader.component.ts
  • src/app/manager-dashboard/manager.service.ts
  • src/app/manager-dashboard/reports/reports-detail.component.ts
  • src/app/manager-dashboard/reports/reports.utils.ts
  • src/app/manager-dashboard/requests/requests-table.component.ts
  • src/app/manager-dashboard/sync.directive.ts
  • src/app/resources/resources-add.component.ts
  • src/app/shared/calendar.component.ts
  • src/app/shared/couchdb.service.ts
  • src/app/shared/dialogs/change-password.directive.ts
  • src/app/shared/mangoQueries.ts
  • src/app/shared/sync.service.ts
  • src/app/surveys/surveys.component.ts
  • src/app/teams/teams-view.component.ts
  • src/app/users/users-update/users-update.component.ts
  • src/app/users/users.service.ts
  • src/typings.d.ts

📝 Walkthrough

Walkthrough

Changes

The ESLint configuration now requires no-var and object-shorthand. Application object literals and the global module declaration now use the enforced syntax. Runtime behavior remains unchanged.

Syntax standardization

Layer / File(s) Summary
Lint rules and global declaration
eslint.config.mjs, src/typings.d.ts
ESLint enables no-var and object-shorthand. The global module declaration changes from var to const.
Feature and dashboard object syntax
src/app/chat/..., src/app/community/..., src/app/courses/..., src/app/manager-dashboard/..., src/app/resources/..., src/app/shared/calendar.component.ts
Feature and dashboard payloads, selectors, dialog data, CSV data, and resource objects use shorthand properties.
Shared, survey, and user object syntax
src/app/shared/..., src/app/surveys/..., src/app/teams/..., src/app/users/...
Shared service requests, password handling, survey queries, dialog data, attachments, and role updates use shorthand or unquoted property syntax.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: ready to merge

Suggested reviewers: mutugiii

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring the no-var and object-shorthand ESLint rules.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 9082-no-var-object-shorthand

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@paulbert

paulbert commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Forgot to link to the issue, #9082

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants