xpcshell-test.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Parent config file for all xpcshell files.
  2. "use strict";
  3. module.exports = {
  4. env: {
  5. browser: false,
  6. "mozilla/privileged": true,
  7. "mozilla/xpcshell": true,
  8. },
  9. overrides: [
  10. {
  11. // If it is a head file, we turn off global unused variable checks, as it
  12. // would require searching the other test files to know if they are used or not.
  13. // This would be expensive and slow, and it isn't worth it for head files.
  14. // We could get developers to declare as exported, but that doesn't seem worth it.
  15. files: "head*.js",
  16. rules: {
  17. "no-unused-vars": [
  18. "error",
  19. {
  20. args: "none",
  21. vars: "local",
  22. },
  23. ],
  24. },
  25. },
  26. {
  27. // No declaring variables that are never used
  28. files: "test*.js",
  29. rules: {
  30. "no-unused-vars": [
  31. "error",
  32. {
  33. args: "none",
  34. vars: "all",
  35. },
  36. ],
  37. },
  38. },
  39. ],
  40. rules: {
  41. "mozilla/import-headjs-globals": "error",
  42. "mozilla/mark-test-function-used": "error",
  43. "mozilla/no-arbitrary-setTimeout": "error",
  44. "mozilla/no-useless-run-test": "error",
  45. "no-shadow": "error",
  46. },
  47. };