[gjs: 29/43] CI: Add no-useless-call to eslint rules



commit cf037eed95dfd6cea1b5949f37934d7ce2fbbc0a
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Aug 3 23:38:22 2019 -0700

    CI: Add no-useless-call to eslint rules
    
    Function.call() or Function.apply() are less performant than a regular
    function call, so don't use them if they aren't necessary.

 .eslintrc.yml                       | 1 +
 installed-tests/js/testParamSpec.js | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/.eslintrc.yml b/.eslintrc.yml
index efc7bb86..d3440e9b 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -103,6 +103,7 @@ rules:
     # Vars use a suffix _ instead of a prefix because of file-scope private vars
     - varsIgnorePattern: (^unused|_$)
       argsIgnorePattern: ^(unused|_)
+  no-useless-call: error
   nonblock-statement-body-position:
     - error
     - below
diff --git a/installed-tests/js/testParamSpec.js b/installed-tests/js/testParamSpec.js
index 77cb0299..1382a450 100644
--- a/installed-tests/js/testParamSpec.js
+++ b/installed-tests/js/testParamSpec.js
@@ -10,8 +10,7 @@ function testParamSpec(type, params, defaultValue) {
     describe(`GObject.ParamSpec.${type}`, function () {
         let paramSpec;
         beforeEach(function () {
-            paramSpec = GObject.ParamSpec[type].apply(GObject.ParamSpec,
-                [name, nick, blurb, flags, ...params]);
+            paramSpec = GObject.ParamSpec[type](name, nick, blurb, flags, ...params);
         });
 
         it('has the correct name strings', function () {


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