DEV: s/this._super()/this._super(...arguments) (#6908)

DEV: s/this._super()/this._super(…arguments) (#6908)

diff --git a/Dangerfile b/Dangerfile
index a3abee3..f1c779c 100644
--- a/Dangerfile
+++ b/Dangerfile
@@ -17,3 +17,26 @@ has_non_en_locales_changes = locales_changes.grep_v(/config\/locales\/(client|se
 if locales_changes.any? && has_non_en_locales_changes
   fail("Please submit your non-English translation updates via [Transifex](https://www.transifex.com/discourse/discourse-org/). You can read more on how to contribute translations [here](https://meta.discourse.org/t/contribute-a-translation-to-discourse/14882).")
 end
+
+files = (git.added_files + git.modified_files)
+  .reject! { |path| path.start_with?("plugins/") }
+  .reject! { |path| !(path.end_with?("es6") || path.end_with?("rb")) }
+
+super_offenses = []
+
+files.each do |path|
+  diff = git.diff_for_file(path)
+
+  next if !diff
+
+  diff.patch.lines.grep(/^\+\s\s/).each do |added_line|
+    super_offenses << path if added_line['this._super()']
+  end
+end
+
+if !super_offenses.empty?
+  warn(%{
+When possible use `this._super(...arguments)` instead of `this._super()`\n
+#{super_offenses.uniq.map { |o| github.html_link(o) }.join("\n")}
+  })
+end
diff --git a/Gemfile.lock b/Gemfile.lock
index e30bbc0..2914887 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -91,14 +91,14 @@ GEM
     crack (0.4.3)
       safe_yaml (~> 1.0.0)
     crass (1.0.4)
-    danger (5.6.3)
+    danger (5.11.1)
       claide (~> 1.0)
       claide-plugins (>= 0.9.2)
       colored2 (~> 3.1)
       cork (~> 0.1)
       faraday (~> 0.9)
       faraday-http-cache (~> 1.0)
-      git (~> 1)
+      git (~> 1.5)
       kramdown (~> 1.5)
       no_proxy_fix
       octokit (~> 4.7)
@@ -148,7 +148,7 @@ GEM
       thor (~> 0.19.1)
     fspath (3.1.0)
     gc_tracer (1.5.1)
-    git (1.4.0)
+    git (1.5.0)
     globalid (0.4.1)
       activesupport (>= 4.2.0)
     guess_html_encoding (0.0.11)
@@ -229,7 +229,7 @@ GEM
       multi_json (~> 1.3)
       multi_xml (~> 0.5)
       rack (>= 1.2, < 3)
-    octokit (4.9.0)
+    octokit (4.13.0)
       sawyer (~> 0.8.0, >= 0.5.3)
     oj (3.6.2)
     omniauth (1.9.0)
@@ -284,7 +284,7 @@ GEM
       pry (>= 0.9.10, < 0.11.0)
     pry-rails (0.3.6)
       pry (>= 0.10.4)
-    public_suffix (3.0.2)
+    public_suffix (3.0.3)
     puma (3.11.4)
     r2 (0.2.7)
     rack (2.0.6)
diff --git a/app/assets/javascripts/admin/components/ace-editor.js.es6 b/app/assets/javascripts/admin/components/ace-editor.js.es6
index f0f5750..b86c0e4 100644
--- a/app/assets/javascripts/admin/components/ace-editor.js.es6
+++ b/app/assets/javascripts/admin/components/ace-editor.js.es6
@@ -67,7 +67,7 @@ export default Ember.Component.extend({
   },
 
   didInsertElement() {
-    this._super();
+    this._super(...arguments);
 
     loadScript("/javascripts/ace/ace.js").then(() => {
       window.ace.require(["ace/ace"], loadedAce => {
diff --git a/app/assets/javascripts/admin/components/admin-backups-logs.js.es6 b/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
index 9c92228..4db599b 100644
--- a/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
+++ b/app/assets/javascripts/admin/components/admin-backups-logs.js.es6
@@ -9,7 +9,7 @@ export default Ember.Component.extend(
     classNames: ["admin-backups-logs"],
 
     init() {
-      this._super();
+      this._super(...arguments);
       this._reset();
     },
 
diff --git a/app/assets/javascripts/admin/components/admin-report.js.es6 b/app/assets/javascripts/admin/components/admin-report.js.es6
index 56f2457..2fe345c 100644
--- a/app/assets/javascripts/admin/components/admin-report.js.es6
+++ b/app/assets/javascripts/admin/components/admin-report.js.es6
@@ -311,7 +311,7 @@ export default Ember.Component.extend({
   },
 
   _fetchReport() {
-    this._super();
+    this._super(...arguments);
 
     this.setProperties({ isLoading: true, rateLimitationString: null });
 
diff --git a/app/assets/javascripts/admin/components/admin-wrapper.js.es6 b/app/assets/javascripts/admin/components/admin-wrapper.js.es6
index 034e2a0..45daf32 100644
--- a/app/assets/javascripts/admin/components/admin-wrapper.js.es6
+++ b/app/assets/javascripts/admin/components/admin-wrapper.js.es6
@@ -1,11 +1,11 @@
 export default Ember.Component.extend({
   didInsertElement() {
-    this._super();
+    this._super(...arguments);
     $("body").addClass("admin-interface");
   },
 
   willDestroyElement() {
-    this._super();
+    this._super(...arguments);
     $("body").removeClass("admin-interface");
   }
 });
diff --git a/app/assets/javascripts/admin/components/staff-actions.js.es6 b/app/assets/javascripts/admin/components/staff-actions.js.es6
index 07764a8..3a979b0 100644
--- a/app/assets/javascripts/admin/components/staff-actions.js.es6
+++ b/app/assets/javascripts/admin/components/staff-actions.js.es6
@@ -8,7 +8,7 @@ export default Ember.Component.extend({
   },
 
   didInsertElement() {
-    this._super();
+    this._super(...arguments);
 
     this.$().on("click.discourse-staff-logs", "[data-link-post-id]", e => {
       let postId = $(e.target).attr("data-link-post-id");
diff --git a/app/assets/javascripts/admin/models/color-scheme-color.js.es6 b/app/assets/javascripts/admin/models/color-scheme-color.js.es6
index dd02f7e..de0bee5 100644
--- a/app/assets/javascripts/admin/models/color-scheme-color.js.es6
+++ b/app/assets/javascripts/admin/models/color-scheme-color.js.es6
@@ -1,6 +1,6 @@
 const ColorSchemeColor = Discourse.Model.extend({
   init: function() {
-    this._super();
+    this._super(...arguments);
     this.startTrackingChanges();
   },
 
diff --git a/app/assets/javascripts/admin/models/color-scheme.js.es6 b/app/assets/javascripts/admin/models/color-scheme.js.es6
index fc24331..e7fbe31 100644
--- a/app/assets/javascripts/admin/models/color-scheme.js.es6
+++ b/app/assets/javascripts/admin/models/color-scheme.js.es6
@@ -3,7 +3,7 @@ import ColorSchemeColor from "admin/models/color-scheme-color";
 
 const ColorScheme = Discourse.Model.extend(Ember.Copyable, {
   init: function() {
-    this._super();
+    this._super(...arguments);
     this.startTrackingChanges();
   },
 
diff --git a/app/assets/javascripts/admin/services/admin-tools.js.es6 b/app/assets/javascripts/admin/services/admin-tools.js.es6
index 29c9581..ba6bd98 100644
--- a/app/assets/javascripts/admin/services/admin-tools.js.es6
+++ b/app/assets/javascripts/admin/services/admin-tools.js.es6
@@ -10,7 +10,7 @@ import { getOwner } from "discourse-common/lib/get-owner";
 
 export default Ember.Service.extend({
   init() {
-    this._super();
+    this._super(...arguments);
 
     // TODO: Make `siteSettings` a service that can be injected
     this.siteSettings = getOwner(this).lookup("site-settings:main");
diff --git a/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6 b/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6
index 7c7b226..8e23ba5 100644
--- a/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6
+++ b/app/assets/javascripts/discourse-common/lib/buffered-render.js.es6
@@ -28,14 +28,14 @@ export function bufferedRender(obj) {
   const caller = {};
 
   caller.didRender = function() {
-    this._super();
+    this._super(...arguments);
     this._customRender();
   };
 
   const triggers = obj.rerenderTriggers;
   if (triggers) {
     caller.init = function() {
-      this._super();
+      this._super(...arguments);
       triggers.forEach(k => this.addObserver(k, this.rerenderBuffer));
     };
   }
diff --git a/app/assets/javascripts/discourse/components/add-category-class.js.es6 b/app/assets/javascripts/discourse/components/add-category-class.js.es6
index 05cf3c6..6fbb9c8 100644
--- a/app/assets/javascripts/discourse/components/add-category-class.js.es6
+++ b/app/assets/javascripts/discourse/components/add-category-class.js.es6
@@ -4,7 +4,7 @@ export default Ember.Component.extend({
   _slug: null,
 
   didInsertElement() {
-    this._super();
+    this._super(...arguments);
     this.refreshClass();
   },
 
@@ -31,7 +31,7 @@ export default Ember.Component.extend({
   },
 

[... diff too long, it was truncated ...]

GitHub sha: 502b1316