Loading browser/components/BrowserGlue.jsm +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { }); // PluginManager is used in the listeners object below. // eslint-disable-next-line no-unused-vars // eslint-disable-next-line mozilla/valid-lazy XPCOMUtils.defineLazyModuleGetters(lazy, { PluginManager: "resource:///actors/PluginParent.jsm", }); Loading docs/code-quality/lint/linters/eslint-plugin-mozilla.rst +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ The plugin implements the following rules: eslint-plugin-mozilla/use-ownerGlobal eslint-plugin-mozilla/use-returnValue eslint-plugin-mozilla/use-services eslint-plugin-mozilla/valid-lazy eslint-plugin-mozilla/var-only-at-top-level Tests Loading docs/code-quality/lint/linters/eslint-plugin-mozilla/valid-lazy.rst 0 → 100644 +42 −0 Original line number Diff line number Diff line valid-lazy ========== Ensures that definitions and uses of properties on the ``lazy`` object are valid. This rule checks for using unknown properties, duplicated symbols and unused symbols. Examples of incorrect code for this rule: ----------------------------------------- .. code-block:: js const lazy = {}; // Unknown lazy member property {{name}} lazy.bar.foo(); .. code-block:: js const lazy = {}; XPCOMUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); // Duplicate symbol foo being added to lazy. XPCOMUtils.defineLazyGetter(lazy, "foo", "foo1.jsm"); lazy.foo3.bar(); .. code-block:: js const lazy = {}; // Unused lazy property foo XPCOMUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); Examples of correct code for this rule: --------------------------------------- .. code-block:: js const lazy = {}; XPCOMUtils.defineLazyGetter(lazy, "foo1", () => {}); XPCOMUtils.defineLazyModuleGetters(lazy, { foo2: "foo2.jsm" }); lazy.foo1.bar(); lazy.foo2.bar(); tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +1 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ module.exports = { "mozilla/use-ownerGlobal": "error", "mozilla/use-returnValue": "error", "mozilla/use-services": "error", "mozilla/valid-lazy": "error", "mozilla/valid-services": "error", // Use [] instead of Array() Loading tools/lint/eslint/eslint-plugin-mozilla/lib/index.js +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ module.exports = { "use-isInstance": require("./rules/use-isInstance"), "use-returnValue": require("../lib/rules/use-returnValue"), "use-services": require("../lib/rules/use-services"), "valid-lazy": require("../lib/rules/valid-lazy"), "valid-services": require("../lib/rules/valid-services"), "var-only-at-top-level": require("../lib/rules/var-only-at-top-level"), }, Loading Loading
browser/components/BrowserGlue.jsm +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ XPCOMUtils.defineLazyModuleGetters(lazy, { }); // PluginManager is used in the listeners object below. // eslint-disable-next-line no-unused-vars // eslint-disable-next-line mozilla/valid-lazy XPCOMUtils.defineLazyModuleGetters(lazy, { PluginManager: "resource:///actors/PluginParent.jsm", }); Loading
docs/code-quality/lint/linters/eslint-plugin-mozilla.rst +1 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ The plugin implements the following rules: eslint-plugin-mozilla/use-ownerGlobal eslint-plugin-mozilla/use-returnValue eslint-plugin-mozilla/use-services eslint-plugin-mozilla/valid-lazy eslint-plugin-mozilla/var-only-at-top-level Tests Loading
docs/code-quality/lint/linters/eslint-plugin-mozilla/valid-lazy.rst 0 → 100644 +42 −0 Original line number Diff line number Diff line valid-lazy ========== Ensures that definitions and uses of properties on the ``lazy`` object are valid. This rule checks for using unknown properties, duplicated symbols and unused symbols. Examples of incorrect code for this rule: ----------------------------------------- .. code-block:: js const lazy = {}; // Unknown lazy member property {{name}} lazy.bar.foo(); .. code-block:: js const lazy = {}; XPCOMUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); // Duplicate symbol foo being added to lazy. XPCOMUtils.defineLazyGetter(lazy, "foo", "foo1.jsm"); lazy.foo3.bar(); .. code-block:: js const lazy = {}; // Unused lazy property foo XPCOMUtils.defineLazyGetter(lazy, "foo", "foo.jsm"); Examples of correct code for this rule: --------------------------------------- .. code-block:: js const lazy = {}; XPCOMUtils.defineLazyGetter(lazy, "foo1", () => {}); XPCOMUtils.defineLazyModuleGetters(lazy, { foo2: "foo2.jsm" }); lazy.foo1.bar(); lazy.foo2.bar();
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +1 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,7 @@ module.exports = { "mozilla/use-ownerGlobal": "error", "mozilla/use-returnValue": "error", "mozilla/use-services": "error", "mozilla/valid-lazy": "error", "mozilla/valid-services": "error", // Use [] instead of Array() Loading
tools/lint/eslint/eslint-plugin-mozilla/lib/index.js +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ module.exports = { "use-isInstance": require("./rules/use-isInstance"), "use-returnValue": require("../lib/rules/use-returnValue"), "use-services": require("../lib/rules/use-services"), "valid-lazy": require("../lib/rules/valid-lazy"), "valid-services": require("../lib/rules/valid-services"), "var-only-at-top-level": require("../lib/rules/var-only-at-top-level"), }, Loading