From 22210a9c159fadc81abda14fc5f2db8904687bf8 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 28 Nov 2023 10:49:49 +0100 Subject: [PATCH] DEV: Fix "no-setter-return" lint (#24585) --- .../javascripts/admin/addon/components/admin-theme-editor.js | 1 - .../admin/addon/components/email-styles-editor.js | 1 - .../javascripts/admin/addon/components/embedding-setting.js | 1 - .../javascripts/admin/addon/components/site-settings/bool.js | 1 - .../admin/addon/components/webhook-event-chooser.js | 4 +--- app/assets/javascripts/admin/addon/models/api-key.js | 1 - app/assets/javascripts/discourse/app/models/topic.js | 2 +- app/assets/javascripts/discourse/app/services/composer.js | 5 ++--- .../chat/assets/javascripts/discourse/models/chat-message.js | 1 - 9 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/admin/addon/components/admin-theme-editor.js b/app/assets/javascripts/admin/addon/components/admin-theme-editor.js index a5e30f26c81..4330acf9549 100644 --- a/app/assets/javascripts/admin/addon/components/admin-theme-editor.js +++ b/app/assets/javascripts/admin/addon/components/admin-theme-editor.js @@ -69,7 +69,6 @@ export default class AdminThemeEditor extends Component { set activeSection(value) { this.theme.setField(this.currentTargetName, this.fieldName, value); - return value; } @discourseComputed("maximized") diff --git a/app/assets/javascripts/admin/addon/components/email-styles-editor.js b/app/assets/javascripts/admin/addon/components/email-styles-editor.js index a709ba15ace..c0e21c3c7c7 100644 --- a/app/assets/javascripts/admin/addon/components/email-styles-editor.js +++ b/app/assets/javascripts/admin/addon/components/email-styles-editor.js @@ -30,7 +30,6 @@ export default class EmailStylesEditor extends Component { set editorContents(value) { this.styles.setField(this.fieldName, value); - return value; } @action diff --git a/app/assets/javascripts/admin/addon/components/embedding-setting.js b/app/assets/javascripts/admin/addon/components/embedding-setting.js index e99b85a0336..462f27c875a 100644 --- a/app/assets/javascripts/admin/addon/components/embedding-setting.js +++ b/app/assets/javascripts/admin/addon/components/embedding-setting.js @@ -28,6 +28,5 @@ export default class EmbeddingSetting extends Component { set checked(value) { this.set("value", value); - return value; } } diff --git a/app/assets/javascripts/admin/addon/components/site-settings/bool.js b/app/assets/javascripts/admin/addon/components/site-settings/bool.js index dc6001d31fb..321a4627610 100644 --- a/app/assets/javascripts/admin/addon/components/site-settings/bool.js +++ b/app/assets/javascripts/admin/addon/components/site-settings/bool.js @@ -13,6 +13,5 @@ export default class Bool extends Component { set enabled(value) { this.set("value", value ? "true" : "false"); - return value; } } diff --git a/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js b/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js index 0e585776cb9..be5516ad0d3 100644 --- a/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js +++ b/app/assets/javascripts/admin/addon/components/webhook-event-chooser.js @@ -23,7 +23,7 @@ export default class WebhookEventChooser extends Component { // add an association when not exists if (value === this.eventTypeExists) { - return value; + return; } if (value) { @@ -33,7 +33,5 @@ export default class WebhookEventChooser extends Component { eventTypes.filter((eventType) => eventType.name === this.args.type.name) ); } - - return value; } } diff --git a/app/assets/javascripts/admin/addon/models/api-key.js b/app/assets/javascripts/admin/addon/models/api-key.js index 89bd6793803..fb82d7873f3 100644 --- a/app/assets/javascripts/admin/addon/models/api-key.js +++ b/app/assets/javascripts/admin/addon/models/api-key.js @@ -19,7 +19,6 @@ export default class ApiKey extends RestModel { } else { this.set("_user", value); } - return this._user; } @discourseComputed("description") diff --git a/app/assets/javascripts/discourse/app/models/topic.js b/app/assets/javascripts/discourse/app/models/topic.js index 0ae356e1186..6e656ed2df8 100644 --- a/app/assets/javascripts/discourse/app/models/topic.js +++ b/app/assets/javascripts/discourse/app/models/topic.js @@ -198,7 +198,7 @@ const Topic = RestModel.extend({ }, set details(value) { - return (this._details = value); + this._details = value; }, @discourseComputed("visible") diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.js index c5a080fcfdf..b52d5f4de94 100644 --- a/app/assets/javascripts/discourse/app/services/composer.js +++ b/app/assets/javascripts/discourse/app/services/composer.js @@ -160,7 +160,7 @@ export default class ComposerService extends Service { } set disableSubmit(value) { - return this.set("_disableSubmit", value); + this.set("_disableSubmit", value); } @computed("model.category", "skipFormTemplate") @@ -188,7 +188,7 @@ export default class ComposerService extends Service { } set formTemplateInitialValues(values) { - return this.set("_formTemplateInitialValues", values); + this.set("_formTemplateInitialValues", values); } @action @@ -265,7 +265,6 @@ export default class ComposerService extends Service { key: "toolbar-enabled", value: val ? "true" : "false", }); - return val; } @discourseComputed("model.canEditTitle", "model.creatingPrivateMessage") diff --git a/plugins/chat/assets/javascripts/discourse/models/chat-message.js b/plugins/chat/assets/javascripts/discourse/models/chat-message.js index c7ddb899019..df0df7aedd0 100644 --- a/plugins/chat/assets/javascripts/discourse/models/chat-message.js +++ b/plugins/chat/assets/javascripts/discourse/models/chat-message.js @@ -134,7 +134,6 @@ export default class ChatMessage { set deletedAt(value) { this._deletedAt = value; this.incrementVersion(); - return this._deletedAt; } get cooked() {