[gnome-shell] background: Add exception to no-loop-func rule



commit 66fc5c07bb950fee0e7d87d0b09af9a04c2efe01
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Sep 15 02:51:40 2019 +0200

    background: Add exception to no-loop-func rule
    
    Modifying variables from an outer scope in functions created in a loop
    is considered problematic by eslint, because the variable value in the
    resulting closure is often not what the coder intended.
    
    In this particular case however, the scoping is correct, so add a comment
    to disable the rule locally.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818

 js/ui/background.js | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 4d5d132491..f7506dec4b 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -403,6 +403,7 @@ var Background = GObject.registerClass({
                 if (numPendingImages == 0)
                     finish();
             } else {
+                // eslint-disable-next-line no-loop-func
                 let id = image.connect('loaded', () => {
                     image.disconnect(id);
                     numPendingImages--;


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