diff --git a/assets/javascripts/discourse/components/amazon-product-links.js.es6 b/assets/javascripts/discourse/components/amazon-product-links.js.es6 index 5471520..b6721ec 100644 --- a/assets/javascripts/discourse/components/amazon-product-links.js.es6 +++ b/assets/javascripts/discourse/components/amazon-product-links.js.es6 @@ -1,8 +1,6 @@ import AdComponent from "discourse/plugins/discourse-adplugin/discourse/components/ad-component"; import computed from "ember-addons/ember-computed-decorators"; -const currentUser = Discourse.User.current(); - const data = { "topic-list-top": {}, "topic-above-post-stream": {}, diff --git a/assets/javascripts/discourse/components/carbonads-ad.js.es6 b/assets/javascripts/discourse/components/carbonads-ad.js.es6 index 3d49d8c..24f6c55 100644 --- a/assets/javascripts/discourse/components/carbonads-ad.js.es6 +++ b/assets/javascripts/discourse/components/carbonads-ad.js.es6 @@ -1,22 +1,19 @@ import AdComponent from "discourse/plugins/discourse-adplugin/discourse/components/ad-component"; import { - default as computed, - observes + default as computed } from "ember-addons/ember-computed-decorators"; -const currentUser = Discourse.User.current(), - serve_id = Discourse.SiteSettings.carbonads_serve_id, +const serve_id = Discourse.SiteSettings.carbonads_serve_id, placement = Discourse.SiteSettings.carbonads_placement; export default AdComponent.extend({ init() { this.set("serve_id", serve_id); - this.set("placement", placement); this._super(); }, - @computed("serve_id", "placement") - url(serveId, placement) { + @computed("serve_id") + url(serveId) { return `//cdn.carbonads.com/carbon.js?serve=${serveId}&placement=${placement}`.htmlSafe(); }, diff --git a/assets/javascripts/discourse/components/codefund-ad.js.es6 b/assets/javascripts/discourse/components/codefund-ad.js.es6 index bacbc56..b81394f 100644 --- a/assets/javascripts/discourse/components/codefund-ad.js.es6 +++ b/assets/javascripts/discourse/components/codefund-ad.js.es6 @@ -7,8 +7,7 @@ import { let _loaded = false, _promise = null; -const currentUser = Discourse.User.current(), - propertyId = Discourse.SiteSettings.codefund_property_id; +const propertyId = Discourse.SiteSettings.codefund_property_id; function loadCodeFund() { if (_loaded) { @@ -78,7 +77,10 @@ export default AdComponent.extend({ this.set("adDetails", data); this.set("adRequested", false); }) - .catch(error => console.log(error)); + .catch(error => { + // eslint-disable-next-line no-console + console.log(error); + }); }, didInsertElement() { diff --git a/assets/javascripts/discourse/components/google-adsense.js.es6 b/assets/javascripts/discourse/components/google-adsense.js.es6 index 077679a..4766628 100644 --- a/assets/javascripts/discourse/components/google-adsense.js.es6 +++ b/assets/javascripts/discourse/components/google-adsense.js.es6 @@ -7,7 +7,6 @@ import loadScript from "discourse/lib/load-script"; let _loaded = false, _promise = null, - currentUser = Discourse.User.current(), publisher_id = Discourse.SiteSettings.adsense_publisher_code; const mobileView = Discourse.Site.currentProp("mobileView"); diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index 27bc390..ba0b530 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -1,7 +1,6 @@ import AdComponent from "discourse/plugins/discourse-adplugin/discourse/components/ad-component"; import { default as computed, - observes, on } from "ember-addons/ember-computed-decorators"; import loadScript from "discourse/lib/load-script"; @@ -48,7 +47,7 @@ function custom_targeting(key_array, value_array, adSlot) { adSlot.setTargeting( key_array[i], valueParse(value_array[i]) - ) + ); } } } @@ -191,6 +190,7 @@ function loadGoogle() { _promise = loadScript(dfpSrc, { scriptTag: true }).then(function() { _loaded = true; if (window.googletag === undefined) { + // eslint-disable-next-line no-console console.log("googletag is undefined!"); } diff --git a/assets/javascripts/discourse/components/house-ad.js.es6 b/assets/javascripts/discourse/components/house-ad.js.es6 index dbb42de..a79b8e3 100644 --- a/assets/javascripts/discourse/components/house-ad.js.es6 +++ b/assets/javascripts/discourse/components/house-ad.js.es6 @@ -1,8 +1,7 @@ import AdComponent from "discourse/plugins/discourse-adplugin/discourse/components/ad-component"; import { default as computed, - observes, - on + observes } from "ember-addons/ember-computed-decorators"; const adIndex = { diff --git a/assets/javascripts/discourse/components/house-ads-chooser.js.es6 b/assets/javascripts/discourse/components/house-ads-chooser.js.es6 index f574bc9..6b4d57a 100644 --- a/assets/javascripts/discourse/components/house-ads-chooser.js.es6 +++ b/assets/javascripts/discourse/components/house-ads-chooser.js.es6 @@ -1,5 +1,4 @@ import MultiSelectComponent from "select-kit/components/multi-select"; -import computed from "ember-addons/ember-computed-decorators"; const { makeArray } = Ember; export default MultiSelectComponent.extend({ diff --git a/assets/javascripts/discourse/components/house-ads-list-setting.js.es6 b/assets/javascripts/discourse/components/house-ads-list-setting.js.es6 index 69133f7..145d974 100644 --- a/assets/javascripts/discourse/components/house-ads-list-setting.js.es6 +++ b/assets/javascripts/discourse/components/house-ads-list-setting.js.es6 @@ -1,6 +1,3 @@ -import { ajax } from "discourse/lib/ajax"; -import { popupAjaxError } from "discourse/lib/ajax-error"; -import computed from "ember-addons/ember-computed-decorators"; import HouseAdsSetting from "discourse/plugins/discourse-adplugin/discourse/components/house-ads-setting"; export default HouseAdsSetting.extend({ diff --git a/assets/javascripts/discourse/components/house-ads-setting.js.es6 b/assets/javascripts/discourse/components/house-ads-setting.js.es6 index ae87fa5..fdf81f6 100644 --- a/assets/javascripts/discourse/components/house-ads-setting.js.es6 +++ b/assets/javascripts/discourse/components/house-ads-setting.js.es6 @@ -1,7 +1,6 @@ import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; import { i18n, propertyNotEqual } from "discourse/lib/computed"; -import computed from "ember-addons/ember-computed-decorators"; export default Ember.Component.extend({ classNames: "house-ads-setting", @@ -32,7 +31,7 @@ export default Ember.Component.extend({ data: { value: this.get("adValue") } } ) - .then(data => { + .then(() => { const adSettings = this.get("adSettings"); adSettings.set(this.get("name"), this.get("adValue")); this.setProperties({ diff --git a/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js.es6 index 106d9b8..eccf86a 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-house-ads-show.js.es6 @@ -41,12 +41,12 @@ export default Ember.Controller.extend(bufferedProperty("model"), { data } ) - .then(data => { + .then(ajaxData => { this.commitBuffer(); this.set("savingStatus", I18n.t("saved")); if (newRecord) { const model = this.get("model"); - model.set("id", data.house_ad.id); + model.set("id", ajaxData.house_ad.id); const houseAds = this.get("adminPluginsHouseAds.model"); if (!houseAds.includes(model)) { houseAds.pushObject(model); diff --git a/assets/javascripts/discourse/routes/admin-plugins-house-ads.js.es6 b/assets/javascripts/discourse/routes/admin-plugins-house-ads.js.es6 index cf41b62..bc03d17 100644 --- a/assets/javascripts/discourse/routes/admin-plugins-house-ads.js.es6 +++ b/assets/javascripts/discourse/routes/admin-plugins-house-ads.js.es6 @@ -3,7 +3,7 @@ import { ajax } from "discourse/lib/ajax"; export default Discourse.Route.extend({ settings: null, - model(params) { + model() { return ajax("/admin/plugins/adplugin/house_ads.json").then(data => { this.set("settings", Ember.Object.create(data.settings)); return data.house_ads.map(ad => Ember.Object.create(ad)); diff --git a/assets/javascripts/initializers/initialize-ad-plugin.js.es6 b/assets/javascripts/initializers/initialize-ad-plugin.js.es6 index cd4c40a..5f07497 100644 --- a/assets/javascripts/initializers/initialize-ad-plugin.js.es6 +++ b/assets/javascripts/initializers/initialize-ad-plugin.js.es6 @@ -1,4 +1,3 @@ -import PostModel from "discourse/models/post"; import { withPluginApi } from "discourse/lib/plugin-api"; export default {