[gjs: 2/7] Add eslint "exported" comments to JS files
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 2/7] Add eslint "exported" comments to JS files
- Date: Sun, 25 Mar 2018 18:34:30 +0000 (UTC)
commit f8f1632e6b5980bae37f7dc5455c5a639cde1826
Author: Philip Chimento <philip chimento gmail com>
Date: Tue Mar 20 00:55:45 2018 -0700
Add eslint "exported" comments to JS files
This indicates which symbols are meant to be exported from each module,
so that eslint doesn't mark them as unused variables.
installed-tests/js/modules/foobar.js | 2 ++
installed-tests/js/modules/modunicode.js | 1 +
installed-tests/js/modules/mutualImport/a.js | 2 ++
installed-tests/js/modules/mutualImport/b.js | 2 ++
installed-tests/js/modules/subA/subB/__init__.js | 2 ++
installed-tests/js/modules/subA/subB/foobar.js | 2 ++
modules/cairo.js | 3 +++
modules/format.js | 2 ++
modules/gettext.js | 3 +++
modules/lang.js | 4 ++--
modules/mainloop.js | 3 +++
modules/package.js | 4 ++++
modules/signals.js | 2 ++
modules/tweener/equations.js | 9 +++++++++
modules/tweener/tweenList.js | 1 +
modules/tweener/tweener.js | 6 +++++-
test/gjs-test-coverage/loadedJSFromResource.js | 1 +
17 files changed, 46 insertions(+), 3 deletions(-)
---
diff --git a/installed-tests/js/modules/foobar.js b/installed-tests/js/modules/foobar.js
index 4ac0a24..a3b42db 100644
--- a/installed-tests/js/modules/foobar.js
+++ b/installed-tests/js/modules/foobar.js
@@ -1,5 +1,7 @@
// simple test module (used by testImporter.js)
+/* exported bar, foo, testToString, toString */
+
var foo = "This is foo";
var bar = "This is bar";
diff --git a/installed-tests/js/modules/modunicode.js b/installed-tests/js/modules/modunicode.js
index 560f5c8..e5ca6ca 100644
--- a/installed-tests/js/modules/modunicode.js
+++ b/installed-tests/js/modules/modunicode.js
@@ -1,3 +1,4 @@
+/* exported uval */
// This file is written in UTF-8.
var uval = "const ♥ utf8";
diff --git a/installed-tests/js/modules/mutualImport/a.js b/installed-tests/js/modules/mutualImport/a.js
index c5fd069..253d3c2 100644
--- a/installed-tests/js/modules/mutualImport/a.js
+++ b/installed-tests/js/modules/mutualImport/a.js
@@ -1,3 +1,5 @@
+/* exported getCount, getCountViaB, incrementCount */
+
const B = imports.mutualImport.b;
let count = 0;
diff --git a/installed-tests/js/modules/mutualImport/b.js b/installed-tests/js/modules/mutualImport/b.js
index b6443b1..d481760 100644
--- a/installed-tests/js/modules/mutualImport/b.js
+++ b/installed-tests/js/modules/mutualImport/b.js
@@ -1,3 +1,5 @@
+/* exported getCount */
+
const A = imports.mutualImport.a;
function getCount() {
diff --git a/installed-tests/js/modules/subA/subB/__init__.js
b/installed-tests/js/modules/subA/subB/__init__.js
index c7660dc..a0588e4 100644
--- a/installed-tests/js/modules/subA/subB/__init__.js
+++ b/installed-tests/js/modules/subA/subB/__init__.js
@@ -1,3 +1,5 @@
+/* exported ImporterClass, testImporterFunction */
+
function testImporterFunction() {
return "__init__ function tested";
}
diff --git a/installed-tests/js/modules/subA/subB/foobar.js b/installed-tests/js/modules/subA/subB/foobar.js
index cdd5cad..6520d96 100644
--- a/installed-tests/js/modules/subA/subB/foobar.js
+++ b/installed-tests/js/modules/subA/subB/foobar.js
@@ -1,4 +1,6 @@
// simple test module (used by testImporter.js)
+/* exported bar, foo */
+
var foo = "This is foo";
var bar = "This is bar";
diff --git a/modules/cairo.js b/modules/cairo.js
index bc5ad57..a8477e2 100644
--- a/modules/cairo.js
+++ b/modules/cairo.js
@@ -18,6 +18,9 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+/* exported Antialias, Content, Extend, FillRule, Filter, FontSlant, FontWeight,
+Format, LineCap, LineJoin, Operator, PatternType, SurfaceType */
+
const Lang = imports.lang;
var Antialias = {
diff --git a/modules/format.js b/modules/format.js
index 84a1d7b..246bfbf 100644
--- a/modules/format.js
+++ b/modules/format.js
@@ -1,5 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
+/* exported format, printf, vprintf */
+
const GjsPrivate = imports.gi.GjsPrivate;
function vprintf(str, args) {
diff --git a/modules/gettext.js b/modules/gettext.js
index 21648e1..92a101d 100644
--- a/modules/gettext.js
+++ b/modules/gettext.js
@@ -18,6 +18,9 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+/* exported bindtextdomain, dcgettext, dgettext, dngettext, domain, dpgettext,
+gettext, LocaleCategory, ngettext, pgettext, setlocale, textdomain */
+
/**
* This module provides a convenience layer for the "gettext" family of functions,
* relying on GLib for the actual implementation.
diff --git a/modules/lang.js b/modules/lang.js
index 54b5dbd..49c8061 100644
--- a/modules/lang.js
+++ b/modules/lang.js
@@ -1,6 +1,6 @@
/* -*- mode: js; indent-tabs-mode: nil; -*- */
-/* exported Class, Interface, bind, copyProperties, copyPublicProperties,
-countProperties */
+/* exported bind, copyProperties, copyPublicProperties, countProperties, Class,
+getMetaClass, Interface */
// Copyright (c) 2008 litl, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/modules/mainloop.js b/modules/mainloop.js
index 89c37fe..3971bfe 100644
--- a/modules/mainloop.js
+++ b/modules/mainloop.js
@@ -19,6 +19,9 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+/* exported idle_add, idle_source, quit, run, source_remove, timeout_add,
+timeout_add_seconds, timeout_seconds_source, timeout_source */
+
// A layer of convenience and backwards-compatibility over GLib MainLoop facilities
const GLib = imports.gi.GLib;
diff --git a/modules/package.js b/modules/package.js
index 2e6433f..20613df 100644
--- a/modules/package.js
+++ b/modules/package.js
@@ -18,6 +18,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+/* exported checkSymbol, datadir, init, initFormat, initGettext, initSubmodule,
+libdir, localedir, moduledir, name, pkgdatadir, pkglibdir, prefix, require,
+requireSymbol, run, start, version */
+
/**
* This module provides a set of convenience APIs for building packaged
* applications.
diff --git a/modules/signals.js b/modules/signals.js
index 2abeace..6a1bae6 100644
--- a/modules/signals.js
+++ b/modules/signals.js
@@ -20,6 +20,8 @@
* IN THE SOFTWARE.
*/
+/* exported addSignalMethods, WithSignals */
+
// A couple principals of this simple signal system:
// 1) should look just like our GObject signal binding
// 2) memory and safety matter more than speed of connect/disconnect/emit
diff --git a/modules/tweener/equations.js b/modules/tweener/equations.js
index 2c1b69d..1b33362 100644
--- a/modules/tweener/equations.js
+++ b/modules/tweener/equations.js
@@ -8,6 +8,15 @@
* @version 1.0.2
*/
+/* exported easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic,
+easeInExpo, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic,
+easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint,
+easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeNone,
+easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic,
+easeOutExpo, easeOutInBack, easeOutInBounce, easeOutInCirc, easeOutInCubic,
+easeOutInElastic, easeOutInExpo, easeOutInQuad, easeOutInQuart, easeOutInQuint,
+easeOutInSine, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, linear */
+
/*
Disclaimer for Robert Penner's Easing Equations license:
diff --git a/modules/tweener/tweenList.js b/modules/tweener/tweenList.js
index 25c4740..4efde21 100644
--- a/modules/tweener/tweenList.js
+++ b/modules/tweener/tweenList.js
@@ -7,6 +7,7 @@
* @version 1.0.4
* @private
*/
+/* exported makePropertiesChain, TweenList */
/*
Licensed under the MIT License
diff --git a/modules/tweener/tweener.js b/modules/tweener/tweener.js
index 8e27a54..15cb89d 100644
--- a/modules/tweener/tweener.js
+++ b/modules/tweener/tweener.js
@@ -7,7 +7,11 @@
* @author Zeh Fernando, Nate Chatellier, Arthur Debert
* @version 1.31.71
*/
-
+/* exported addCaller, addTween, FrameTicker, getTweenCount, getTimeScale,
+pauseAllTweens, pauseTweens, PropertyList, registerSpecialProperty,
+registerSpecialPropertyModifier, registerSpecialPropertySplitter,
+removeAllTweens, removeTweens, restrictedWords, resumeAllTweens, resumeTweens,
+setFrameTicker, setTimeScale */
/*
Licensed under the MIT License
diff --git a/test/gjs-test-coverage/loadedJSFromResource.js b/test/gjs-test-coverage/loadedJSFromResource.js
index 403d3d9..9a3bd8d 100644
--- a/test/gjs-test-coverage/loadedJSFromResource.js
+++ b/test/gjs-test-coverage/loadedJSFromResource.js
@@ -1 +1,2 @@
+/* exported mock_function */
function mock_function() {}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]