[gjs: 30/43] CI: Add no-useless-constructor to eslint rules



commit 64d637d535d8bcb7e247cb95b662db93956f810d
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Aug 3 23:41:37 2019 -0700

    CI: Add no-useless-constructor to eslint rules
    
    A constructor that only calls super(), by definition is not needed
    because that's exactly what happens if there's no constructor.

 .eslintrc.yml                         | 1 +
 installed-tests/js/testLegacyClass.js | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/.eslintrc.yml b/.eslintrc.yml
index d3440e9b..25d1d2c3 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -104,6 +104,7 @@ rules:
     - varsIgnorePattern: (^unused|_$)
       argsIgnorePattern: ^(unused|_)
   no-useless-call: error
+  no-useless-constructor: error
   nonblock-statement-body-position:
     - error
     - below
diff --git a/installed-tests/js/testLegacyClass.js b/installed-tests/js/testLegacyClass.js
index a2245972..523e3f10 100644
--- a/installed-tests/js/testLegacyClass.js
+++ b/installed-tests/js/testLegacyClass.js
@@ -709,10 +709,6 @@ describe('ES6 class inheriting from Lang.Class', function () {
         spyOn(Legacy.prototype, 'overrideMe');
 
         Shiny = class extends Legacy {
-            constructor(someval) {
-                super(someval);
-            }
-
             chainUpToMe() {
                 super.chainUpToMe();
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]