index.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /**
  2. * @fileoverview A collection of rules that help enforce JavaScript coding
  3. * standard and avoid common errors in the Mozilla project.
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. "use strict";
  9. // ------------------------------------------------------------------------------
  10. // Plugin Definition
  11. // ------------------------------------------------------------------------------
  12. module.exports = {
  13. configs: {
  14. "browser-test": require("../lib/configs/browser-test"),
  15. "chrome-test": require("../lib/configs/chrome-test"),
  16. "mochitest-test": require("../lib/configs/mochitest-test"),
  17. recommended: require("../lib/configs/recommended"),
  18. "require-jsdoc": require("../lib/configs/require-jsdoc"),
  19. "valid-jsdoc": require("../lib/configs/valid-jsdoc"),
  20. "xpcshell-test": require("../lib/configs/xpcshell-test"),
  21. },
  22. environments: {
  23. "browser-window": require("../lib/environments/browser-window.js"),
  24. "chrome-script": require("../lib/environments/chrome-script.js"),
  25. "chrome-worker": require("../lib/environments/chrome-worker.js"),
  26. "frame-script": require("../lib/environments/frame-script.js"),
  27. jsm: require("../lib/environments/jsm.js"),
  28. "process-script": require("../lib/environments/process-script.js"),
  29. "remote-page": require("../lib/environments/remote-page.js"),
  30. simpletest: require("../lib/environments/simpletest.js"),
  31. sjs: require("../lib/environments/sjs.js"),
  32. "special-powers-sandbox": require("../lib/environments/special-powers-sandbox.js"),
  33. specific: require("../lib/environments/specific"),
  34. privileged: require("../lib/environments/privileged.js"),
  35. xpcshell: require("../lib/environments/xpcshell.js"),
  36. },
  37. rules: {
  38. "avoid-Date-timing": require("../lib/rules/avoid-Date-timing"),
  39. "avoid-removeChild": require("../lib/rules/avoid-removeChild"),
  40. "balanced-listeners": require("../lib/rules/balanced-listeners"),
  41. "balanced-observers": require("../lib/rules/balanced-observers"),
  42. "consistent-if-bracing": require("../lib/rules/consistent-if-bracing"),
  43. "import-browser-window-globals": require("../lib/rules/import-browser-window-globals"),
  44. "import-content-task-globals": require("../lib/rules/import-content-task-globals"),
  45. "import-globals": require("../lib/rules/import-globals"),
  46. "import-headjs-globals": require("../lib/rules/import-headjs-globals"),
  47. "lazy-getter-object-name": require("../lib/rules/lazy-getter-object-name"),
  48. "mark-exported-symbols-as-used": require("../lib/rules/mark-exported-symbols-as-used"),
  49. "mark-test-function-used": require("../lib/rules/mark-test-function-used"),
  50. "no-aArgs": require("../lib/rules/no-aArgs"),
  51. "no-addtask-setup": require("../lib/rules/no-addtask-setup"),
  52. "no-arbitrary-setTimeout": require("../lib/rules/no-arbitrary-setTimeout"),
  53. "no-compare-against-boolean-literals": require("../lib/rules/no-compare-against-boolean-literals"),
  54. "no-cu-reportError": require("../lib/rules/no-cu-reportError"),
  55. "no-define-cc-etc": require("../lib/rules/no-define-cc-etc"),
  56. "no-throw-cr-literal": require("../lib/rules/no-throw-cr-literal"),
  57. "no-useless-parameters": require("../lib/rules/no-useless-parameters"),
  58. "no-useless-removeEventListener": require("../lib/rules/no-useless-removeEventListener"),
  59. "no-useless-run-test": require("../lib/rules/no-useless-run-test"),
  60. "prefer-boolean-length-check": require("../lib/rules/prefer-boolean-length-check"),
  61. "prefer-formatValues": require("../lib/rules/prefer-formatValues"),
  62. "reject-addtask-only": require("../lib/rules/reject-addtask-only"),
  63. "reject-chromeutils-import-params": require("../lib/rules/reject-chromeutils-import-params"),
  64. "reject-eager-module-in-lazy-getter": require("../lib/rules/reject-eager-module-in-lazy-getter"),
  65. "reject-global-this": require("../lib/rules/reject-global-this"),
  66. "reject-globalThis-modification": require("../lib/rules/reject-globalThis-modification"),
  67. "reject-import-system-module-from-non-system": require("../lib/rules/reject-import-system-module-from-non-system"),
  68. "reject-importGlobalProperties": require("../lib/rules/reject-importGlobalProperties"),
  69. "reject-lazy-imports-into-globals": require("../lib/rules/reject-lazy-imports-into-globals"),
  70. "reject-mixing-eager-and-lazy": require("../lib/rules/reject-mixing-eager-and-lazy"),
  71. "reject-multiple-getters-calls": require("../lib/rules/reject-multiple-getters-calls"),
  72. "reject-osfile": require("../lib/rules/reject-osfile"),
  73. "reject-scriptableunicodeconverter": require("../lib/rules/reject-scriptableunicodeconverter"),
  74. "reject-relative-requires": require("../lib/rules/reject-relative-requires"),
  75. "reject-some-requires": require("../lib/rules/reject-some-requires"),
  76. "reject-top-level-await": require("../lib/rules/reject-top-level-await"),
  77. "rejects-requires-await": require("../lib/rules/rejects-requires-await"),
  78. "use-cc-etc": require("../lib/rules/use-cc-etc"),
  79. "use-chromeutils-generateqi": require("../lib/rules/use-chromeutils-generateqi"),
  80. "use-chromeutils-import": require("../lib/rules/use-chromeutils-import"),
  81. "use-default-preference-values": require("../lib/rules/use-default-preference-values"),
  82. "use-ownerGlobal": require("../lib/rules/use-ownerGlobal"),
  83. "use-includes-instead-of-indexOf": require("../lib/rules/use-includes-instead-of-indexOf"),
  84. "use-isInstance": require("./rules/use-isInstance"),
  85. "use-returnValue": require("../lib/rules/use-returnValue"),
  86. "use-services": require("../lib/rules/use-services"),
  87. "use-static-import": require("../lib/rules/use-static-import"),
  88. "valid-ci-uses": require("../lib/rules/valid-ci-uses"),
  89. "valid-lazy": require("../lib/rules/valid-lazy"),
  90. "valid-services": require("../lib/rules/valid-services"),
  91. "valid-services-property": require("../lib/rules/valid-services-property"),
  92. "var-only-at-top-level": require("../lib/rules/var-only-at-top-level"),
  93. },
  94. };